|
IrrlichtEngine
|
00001 // Copyright (C) 2002-2011 Nikolaus Gebhardt 00002 // This file is part of the "Irrlicht Engine". 00003 // For conditions of distribution and use, see copyright notice in irrlicht.h 00004 00005 #ifndef __I_CAMERA_SCENE_NODE_H_INCLUDED__ 00006 #define __I_CAMERA_SCENE_NODE_H_INCLUDED__ 00007 00008 #include "ISceneNode.h" 00009 #include "IEventReceiver.h" 00010 00011 namespace irr 00012 { 00013 namespace scene 00014 { 00015 struct SViewFrustum; 00016 00018 00023 class ICameraSceneNode : public ISceneNode, public IEventReceiver 00024 { 00025 public: 00026 00028 ICameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 00029 const core::vector3df& position = core::vector3df(0,0,0), 00030 const core::vector3df& rotation = core::vector3df(0,0,0), 00031 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f)) 00032 : ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {} 00033 00035 00045 virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal=false) =0; 00046 00048 00049 virtual const core::matrix4& getProjectionMatrix() const =0; 00050 00052 00053 virtual const core::matrix4& getViewMatrix() const =0; 00054 00056 00060 virtual void setViewMatrixAffector(const core::matrix4& affector) =0; 00061 00063 00064 virtual const core::matrix4& getViewMatrixAffector() const =0; 00065 00067 00073 virtual bool OnEvent(const SEvent& event) =0; 00074 00076 00083 virtual void setTarget(const core::vector3df& pos) =0; 00084 00086 00091 virtual void setRotation(const core::vector3df& rotation) =0; 00092 00094 00095 virtual const core::vector3df& getTarget() const =0; 00096 00098 00099 virtual void setUpVector(const core::vector3df& pos) =0; 00100 00102 00103 virtual const core::vector3df& getUpVector() const =0; 00104 00106 00107 virtual f32 getNearValue() const =0; 00108 00110 00111 virtual f32 getFarValue() const =0; 00112 00114 00115 virtual f32 getAspectRatio() const =0; 00116 00118 00119 virtual f32 getFOV() const =0; 00120 00122 00123 virtual void setNearValue(f32 zn) =0; 00124 00126 00127 virtual void setFarValue(f32 zf) =0; 00128 00130 00131 virtual void setAspectRatio(f32 aspect) =0; 00132 00134 00135 virtual void setFOV(f32 fovy) =0; 00136 00138 00140 virtual const SViewFrustum* getViewFrustum() const =0; 00141 00143 00145 virtual void setInputReceiverEnabled(bool enabled) =0; 00146 00148 virtual bool isInputReceiverEnabled() const =0; 00149 00151 virtual bool isOrthogonal() const 00152 { 00153 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 00154 return IsOrthogonal; 00155 } 00156 00158 00166 virtual void bindTargetAndRotation(bool bound) =0; 00167 00169 00170 virtual bool getTargetAndRotationBinding(void) const =0; 00171 00173 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const 00174 { 00175 ISceneNode::serializeAttributes(out, options); 00176 00177 if (!out) 00178 return; 00179 out->addBool ("IsOrthogonal", IsOrthogonal ); 00180 } 00181 00183 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) 00184 { 00185 ISceneNode::deserializeAttributes(in, options); 00186 if (!in) 00187 return; 00188 00189 if ( in->findAttribute("IsOrthogonal") ) 00190 IsOrthogonal = in->getAttributeAsBool("IsOrthogonal"); 00191 } 00192 00193 protected: 00194 00195 void cloneMembers(ICameraSceneNode* toCopyFrom) 00196 { 00197 IsOrthogonal = toCopyFrom->IsOrthogonal; 00198 } 00199 00200 bool IsOrthogonal; 00201 }; 00202 00203 } // end namespace scene 00204 } // end namespace irr 00205 00206 #endif 00207