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

#include <TPCamera.h>

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

Public Member Functions

 TPCamera (SceneManager *pSnMan, float distance, float theta, float phi, const math::Vector &target, const math::Vector &up)
 Constructor.
 TPCamera (SceneManager *pSnMan, const math::Vector &position, const math::Vector &target, const math::Vector &up)
 Constructor.
void PreRender (float elapsedTime=0.0f)
 The jobs before rendering like culling and calculate position.
void Render ()
 Render the objects.
void PostRender ()
 The jobs after rendering.
void Draw (bool WithMaterial, bool WithTransform, bool bPosition, bool bNormalTexcoord, bool bTangentBinormal)
void Fallow (const sn::SceneNode *node)
void SetPosition (const math::Vector &position)
 Camera's position.
void SetUpDir (const math::Vector &up)
 World's up.
void SetTarget (const math::Vector &target)
 Sphere's center.
void SetDistance (float distance)
 Sphere's radius.
void SetTheta (float theta)
 Polar angle in radians.
void SetThetaD (float theta)
 Polar angle in degrees.
void SetPhi (float phi)
 Azimuth angle in radians.
void SetPhiD (float phi)
 Azimuth angle in degrees.
void SetFov (float fov)
 Field of view in radians.
void SetFovD (float fov)
 Field of view in degrees.
void SetNearValue (float nearZ)
 Z-value of the near view-plane.
void SetFarValue (float farZ)
 Z-value of the far view-plane.
void SetProjectionMatrix (const math::Matrix &projection)
void SetDelay (float delay)
void OnResize ()
void RotateVer (float angle)
void RotateVerD (float angle)
void RotateHor (float angle)
void RotateHorD (float angle)
void Zoom (float scale)
void Shake (float magnitude, float duration)
const math::MatrixGetViewMatrix () const
 Returns the view matrix.
const math::MatrixGetProjectionMatrix () const
 Returns the projection matrix.
float GetFov () const
float GetFovD () const
float GetNearValue () const
float GetFarValue () const
const math::VectorGetPosition () const
 Returns the node position.
const math::VectorGetUpDir () const
const math::VectorGetTarget () const
math::Vector GetRightDir () const
math::Vector GetDirection () const
float GetDistance () const
float GetTheta () const
float GetThetaD () const
float GetPhi () const
float GetPhiD () const
float GetDelay () const
bool IsChanged () const
const math::FrustumGetFrustum () const
 Returns the view frustum.
int GetViewportWidth () const
int GetViewportHeight () const
NodeType GetType () const
 Returns the node type.
- Public Member Functions inherited from kge::sn::SceneNode
 SceneNode ()
 Constructor.
virtual ~SceneNode ()
 Destructor.
virtual void AddChild (SceneNode *child)
 Adds a node as child.
virtual bool AddEffect (efx::EffectType p, efx::Effect **ppOut)
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.

Private Member Functions

 TPCamera (const TPCamera &other)
 Copy constructor.
TPCameraoperator= (const TPCamera &other)
 Assignment operator.
void ComputeProjectionMatrix ()
void ComputeViewMatrix ()

Private Attributes

math::Vector m_center
float m_radius
float m_inclination
float m_azimuth
const float m_minTheta
const float m_maxTheta
math::Vector m_position
math::Vector m_up
math::Matrix m_view
math::Matrix m_projection
float m_fov
float m_nearZ
float m_farZ
math::Frustum m_frustum
int m_vpWidth
int m_vpHeight
bool m_update
bool m_lerp
bool m_projChanged
bool m_viewChanged
math::Vector m_target0
math::Vector m_target1
float m_delay
float m_elapsed
const sn::SceneNodem_fallowing
float m_shakeMagnitude
float m_shakeDuration
float m_shakeTime
float m_shaking
math::Vector m_tempEye
math::Vector m_tempTarget

Additional Inherited Members

- Protected Member Functions inherited from kge::sn::SceneNode
virtual bool HasThisEffect (efx::EffectType p)
- 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

Detailed Description

Definition at line 22 of file TPCamera.h.

Constructor & Destructor Documentation

kge::sn::TPCamera::TPCamera ( const TPCamera other)
private

Copy constructor.

kge::sn::TPCamera::TPCamera ( SceneManager pSnMan,
float  distance,
float  theta,
float  phi,
const math::Vector target,
const math::Vector up 
)

Constructor.

kge::sn::TPCamera::TPCamera ( SceneManager pSnMan,
const math::Vector position,
const math::Vector target,
const math::Vector up 
)

Constructor.

Member Function Documentation

void kge::sn::TPCamera::ComputeProjectionMatrix ( )
private
void kge::sn::TPCamera::ComputeViewMatrix ( )
private
void kge::sn::TPCamera::Draw ( bool  WithMaterial,
bool  WithTransform,
bool  bPosition,
bool  bNormalTexcoord,
bool  bTangentBinormal 
)
virtual

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.

void kge::sn::TPCamera::Fallow ( const sn::SceneNode node)
inline

Definition at line 50 of file TPCamera.h.

float kge::sn::TPCamera::GetDelay ( ) const
inline

Definition at line 170 of file TPCamera.h.

math::Vector kge::sn::TPCamera::GetDirection ( ) const
float kge::sn::TPCamera::GetDistance ( ) const
inline

Definition at line 155 of file TPCamera.h.

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

Definition at line 137 of file TPCamera.h.

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

Definition at line 128 of file TPCamera.h.

float kge::sn::TPCamera::GetFovD ( ) const
const math::Frustum* kge::sn::TPCamera::GetFrustum ( ) const
inline

Returns the view frustum.

Definition at line 176 of file TPCamera.h.

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

Definition at line 134 of file TPCamera.h.

float kge::sn::TPCamera::GetPhi ( ) const
inline

Definition at line 164 of file TPCamera.h.

References kge::math::PiOver2.

float kge::sn::TPCamera::GetPhiD ( ) const
const math::Vector& kge::sn::TPCamera::GetPosition ( ) const
inlinevirtual

Returns the node position.

Reimplemented from kge::sn::SceneNode.

Definition at line 140 of file TPCamera.h.

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

Returns the projection matrix.

Definition at line 125 of file TPCamera.h.

math::Vector kge::sn::TPCamera::GetRightDir ( ) const
const math::Vector& kge::sn::TPCamera::GetTarget ( ) const
inline

Definition at line 146 of file TPCamera.h.

float kge::sn::TPCamera::GetTheta ( ) const
inline

Definition at line 158 of file TPCamera.h.

float kge::sn::TPCamera::GetThetaD ( ) const
NodeType kge::sn::TPCamera::GetType ( ) const
inlinevirtual

Returns the node type.

Reimplemented from kge::sn::SceneNode.

Definition at line 185 of file TPCamera.h.

References kge::sn::ENT_Camera.

const math::Vector& kge::sn::TPCamera::GetUpDir ( ) const
inline

Definition at line 143 of file TPCamera.h.

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

Returns the view matrix.

Definition at line 122 of file TPCamera.h.

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

Definition at line 182 of file TPCamera.h.

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

Definition at line 179 of file TPCamera.h.

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

Definition at line 173 of file TPCamera.h.

void kge::sn::TPCamera::OnResize ( )
TPCamera& kge::sn::TPCamera::operator= ( const TPCamera other)
private

Assignment operator.

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

The jobs after rendering.

Implements kge::sn::SceneNode.

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

The jobs before rendering like culling and calculate position.

Implements kge::sn::SceneNode.

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

Render the objects.

Implements kge::sn::SceneNode.

void kge::sn::TPCamera::RotateHor ( float  angle)
void kge::sn::TPCamera::RotateHorD ( float  angle)
void kge::sn::TPCamera::RotateVer ( float  angle)
void kge::sn::TPCamera::RotateVerD ( float  angle)
void kge::sn::TPCamera::SetDelay ( float  delay)
inline

Definition at line 92 of file TPCamera.h.

void kge::sn::TPCamera::SetDistance ( float  distance)

Sphere's radius.

void kge::sn::TPCamera::SetFarValue ( float  farZ)

Z-value of the far view-plane.

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

Field of view in radians.

void kge::sn::TPCamera::SetFovD ( float  fov)

Field of view in degrees.

void kge::sn::TPCamera::SetNearValue ( float  nearZ)

Z-value of the near view-plane.

void kge::sn::TPCamera::SetPhi ( float  phi)

Azimuth angle in radians.

void kge::sn::TPCamera::SetPhiD ( float  phi)

Azimuth angle in degrees.

void kge::sn::TPCamera::SetPosition ( const math::Vector position)
virtual

Camera's position.

Reimplemented from kge::sn::SceneNode.

void kge::sn::TPCamera::SetProjectionMatrix ( const math::Matrix projection)
inline

Definition at line 89 of file TPCamera.h.

void kge::sn::TPCamera::SetTarget ( const math::Vector target)

Sphere's center.

void kge::sn::TPCamera::SetTheta ( float  theta)

Polar angle in radians.

void kge::sn::TPCamera::SetThetaD ( float  theta)

Polar angle in degrees.

void kge::sn::TPCamera::SetUpDir ( const math::Vector up)

World's up.

void kge::sn::TPCamera::Shake ( float  magnitude,
float  duration 
)
void kge::sn::TPCamera::Zoom ( float  scale)

Member Data Documentation

float kge::sn::TPCamera::m_azimuth
private

Definition at line 199 of file TPCamera.h.

math::Vector kge::sn::TPCamera::m_center
private

Definition at line 196 of file TPCamera.h.

float kge::sn::TPCamera::m_delay
private

Definition at line 223 of file TPCamera.h.

float kge::sn::TPCamera::m_elapsed
private

Definition at line 224 of file TPCamera.h.

const sn::SceneNode* kge::sn::TPCamera::m_fallowing
private

Definition at line 225 of file TPCamera.h.

float kge::sn::TPCamera::m_farZ
private

Definition at line 211 of file TPCamera.h.

float kge::sn::TPCamera::m_fov
private

Definition at line 209 of file TPCamera.h.

math::Frustum kge::sn::TPCamera::m_frustum
private

Definition at line 212 of file TPCamera.h.

float kge::sn::TPCamera::m_inclination
private

Definition at line 198 of file TPCamera.h.

bool kge::sn::TPCamera::m_lerp
private

Definition at line 218 of file TPCamera.h.

const float kge::sn::TPCamera::m_maxTheta
private

Definition at line 201 of file TPCamera.h.

const float kge::sn::TPCamera::m_minTheta
private

Definition at line 200 of file TPCamera.h.

float kge::sn::TPCamera::m_nearZ
private

Definition at line 210 of file TPCamera.h.

math::Vector kge::sn::TPCamera::m_position
private

Definition at line 205 of file TPCamera.h.

bool kge::sn::TPCamera::m_projChanged
private

Definition at line 219 of file TPCamera.h.

math::Matrix kge::sn::TPCamera::m_projection
private

Definition at line 208 of file TPCamera.h.

float kge::sn::TPCamera::m_radius
private

Definition at line 197 of file TPCamera.h.

float kge::sn::TPCamera::m_shakeDuration
private

Definition at line 229 of file TPCamera.h.

float kge::sn::TPCamera::m_shakeMagnitude
private

Definition at line 228 of file TPCamera.h.

float kge::sn::TPCamera::m_shakeTime
private

Definition at line 230 of file TPCamera.h.

float kge::sn::TPCamera::m_shaking
private

Definition at line 231 of file TPCamera.h.

math::Vector kge::sn::TPCamera::m_target0
private

Definition at line 221 of file TPCamera.h.

math::Vector kge::sn::TPCamera::m_target1
private

Definition at line 222 of file TPCamera.h.

math::Vector kge::sn::TPCamera::m_tempEye
private

Definition at line 232 of file TPCamera.h.

math::Vector kge::sn::TPCamera::m_tempTarget
private

Definition at line 233 of file TPCamera.h.

math::Vector kge::sn::TPCamera::m_up
private

Definition at line 206 of file TPCamera.h.

bool kge::sn::TPCamera::m_update
private

Definition at line 217 of file TPCamera.h.

math::Matrix kge::sn::TPCamera::m_view
private

Definition at line 207 of file TPCamera.h.

bool kge::sn::TPCamera::m_viewChanged
private

Definition at line 220 of file TPCamera.h.

int kge::sn::TPCamera::m_vpHeight
private

Definition at line 214 of file TPCamera.h.

int kge::sn::TPCamera::m_vpWidth
private

Definition at line 213 of file TPCamera.h.


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