Irrlicht 3D Engine
 
Loading...
Searching...
No Matches
ICameraSceneNode.h
Go to the documentation of this file.
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __I_CAMERA_SCENE_NODE_H_INCLUDED__
6#define __I_CAMERA_SCENE_NODE_H_INCLUDED__
7
8#include "ISceneNode.h"
9#include "IEventReceiver.h"
10
11namespace irr
12{
13namespace scene
14{
15 struct SViewFrustum;
16
18
24 {
25 public:
26
29 const core::vector3df& position = core::vector3df(0,0,0),
30 const core::vector3df& rotation = core::vector3df(0,0,0),
31 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f))
32 : ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {}
33
35
45 virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal=false) =0;
46
48
49 virtual const core::matrix4& getProjectionMatrix() const =0;
50
52
53 virtual const core::matrix4& getViewMatrix() const =0;
54
56
60 virtual void setViewMatrixAffector(const core::matrix4& affector) =0;
61
63
64 virtual const core::matrix4& getViewMatrixAffector() const =0;
65
67
73 virtual bool OnEvent(const SEvent& event) =0;
74
76
83 virtual void setTarget(const core::vector3df& pos) =0;
84
86
91 virtual void setRotation(const core::vector3df& rotation) =0;
92
94
95 virtual const core::vector3df& getTarget() const =0;
96
98
99 virtual void setUpVector(const core::vector3df& pos) =0;
100
102
103 virtual const core::vector3df& getUpVector() const =0;
104
106
107 virtual f32 getNearValue() const =0;
108
110
111 virtual f32 getFarValue() const =0;
112
114
115 virtual f32 getAspectRatio() const =0;
116
118
119 virtual f32 getFOV() const =0;
120
122
123 virtual void setNearValue(f32 zn) =0;
124
126
127 virtual void setFarValue(f32 zf) =0;
128
130
131 virtual void setAspectRatio(f32 aspect) =0;
132
134
135 virtual void setFOV(f32 fovy) =0;
136
138
140 virtual const SViewFrustum* getViewFrustum() const =0;
141
143
145 virtual void setInputReceiverEnabled(bool enabled) =0;
146
148 virtual bool isInputReceiverEnabled() const =0;
149
151 virtual bool isOrthogonal() const
152 {
154 return IsOrthogonal;
155 }
156
158
166 virtual void bindTargetAndRotation(bool bound) =0;
167
169
170 virtual bool getTargetAndRotationBinding(void) const =0;
171
174 {
176
177 if (!out)
178 return;
179 out->addBool ("IsOrthogonal", IsOrthogonal );
180 }
181
184 {
186 if (!in)
187 return;
188
189 if ( in->findAttribute("IsOrthogonal") )
190 IsOrthogonal = in->getAttributeAsBool("IsOrthogonal");
191 }
192
193 protected:
194
196 {
197 IsOrthogonal = toCopyFrom->IsOrthogonal;
198 }
199
201 };
202
203} // end namespace scene
204} // end namespace irr
205
206#endif
207
Interface of an object which can receive events.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition matrix4.h:46
Provides a generic interface for attributes and their values and the possiblity to serialize them.
Definition IAttributes.h:42
virtual bool getAttributeAsBool(const c8 *attributeName)=0
virtual void addBool(const c8 *attributeName, bool value)=0
Adds an attribute as bool.
virtual s32 findAttribute(const c8 *attributeName) const =0
Returns attribute index from name, -1 if not found.
Scene Node which is a (controlable) camera.
virtual void setProjectionMatrix(const core::matrix4 &projection, bool isOrthogonal=false)=0
Sets the projection matrix of the camera.
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const
Writes attributes of the camera node.
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)
Reads attributes of the camera node.
virtual bool isInputReceiverEnabled() const =0
Checks if the input receiver of the camera is currently enabled.
virtual const core::vector3df & getTarget() const =0
Gets the current look at target of the camera.
virtual void setUpVector(const core::vector3df &pos)=0
Sets the up vector of the camera.
virtual const core::matrix4 & getViewMatrixAffector() const =0
Get the custom view matrix affector.
virtual bool getTargetAndRotationBinding(void) const =0
Queries if the camera scene node's rotation and its target position are bound together.
virtual void setFOV(f32 fovy)=0
Sets the field of view (Default: PI / 2.5f)
virtual const core::vector3df & getUpVector() const =0
Gets the up vector of the camera.
virtual void setInputReceiverEnabled(bool enabled)=0
Disables or enables the camera to get key or mouse inputs.
virtual void setAspectRatio(f32 aspect)=0
Sets the aspect ratio (default: 4.0f / 3.0f)
virtual bool isOrthogonal() const
Checks if a camera is orthogonal.
void cloneMembers(ICameraSceneNode *toCopyFrom)
virtual void setTarget(const core::vector3df &pos)=0
Sets the look at target of the camera.
virtual const core::matrix4 & getProjectionMatrix() const =0
Gets the current projection matrix of the camera.
virtual f32 getFarValue() const =0
Gets the value of the far plane of the camera.
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.
virtual f32 getFOV() const =0
Gets the field of view of the camera.
virtual void setNearValue(f32 zn)=0
Sets the value of the near clipping plane. (default: 1.0f)
virtual void setFarValue(f32 zf)=0
Sets the value of the far clipping plane (default: 2000.0f)
virtual const core::matrix4 & getViewMatrix() const =0
Gets the current view matrix of the camera.
virtual void bindTargetAndRotation(bool bound)=0
Binds the camera scene node's rotation to its target position and vice vera, or unbinds them.
virtual void setViewMatrixAffector(const core::matrix4 &affector)=0
Sets a custom view matrix affector.
virtual const SViewFrustum * getViewFrustum() const =0
Get the view frustum.
virtual f32 getAspectRatio() const =0
Gets the aspect ratio of the camera.
virtual f32 getNearValue() const =0
Gets the value of the near plane of the camera.
virtual bool OnEvent(const SEvent &event)=0
It is possible to send mouse and key events to the camera.
virtual void setRotation(const core::vector3df &rotation)=0
Sets the rotation of the node.
The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
Scene node interface.
Definition ISceneNode.h:41
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const
Writes attributes of the scene node.
Definition ISceneNode.h:687
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)
Reads attributes of the scene node.
Definition ISceneNode.h:712
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
Defines a small statement to work around a microsoft compiler bug.
Definition irrTypes.h:207
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
float f32
32 bit floating point variable.
Definition irrTypes.h:104
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
SEvents hold information about an event. See irr::IEventReceiver for details on event handling.
struct holding data describing options
Defines the view frustum. That's the space visible by the camera.