Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::sn::Camera Class Reference

#include <Camera.h>

Inheritance diagram for kge::sn::Camera:
kge::sn::SceneNode kge::KgeUnknown

Public Member Functions

 Camera (SceneManager *pSnMan, const math::Vector &Positon, const math::Vector &LookAt, const math::Vector &UpDir)
 Constructor.
virtual ~Camera ()
 Destructor.
virtual void PreRender (float elapsedTime=0.0f)
 Karhayee ke Ghabl az render bayad anjam shvad.
virtual void Render ()
 Render kardane Object.
virtual void PostRender ()
 Karhaee ke bad az render bayad anjam beshe.
virtual void MoveBF (float Speed)
 Harekate dorbin be jolo va aghab.
virtual void MoveRL (float Speed)
 Harekate dorbin be Rast va Chap.
virtual void Rotate (float Angle, const math::Vector &Axis=math::Vector(0.0f, 1.0f, 0.0f))
 Charkhesh dorbin dor yek bordar.
virtual void AutoRotateByMouse (bool Enable=true, float Speed=1)
 Be sorate Automatic dorbin tavasote mouse micharkhad.
virtual void RotateAroundPoint (float Angle, const math::Vector *Center=NULL, const math::Vector &Axis=math::Vector(0.0f, 1.0f, 0.0f))
 Charkhondan dorbin be dore yek noghte ke bishtar be darde bazi haye sevom shakhs mikhore.
virtual const math::VectorGetRightDir ()
 Returns camera right direction.
virtual const math::VectorGetUpDir ()
 Returns camera up direction.
virtual void SetUpDir (const math::Vector &v)
 Sets camera up direction.
virtual bool AddEffect (efx::EffectType p, efx::Effect **ppOut)
 Ezafe kardane effect be in dorbin ke felan hich meghdari ro ghabol nemikone.
virtual void Draw (bool WithMaterial, bool WithTransform, bool bPosition, bool bNormalTexcoord, bool bTangentBinormal)
virtual void SetPosition (const math::Vector &v)
 Set the camera position.
virtual const math::VectorGetPosition () const
 Returns the camera position.
virtual void SetTarget (const math::Vector &v)
 Sets the camera target point.
virtual const math::VectorGetTarget () const
 Returns the camera target.
virtual void SetProjectionMatrix (const math::Matrix *mat)
 Sets the Projection matrix.
const math::MatrixGetViewMatrix () const
 Returns the view matrix.
const math::MatrixGetProjectionMatrix () const
 Returns the projection matrix.
const math::FrustumGetFrustum () const
 Returns the view frustum.
int GetViewportWidth () const
int GetViewportHeight () const
NodeType GetType () const
 Returns the node type.
void SetFov (float fov)
 Sets field of view.
float GetFov () const
float GetFarValue () const
float GetNearValue () const
void SetFarValue (float f)
void SetNearValue (float f)
bool IsChanged () const
- Public Member Functions inherited from kge::sn::SceneNode
 SceneNode ()
 Constructor.
virtual ~SceneNode ()
 Destructor.
virtual void AddChild (SceneNode *child)
 Adds a node as child.
virtual void SetSceneManager (SceneManager *smgr)
 Sets the scene manager and renderer pointer.
virtual void SetRotation (const math::Vector &v)
 Set the rotation of the scenenode.
virtual void SetScale (const math::Vector &v)
 Set the scale of the scenenode.
virtual void SetAutomaticCulling (bool isTrue)
 Set Cutting Enable or Disable.
virtual void SetVisible (bool isVisible)
 Set Visible Enable or Disable.
virtual bool GetVisible ()
 Get Visible.
virtual bool IsVisibleInFrame ()
 Is it visible in this frame?
virtual const math::VectorGetRotation () const
 Returns the node rotation.
virtual const math::VectorGetScale () const
 Returns the node scale.
virtual math::MatrixGetAbsoluteMatrix () const
 Get the absolute matrix.
virtual math::MatrixGetFinalMatrix ()
 Get the final matrix.
virtual u32 GetMaterialCount ()
 Get the count of materials this node has.
virtual gfx::MaterialGetMaterial (u32 Index)
virtual math::SphereGetBoundingBox ()
 Returns the node bounding box.
virtual math::AABBGetAxisAlignedBoundingBox ()
 Returns the node Axis aligned bounding box.
virtual void RemoveChild (SceneNode *child)
virtual void RemoveChildren ()
 Removes all children of this node.
virtual const SceneNodeGetParent ()
 Returns the node parent.
virtual void SetParent (SceneNode *parent)
 Sets the node parent.
virtual void SetName (const char *name)
 Sets the node name.
virtual core::StringGetName ()
 Gets the node name.
virtual void SetID (int ID)
 Sets the node ID.
virtual int GetID ()
 Gets the node ID.
void EnableShadow (bool enable)
bool HasShadow () const
virtual void UpdateFinalMat ()
 Update final matrix.
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Protected Member Functions

virtual void CalcViewMatrix ()
virtual void RotViewByMouse ()
- Protected Member Functions inherited from kge::sn::SceneNode
virtual bool HasThisEffect (efx::EffectType p)
- Protected Member Functions inherited from kge::KgeUnknown
void SetDebugText (char *text)

Protected Attributes

math::Matrix m_mView
math::Matrix m_mProj
math::Vector m_vPos
math::Vector m_vLook
math::Vector m_vUp
math::Vector m_vRight
bool m_bChanged
bool m_bProjChanged
bool m_bARBM
int m_iMiddleX
int m_iMiddleY
float m_fCurRotX
float m_fLastRotX
float m_fSpeed
float m_fFov
float m_fNear
float m_fFar
math::Frustum m_frustum
int m_vpWidth
int m_vpHeight
- Protected Attributes inherited from kge::sn::SceneNode
core::String m_sName
int m_iID
SceneManagerm_pSnMan
gfx::Rendererm_pRenderer
bool m_bVis
bool m_bAutoCulling
bool m_bVisFrame
SceneNodem_pParent
std::vector< SceneNode * > m_vChilds
std::vector< int > m_vEffectType
std::vector< efx::Effect * > m_vEffect
math::Matrixm_pAbsMat
math::Matrixm_pFinalMat
math::Vector m_Position
math::Vector m_Rotation
math::Vector m_Scale
math::Spherem_pBB
math::AABBm_pAABB
NodeType m_eNodeType
bool m_hasShadow

Friends

class SceneManager

Detailed Description

Definition at line 23 of file Camera.h.

Constructor & Destructor Documentation

kge::sn::Camera::Camera ( SceneManager pSnMan,
const math::Vector Positon,
const math::Vector LookAt,
const math::Vector UpDir 
)

Constructor.

virtual kge::sn::Camera::~Camera ( )
virtual

Destructor.

Member Function Documentation

virtual bool kge::sn::Camera::AddEffect ( efx::EffectType  p,
efx::Effect **  ppOut 
)
inlinevirtual

Ezafe kardane effect be in dorbin ke felan hich meghdari ro ghabol nemikone.

Reimplemented from kge::sn::SceneNode.

Definition at line 87 of file Camera.h.

virtual void kge::sn::Camera::AutoRotateByMouse ( bool  Enable = true,
float  Speed = 1 
)
virtual

Be sorate Automatic dorbin tavasote mouse micharkhad.

virtual void kge::sn::Camera::CalcViewMatrix ( )
protectedvirtual
virtual void kge::sn::Camera::Draw ( bool  WithMaterial,
bool  WithTransform,
bool  bPosition,
bool  bNormalTexcoord,
bool  bTangentBinormal 
)
inlinevirtual

Draw the node with/without its Materials and Transforms.

Parameters
WithMaterialDraw it with its own materials or not?
WithMaterialDraw it with its own Transformations or not?

Implements kge::sn::SceneNode.

Definition at line 89 of file Camera.h.

float kge::sn::Camera::GetFarValue ( ) const
inline

Definition at line 134 of file Camera.h.

float kge::sn::Camera::GetFov ( ) const
inline

Definition at line 128 of file Camera.h.

const math::Frustum* kge::sn::Camera::GetFrustum ( ) const
inline

Returns the view frustum.

Definition at line 113 of file Camera.h.

float kge::sn::Camera::GetNearValue ( ) const
inline

Definition at line 140 of file Camera.h.

virtual const math::Vector& kge::sn::Camera::GetPosition ( ) const
virtual

Returns the camera position.

Reimplemented from kge::sn::SceneNode.

const math::Matrix& kge::sn::Camera::GetProjectionMatrix ( ) const
inline

Returns the projection matrix.

Definition at line 110 of file Camera.h.

Referenced by kge::math::Ray::CalcPickingRay().

virtual const math::Vector& kge::sn::Camera::GetRightDir ( )
inlinevirtual

Returns camera right direction.

Definition at line 75 of file Camera.h.

virtual const math::Vector& kge::sn::Camera::GetTarget ( ) const
virtual

Returns the camera target.

NodeType kge::sn::Camera::GetType ( ) const
inlinevirtual

Returns the node type.

Reimplemented from kge::sn::SceneNode.

Definition at line 122 of file Camera.h.

References kge::sn::ENT_Camera.

virtual const math::Vector& kge::sn::Camera::GetUpDir ( )
inlinevirtual

Returns camera up direction.

Definition at line 78 of file Camera.h.

const math::Matrix& kge::sn::Camera::GetViewMatrix ( ) const
inline

Returns the view matrix.

Definition at line 107 of file Camera.h.

int kge::sn::Camera::GetViewportHeight ( ) const
inline

Definition at line 119 of file Camera.h.

Referenced by kge::math::Ray::CalcPickingRay().

int kge::sn::Camera::GetViewportWidth ( ) const
inline

Definition at line 116 of file Camera.h.

Referenced by kge::math::Ray::CalcPickingRay().

bool kge::sn::Camera::IsChanged ( ) const
inline

Definition at line 157 of file Camera.h.

virtual void kge::sn::Camera::MoveBF ( float  Speed)
virtual

Harekate dorbin be jolo va aghab.

virtual void kge::sn::Camera::MoveRL ( float  Speed)
virtual

Harekate dorbin be Rast va Chap.

virtual void kge::sn::Camera::PostRender ( )
virtual

Karhaee ke bad az render bayad anjam beshe.

Implements kge::sn::SceneNode.

virtual void kge::sn::Camera::PreRender ( float  elapsedTime = 0.0f)
virtual

Karhayee ke Ghabl az render bayad anjam shvad.

Implements kge::sn::SceneNode.

virtual void kge::sn::Camera::Render ( )
virtual

Render kardane Object.

Implements kge::sn::SceneNode.

virtual void kge::sn::Camera::Rotate ( float  Angle,
const math::Vector Axis = math::Vector(0.0f, 1.0f, 0.0f) 
)
virtual

Charkhesh dorbin dor yek bordar.

virtual void kge::sn::Camera::RotateAroundPoint ( float  Angle,
const math::Vector Center = NULL,
const math::Vector Axis = math::Vector(0.0f, 1.0f, 0.0f) 
)
virtual

Charkhondan dorbin be dore yek noghte ke bishtar be darde bazi haye sevom shakhs mikhore.

virtual void kge::sn::Camera::RotViewByMouse ( )
protectedvirtual
void kge::sn::Camera::SetFarValue ( float  f)
inline

Definition at line 145 of file Camera.h.

void kge::sn::Camera::SetFov ( float  fov)

Sets field of view.

void kge::sn::Camera::SetNearValue ( float  f)
inline

Definition at line 151 of file Camera.h.

virtual void kge::sn::Camera::SetPosition ( const math::Vector v)
virtual

Set the camera position.

Reimplemented from kge::sn::SceneNode.

virtual void kge::sn::Camera::SetProjectionMatrix ( const math::Matrix mat)
inlinevirtual

Sets the Projection matrix.

Definition at line 104 of file Camera.h.

virtual void kge::sn::Camera::SetTarget ( const math::Vector v)
virtual

Sets the camera target point.

virtual void kge::sn::Camera::SetUpDir ( const math::Vector v)
virtual

Sets camera up direction.

Friends And Related Function Documentation

friend class SceneManager
friend

Definition at line 25 of file Camera.h.

Member Data Documentation

bool kge::sn::Camera::m_bARBM
protected

Definition at line 166 of file Camera.h.

bool kge::sn::Camera::m_bChanged
protected

Definition at line 166 of file Camera.h.

Referenced by kge::sn::SceneManager::SetActiveCamera().

bool kge::sn::Camera::m_bProjChanged
protected

Definition at line 166 of file Camera.h.

float kge::sn::Camera::m_fCurRotX
protected

Definition at line 171 of file Camera.h.

float kge::sn::Camera::m_fFar
protected

Definition at line 171 of file Camera.h.

float kge::sn::Camera::m_fFov
protected

Definition at line 171 of file Camera.h.

float kge::sn::Camera::m_fLastRotX
protected

Definition at line 171 of file Camera.h.

float kge::sn::Camera::m_fNear
protected

Definition at line 171 of file Camera.h.

math::Frustum kge::sn::Camera::m_frustum
protected

Definition at line 177 of file Camera.h.

float kge::sn::Camera::m_fSpeed
protected

Definition at line 171 of file Camera.h.

int kge::sn::Camera::m_iMiddleX
protected

Definition at line 169 of file Camera.h.

int kge::sn::Camera::m_iMiddleY
protected

Definition at line 169 of file Camera.h.

math::Matrix kge::sn::Camera::m_mProj
protected

Definition at line 161 of file Camera.h.

math::Matrix kge::sn::Camera::m_mView
protected

Definition at line 160 of file Camera.h.

math::Vector kge::sn::Camera::m_vLook
protected

Definition at line 162 of file Camera.h.

int kge::sn::Camera::m_vpHeight
protected

Definition at line 179 of file Camera.h.

math::Vector kge::sn::Camera::m_vPos
protected

Definition at line 162 of file Camera.h.

int kge::sn::Camera::m_vpWidth
protected

Definition at line 178 of file Camera.h.

math::Vector kge::sn::Camera::m_vRight
protected

Definition at line 162 of file Camera.h.

math::Vector kge::sn::Camera::m_vUp
protected

Definition at line 162 of file Camera.h.


The documentation for this class was generated from the following file: