GameObject Class Referenceabstract

Description

Type of object that can be referenced by a GameObject handle.

Each object has an unique ID and is registered with the GameObjectManager.

Inherits IReflectable.

Inherited by Component, and SceneObject.

Methods

UINT64 getInstanceId () const
 Returns the unique instance ID of the GameObject. More...
 
UINT32 getLinkId () const
 Returns an ID that identifies a link between this object and its equivalent in the linked prefab. More...
 
const StringgetName () const
 Gets the name of the object. More...
 
void setName (const String &name)
 Sets the name of the object. More...
 
virtual RTTITypeBasegetRTTI () const override
 Returns an interface you can use to access class' Run Time Type Information. More...
 
Internal
void _setIsDestroyed ()
 Marks the object as destroyed. More...
 
bool _getIsDestroyed () const
 Checks if the object has been destroyed. More...
 
void _setLinkId (UINT32 id)
 Changes the prefab link ID for this object. More...
 
virtual void _setInstanceData (GameObjectInstanceDataPtr &other)
 Replaces the instance data with another objects instance data. More...
 
virtual GameObjectInstanceDataPtr _getInstanceData () const
 Returns instance data that identifies this GameObject and is used for referencing by game object handles. More...
 
- Methods inherited from IReflectable
bool isDerivedFrom (RTTITypeBase *base)
 Returns true if current RTTI class is derived from base (Or if it is the same type as base). More...
 
UINT32 getTypeId () const
 Returns an unique type identifier of the class. More...
 
const StringgetTypeName () const
 Returns the type name of the class. More...
 

Static methods

static RTTITypeBasegetRTTIStatic ()
 
- Static methods inherited from IReflectable
static Vector< RTTITypeBase * > & getDerivedClasses ()
 Returns all classes deriving directly from IReflectable. More...
 
static SPtr< IReflectablecreateInstanceFromTypeId (UINT32 rttiTypeId)
 Creates an empty instance of a class from a type identifier. More...
 
static void _registerDerivedClass (RTTITypeBase *derivedClass)
 Called by each type deriving from IReflectable, on program load. More...
 
static RTTITypeBase_getRTTIfromTypeId (UINT32 rttiTypeId)
 Returns class' RTTI type from type id. More...
 
static bool _isTypeIdDuplicate (UINT32 typeId)
 Checks if the provided type id is unique. More...
 
static void _checkForCircularReferences ()
 Iterates over all RTTI types and reports any circular references (for example one type having a field referencing another type, and that type having a field referencing the first type). More...
 
static RTTITypeBasegetRTTIStatic ()
 Returns an interface you can use to access class' Run Time Type Information. More...
 

Method documentation

virtual GameObjectInstanceDataPtr _getInstanceData ( ) const
virtual

Returns instance data that identifies this GameObject and is used for referencing by game object handles.

bool _getIsDestroyed ( ) const

Checks if the object has been destroyed.

virtual void _setInstanceData ( GameObjectInstanceDataPtr &  other)
virtual

Replaces the instance data with another objects instance data.

This object will basically become the original owner of the provided instance data as far as all game object handles referencing it are concerned.

Note
No alive objects should ever be sharing the same instance data. This can be used for restoring dead handles.

Reimplemented in SceneObject.

void _setIsDestroyed ( )

Marks the object as destroyed.

Generally this means the object has been queued for destruction but it hasn't occurred yet.

void _setLinkId ( UINT32  id)

Changes the prefab link ID for this object.

See getLinkId().

virtual void destroyInternal ( GameObjectHandleBase handle,
bool  immediate = false 
)
protectedpure virtual

Destroys this object.

Parameters
[in]handleGame object handle to this object.
[in]immediateIf true, the object will be deallocated and become unusable right away. Otherwise the deallocation will be delayed to the end of frame (preferred method).

Implemented in Component.

UINT64 getInstanceId ( ) const

Returns the unique instance ID of the GameObject.

UINT32 getLinkId ( ) const

Returns an ID that identifies a link between this object and its equivalent in the linked prefab.

This will be -1 if the object has no prefab link, or if the object is specific to the instance and has no prefab equivalent.

const String& getName ( void  ) const

Gets the name of the object.

virtual RTTITypeBase* getRTTI ( ) const
overridevirtual

Returns an interface you can use to access class' Run Time Type Information.

Note
You must derive your own version of RTTITypeBase, in which you may encapsulate all reflection specific operations.

Implements IReflectable.

Reimplemented in SceneObject, CRigidbody, CCamera, CAnimation, CCollider, Component, CAudioSource, ManagedComponent, CCharacterController, CJoint, CLight, CGUIWidget, CD6Joint, CReflectionProbe, CRenderable, CDistanceJoint, CAudioListener, CCapsuleCollider, CBone, CHingeJoint, CSkybox, CSliderJoint, CPlaneCollider, CBoxCollider, CSphereCollider, CSphericalJoint, CMeshCollider, WindowFrameWidget, CProfilerOverlay, and CFixedJoint.

void initialize ( const SPtr< GameObject > &  object,
UINT64  instanceId 
)
protected

Initializes the GameObject after construction.

void setName ( const String name)

Sets the name of the object.