The Nebula Device 3: Graphics::CameraEntity Class Reference

The Nebula Device 3

Graphics::CameraEntity Class Reference

#include <cameraentity.h>

Inheritance diagram for Graphics::CameraEntity:

Graphics::GraphicsEntity Core::RefCounted

Detailed Description

Client-side proxy of a InternalGraphics::InternalCameraEntity. NOTE: all getter-methods of this class return client-side cached values, not the actual server-side values. Thus they may be off by some amount, since the render thread may run at a different frame rate then the client thread!

(C) 2007 Radon Labs GmbH

Public Member Functions

 CameraEntity ()
 constructor
virtual ~CameraEntity ()
 destructor
bool IsAttachedToView () const
 return true if this camera is currently attached to a view
const Ptr< View > & GetView () const
 get the view this camera is currently attached to
void SetCameraSettings (const Shared::CameraSettings &camSettings)
 set new camera settings
const Shared::CameraSettingsGetCameraSettings () const
 get camera settings
const Math::matrix44GetProjTransform () const
 get projection matrix
const Math::matrix44GetViewTransform () const
 get view transform (inverse transform)
const Math::matrix44GetViewProjTransform () const
 get view projection matrix
const Math::frustumGetViewFrustum () const
 get view frustum
bool IsValid () const
 return true if entity is valid (is attached to a stage)
GraphicsEntityType::Code GetType () const
 get the entity type
void SetTransform (const Math::matrix44 &m)
 set the entity's world space transform
const Math::matrix44GetTransform () const
 get the entity's world space transform
void SetVisible (bool b)
 set the entity's visibility
bool IsVisible () const
 return true if entity is set to visible
const Ptr< Stage > & GetStage () const
 get the stage proxy this entity is attached to
Math::ClipStatus::Type GetClipStatus () const
 get current clip status
const Math::bboxGetLocalBoundingBox () const
 get the local bounding box
const Math::bboxGetGlobalBoundingBox () const
 get the global bounding box
Timing::Time GetEntityTime () const
 get current entity time
void SendMsg (const Ptr< GraphicsEntityMessage > &msg)
 send a message to the server-side graphics entity
bool IsObjectRefValid () const
 test if the entity's object ref is valid
const Ptr< Threading::ObjectRef > & GetObjectRef () const
 get the entity handle
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Protected Member Functions

virtual void Setup (const Ptr< Stage > &stage)
 called by stage when entity should setup itself
virtual void Discard ()
 called by stage when entity should discard itself
virtual void OnTransformChanged ()
 called when transform matrix changed
void OnAttachToView (const Ptr< View > &view)
 called by view when this camera entity should become the view's camera
void OnRemoveFromView (const Ptr< View > &view)
 called by view when this camera is no longer the view's camera
void SetType (GraphicsEntityType::Code t)
 set graphics entity type, called from constructor of subclass
virtual void OnSetupSharedData ()
 called to setup the FrameSyncSharedData object of the entity
virtual void OnDiscardSharedData ()
 called to discard the FrameSyncSharedData object of the entity
void SendCreateMsg (const Ptr< CreateGraphicsEntity > &msg)
 send off a specific create message from the subclass

Member Function Documentation

void Graphics::CameraEntity::SetCameraSettings ( const Shared::CameraSettings camSettings  ) 

set new camera settings

Set new the camera settings. This updates the internal matrices.

void Graphics::CameraEntity::Setup ( const Ptr< Stage > &  stage_  )  [protected, virtual]

called by stage when entity should setup itself

Setup the server-side camera entity.

Reimplemented from Graphics::GraphicsEntity.

void Graphics::CameraEntity::Discard (  )  [protected, virtual]

called by stage when entity should discard itself

Property remove from view if we are attached to a view.

Reimplemented from Graphics::GraphicsEntity.

void Graphics::CameraEntity::OnTransformChanged (  )  [protected, virtual]

called when transform matrix changed

We need to keep track of modifications of the transformation matrix.

Reimplemented from Graphics::GraphicsEntity.

void Graphics::GraphicsEntity::SendMsg ( const Ptr< GraphicsEntityMessage > &  msg  )  [inherited]

send a message to the server-side graphics entity

Send a generic GraphicsEntityMessage to the server-side entity.

void Graphics::GraphicsEntity::OnSetupSharedData (  )  [protected, virtual, inherited]

called to setup the FrameSyncSharedData object of the entity

Setup the shared data object. If subclasses wish to add more members to the shared data object, they must subclass from InternalGraphics::InternalGraphicsEntitySharedData, setup a FrameSyncSharedData object with this data type, and NOT CALL the parent class method! So the lowest subclass defines the type of the shared data!

void Graphics::GraphicsEntity::OnDiscardSharedData (  )  [protected, virtual, inherited]

called to discard the FrameSyncSharedData object of the entity

Discard the shared data object. See OnSetupSharedData() for details!

void Graphics::GraphicsEntity::SendCreateMsg ( const Ptr< CreateGraphicsEntity > &  msg  )  [protected, inherited]

send off a specific create message from the subclass

This method must be called from the Setup() method of a subclass to send off a specific creation message. The message will be stored in the proxy to get the entity handle back later when the server-side graphics entity has been created.

int Core::RefCounted::GetRefCount (  )  const [inline, inherited]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline, inherited]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline, inherited]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline, inherited]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline, inherited]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static, inherited]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.