Entity

Engine/source/T3D/entity.h

More...

Classes:

Public Types

enum
MaskBits {
  TransformMask = Parent::NextFreeMask << 0
  BoundsMask = Parent::NextFreeMask << 1
  ComponentsMask = Parent::NextFreeMask << 2
  NoWarpMask = Parent::NextFreeMask << 3
  NextFreeMask = Parent::NextFreeMask << 4
}

Private Types

Parent 

Public Friends

class

Public Attributes

Protected Functions

Advances simulation time for animations.

Interpolates between tick events.

bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

Called when the SceneManager is ready for the registration of render instances.

Processes a move event and updates object state once every 32 milliseconds.

Public Functions

bool
addObject(SimObject * object)

Add the given object to the set.

addTamlChild(SimObject * pSimObject)

Called when Taml attempts to populate an objects children during a read.

buildConvex(const Box3F & box, Convex * convex)

Builds a convex hull for this object.

bool
buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)

Builds a list of polygons which intersect a bounding volume.

bool
castRay(const Point3F & start, const Point3F & end, RayInfo * info)

Casts a ray and obtain collision information, returns true if RayInfo is modified.

bool

Casts a ray against rendered geometry, returns true if RayInfo is modified.

clearComponents(bool deleteComponents)
findObjectByInternalName(StringTableEntry internalName, bool searchChildren)
getComponent(String componentType)
getMountTransform(S32 index, const MatrixF & xfm, MatrixF * outMat)

Returns the position of the object.

getRenderMountTransform(F32 delta, S32 index, const MatrixF & xfm, MatrixF * outMat)
getTamlChild(const U32 childIndex)

Called when Taml attempts to compile a list of children.

Called when Taml attempts to compile a list of children.

mountObject(SceneObject * obj, S32 node, const MatrixF & xfm)

ex: Mount B to A at A's node N A.mountObject( B, N )

Queries the object about information used to determine scope.

onMount(SceneObject * obj, S32 node)

Callback when this object is mounted.

Called when the adding of the object to the sim is complete, all sub-objects have been processed as well.

onStaticModified(const char * slotName, const char * newValue)

Specifically, these are called by setDataField when a static or dynamic field is modified, see the console details.

onUnmount(SceneObject * obj, S32 node)

Callback when this object is unmounted.

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Instructs this object to pack its state for transfer over the network.

bool
removeComponent(Component * comp, bool deleteComponent)

Remove the given object from the set.

setComponentDirty(Component * comp, bool forceUpdate)
setDataField(StringTableEntry slotName, const char * array, const char * value)
setForwardVector(VectorF newForward, VectorF upVector)

This sets the render transform for this object.

Sets the Object -> World transform.

setTransform(Point3F position, RotationF rotation)

Instructs this object to read state data previously packed with packUpdate.

write(Stream & stream, U32 tabStop, U32 flags)

Output the TorqueScript to recreate this object.

Public Static Functions

const char *
_getPosition(void * obj, const char * data)
const char *
_getRotation(void * obj, const char * data)
bool
_setPosition(void * object, const char * index, const char * data)
bool
_setRotation(void * object, const char * index, const char * data)

Detailed Description

Public Types

MaskBits

Enumerator

TransformMask = Parent::NextFreeMask << 0
BoundsMask = Parent::NextFreeMask << 1
ComponentsMask = Parent::NextFreeMask << 2
NoWarpMask = Parent::NextFreeMask << 3
NextFreeMask = Parent::NextFreeMask << 4

Private Types

typedef GameBase Parent 

Public Friends

Private Attributes

ContainerQueryInfo containerInfo 
Vector< Component * > mComponents 
bool mInitialized 
Point3F mPos 
RotationF mRot 
bool mStartComponentUpdate 
Vector< Component * > mToLoadComponents 
Signal< void(Component *) > onComponentAdded 
Signal< void(Component *) > onComponentRemoved 
Signal< void(MatrixF *) > onTransformSet 

Public Attributes

Move lastMove 
StateDelta mDelta 
S32 mPredictionCount 

Number of ticks to predict.

Signal< void(SimObject *, String, String) > onDataSet 

Protected Functions

advanceTime(F32 dt)

Reimplemented from: ProcessObject

interpolateTick(F32 delta)

Reimplemented from: ProcessObject

onAdd()

Reimplemented from: SceneObject

onRemove()

Reimplemented from: SceneObject

prepRenderImage(SceneRenderState * state)

Reimplemented from: SceneObject

processTick(const Move * move)

Reimplemented from: ProcessObject

Public Functions

Entity()

~Entity()

addComponent(Component * comp)

addObject(SimObject * object)

Reimplemented from: SimGroup

addTamlChild(SimObject * pSimObject)

Reimplemented from: SimSet

buildConvex(const Box3F & box, Convex * convex)

Reimplemented from: SceneObject

buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)

Reimplemented from: SceneObject

castRay(const Point3F & start, const Point3F & end, RayInfo * info)

Reimplemented from: SceneObject

castRayRendered(const Point3F & start, const Point3F & end, RayInfo * info)

Reimplemented from: SceneObject

clearComponents(bool deleteComponents)

DECLARE_CONOBJECT(Entity )

deferAddingComponents()

findObjectByInternalName(StringTableEntry internalName, bool searchChildren)

Reimplemented from: SimSet

getCameraTransform(F32 * pos, MatrixF * mat)

Reimplemented from: GameBase

getComponent()

getComponent(const U32 index)

getComponent(String componentType)

getComponentCount()

getComponents()

getContainerInfo()

getMountTransform(S32 index, const MatrixF & xfm, MatrixF * outMat)

Reimplemented from: SceneObject

getObjectBox()

getObjToWorld()

getPosition()

Reimplemented from: SceneObject

getRenderMountTransform(F32 delta, S32 index, const MatrixF & xfm, MatrixF * outMat)

Reimplemented from: SceneObject

getRotation()

getTamlChild(const U32 childIndex)

Reimplemented from: SimSet

getTamlChildCount(void )

Reimplemented from: SimSet

getTransform()

getWorldToObj()

mountObject(SceneObject * obj, S32 node, const MatrixF & xfm)

Reimplemented from: SceneObject

mountObject(SceneObject * objB, MatrixF txfm)

onCameraScopeQuery(NetConnection * cr, CameraScopeQuery * camInfo)

Reimplemented from: SceneObject

onEndInspect()

onInspect()

onMount(SceneObject * obj, S32 node)

Reimplemented from: GameBase

onPostAdd()

Reimplemented from: SimObject

onStaticModified(const char * slotName, const char * newValue)

Reimplemented from: SimObject

onUnmount(SceneObject * obj, S32 node)

Reimplemented from: GameBase

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Reimplemented from: SceneObject

removeComponent(Component * comp, bool deleteComponent)

removeObject(SimObject * object)

Reimplemented from: SimGroup

resetObjectBox()

resetRenderWorldBox()

resetWorldBox()

setComponentDirty(Component * comp, bool forceUpdate)

setComponentsDirty()

setDataField(StringTableEntry slotName, const char * array, const char * value)

setForwardVector(VectorF newForward, VectorF upVector)

setMountOffset(Point3F posOffset)

setMountRotation(EulerF rotOffset)

setObjectBox(Box3F objBox)

setRenderTransform(const MatrixF & mat)

Reimplemented from: SceneObject

setRenderTransform(Point3F position, RotationF rotation)

setRotation(RotationF rotation)

setTransform(const MatrixF & mat)

Reimplemented from: SceneObject

setTransform(Point3F position, RotationF rotation)

unpackUpdate(NetConnection * conn, BitStream * stream)

Reimplemented from: SceneObject

updateContainer()

write(Stream & stream, U32 tabStop, U32 flags)

Reimplemented from: SimSet

Public Static Functions

_getPosition(void * obj, const char * data)

_getRotation(void * obj, const char * data)

_setPosition(void * object, const char * index, const char * data)

_setRotation(void * object, const char * index, const char * data)

initPersistFields()