Loading...
Searching...
No Matches
ICameraSceneNode.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_CAMERA_SCENE_NODE_H_INCLUDED__
#define __I_CAMERA_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
#include "IEventReceiver.h"
namespace irr
{
namespace scene
{
struct SViewFrustum;
class ICameraSceneNode : public ISceneNode, public IEventReceiver
{
public:
ICameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f))
: ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {}
virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal=false) =0;
virtual const core::matrix4& getProjectionMatrix() const =0;
virtual const core::matrix4& getViewMatrix() const =0;
virtual void setViewMatrixAffector(const core::matrix4& affector) =0;
virtual const core::matrix4& getViewMatrixAffector() const =0;
virtual bool OnEvent(const SEvent& event) =0;
virtual void setTarget(const core::vector3df& pos) =0;
virtual void setRotation(const core::vector3df& rotation) =0;
virtual const core::vector3df& getTarget() const =0;
virtual void setUpVector(const core::vector3df& pos) =0;
virtual const core::vector3df& getUpVector() const =0;
virtual f32 getNearValue() const =0;
virtual f32 getFarValue() const =0;
virtual f32 getAspectRatio() const =0;
virtual f32 getFOV() const =0;
virtual void setNearValue(f32 zn) =0;
virtual void setFarValue(f32 zf) =0;
virtual void setAspectRatio(f32 aspect) =0;
virtual void setFOV(f32 fovy) =0;
virtual const SViewFrustum* getViewFrustum() const =0;
virtual void setInputReceiverEnabled(bool enabled) =0;
virtual bool isInputReceiverEnabled() const =0;
virtual bool isOrthogonal() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsOrthogonal;
}
virtual void bindTargetAndRotation(bool bound) =0;
virtual bool getTargetAndRotationBinding(void) const =0;
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
{
ISceneNode::serializeAttributes(out, options);
if (!out)
return;
out->addBool ("IsOrthogonal", IsOrthogonal );
}
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
ISceneNode::deserializeAttributes(in, options);
if (!in)
return;
if ( in->findAttribute("IsOrthogonal") )
IsOrthogonal = in->getAttributeAsBool("IsOrthogonal");
}
protected:
void cloneMembers(ICameraSceneNode* toCopyFrom)
{
IsOrthogonal = toCopyFrom->IsOrthogonal;
}
bool IsOrthogonal;
};
} // end namespace scene
} // end namespace irr
#endif
IEventReceiver.h
ISceneNode.h
irr::IEventReceiver
Interface of an object which can receive events.
Definition IEventReceiver.h:434
irr::io::IAttributes
Provides a generic interface for attributes and their values and the possiblity to serialize them.
Definition IAttributes.h:42
irr::io::IAttributes::getAttributeAsBool
virtual bool getAttributeAsBool(const c8 *attributeName)=0
irr::io::IAttributes::addBool
virtual void addBool(const c8 *attributeName, bool value)=0
Adds an attribute as bool.
irr::io::IAttributes::findAttribute
virtual s32 findAttribute(const c8 *attributeName) const =0
Returns attribute index from name, -1 if not found.
irr::scene::ICameraSceneNode::setProjectionMatrix
virtual void setProjectionMatrix(const core::matrix4 &projection, bool isOrthogonal=false)=0
Sets the projection matrix of the camera.
irr::scene::ICameraSceneNode::serializeAttributes
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const
Writes attributes of the camera node.
Definition ICameraSceneNode.h:173
irr::scene::ICameraSceneNode::deserializeAttributes
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)
Reads attributes of the camera node.
Definition ICameraSceneNode.h:183
irr::scene::ICameraSceneNode::isInputReceiverEnabled
virtual bool isInputReceiverEnabled() const =0
Checks if the input receiver of the camera is currently enabled.
irr::scene::ICameraSceneNode::getTarget
virtual const core::vector3df & getTarget() const =0
Gets the current look at target of the camera.
irr::scene::ICameraSceneNode::setUpVector
virtual void setUpVector(const core::vector3df &pos)=0
Sets the up vector of the camera.
irr::scene::ICameraSceneNode::getViewMatrixAffector
virtual const core::matrix4 & getViewMatrixAffector() const =0
Get the custom view matrix affector.
irr::scene::ICameraSceneNode::getTargetAndRotationBinding
virtual bool getTargetAndRotationBinding(void) const =0
Queries if the camera scene node's rotation and its target position are bound together.
irr::scene::ICameraSceneNode::setFOV
virtual void setFOV(f32 fovy)=0
Sets the field of view (Default: PI / 2.5f).
irr::scene::ICameraSceneNode::getUpVector
virtual const core::vector3df & getUpVector() const =0
Gets the up vector of the camera.
irr::scene::ICameraSceneNode::setInputReceiverEnabled
virtual void setInputReceiverEnabled(bool enabled)=0
Disables or enables the camera to get key or mouse inputs.
irr::scene::ICameraSceneNode::setAspectRatio
virtual void setAspectRatio(f32 aspect)=0
Sets the aspect ratio (default: 4.0f / 3.0f).
irr::scene::ICameraSceneNode::isOrthogonal
virtual bool isOrthogonal() const
Checks if a camera is orthogonal.
Definition ICameraSceneNode.h:151
irr::scene::ICameraSceneNode::cloneMembers
void cloneMembers(ICameraSceneNode *toCopyFrom)
Definition ICameraSceneNode.h:195
irr::scene::ICameraSceneNode::setTarget
virtual void setTarget(const core::vector3df &pos)=0
Sets the look at target of the camera.
irr::scene::ICameraSceneNode::getProjectionMatrix
virtual const core::matrix4 & getProjectionMatrix() const =0
Gets the current projection matrix of the camera.
irr::scene::ICameraSceneNode::getFarValue
virtual f32 getFarValue() const =0
Gets the value of the far plane of the camera.
irr::scene::ICameraSceneNode::ICameraSceneNode
ICameraSceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f))
Constructor.
Definition ICameraSceneNode.h:28
irr::scene::ICameraSceneNode::getFOV
virtual f32 getFOV() const =0
Gets the field of view of the camera.
irr::scene::ICameraSceneNode::setNearValue
virtual void setNearValue(f32 zn)=0
Sets the value of the near clipping plane. (default: 1.0f).
irr::scene::ICameraSceneNode::IsOrthogonal
bool IsOrthogonal
Definition ICameraSceneNode.h:200
irr::scene::ICameraSceneNode::setFarValue
virtual void setFarValue(f32 zf)=0
Sets the value of the far clipping plane (default: 2000.0f).
irr::scene::ICameraSceneNode::getViewMatrix
virtual const core::matrix4 & getViewMatrix() const =0
Gets the current view matrix of the camera.
irr::scene::ICameraSceneNode::bindTargetAndRotation
virtual void bindTargetAndRotation(bool bound)=0
Binds the camera scene node's rotation to its target position and vice vera, or unbinds them.
irr::scene::ICameraSceneNode::setViewMatrixAffector
virtual void setViewMatrixAffector(const core::matrix4 &affector)=0
Sets a custom view matrix affector.
irr::scene::ICameraSceneNode::getViewFrustum
virtual const SViewFrustum * getViewFrustum() const =0
Get the view frustum.
irr::scene::ICameraSceneNode::getAspectRatio
virtual f32 getAspectRatio() const =0
Gets the aspect ratio of the camera.
irr::scene::ICameraSceneNode::getNearValue
virtual f32 getNearValue() const =0
Gets the value of the near plane of the camera.
irr::scene::ICameraSceneNode::OnEvent
virtual bool OnEvent(const SEvent &event)=0
It is possible to send mouse and key events to the camera.
irr::scene::ICameraSceneNode::setRotation
virtual void setRotation(const core::vector3df &rotation)=0
Sets the rotation of the node.
irr::scene::ISceneManager
The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
Definition ISceneManager.h:151
irr::scene::ISceneNode::serializeAttributes
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const
Writes attributes of the scene node.
Definition ISceneNode.h:687
irr::scene::ISceneNode::deserializeAttributes
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)
Reads attributes of the scene node.
Definition ISceneNode.h:712
irr::scene::ISceneNode::ISceneNode
ISceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id=-1, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f))
Constructor.
Definition ISceneNode.h:45
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
Defines a small statement to work around a microsoft compiler bug.
Definition irrTypes.h:207
irr::core::vector3df
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition vector3d.h:445
irr::core::matrix4
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2235
irr::scene
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CDynamicMeshBuffer.h:16
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::f32
float f32
32 bit floating point variable.
Definition irrTypes.h:104
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
irr::SEvent
SEvents hold information about an event. See irr::IEventReceiver for details on event handling.
Definition IEventReceiver.h:263
irr::io::SAttributeReadWriteOptions
struct holding data describing options
Definition IAttributeExchangingObject.h:35
irr::scene::SViewFrustum
Defines the view frustum. That's the space visible by the camera.
Definition SViewFrustum.h:26
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0