Prefab

Engine/source/T3D/prefab.h

More...

Classes:

class

Structure to keep track of child object initial transform and scale.

Callbacks

DECLARE_CALLBACK(void , onLoad , (SimGroup *children) )

Private Types

enum
MaskBits {
  TransformMask = Parent::NextFreeMask << 0
  FileMask = Parent::NextFreeMask << 1
  NextFreeMask = Parent::NextFreeMask << 2
}
Parent 

Protected Types

ChildToMatMap 
ChildToPrefabMap 

Protected Attributes

Group which holds all children objects.

Lookup from a child object's id to its transform in this Prefab's object space.

Prefab file which defines our children objects.

Protected Static Attributes

Lookup from a SimObject to its parent Prefab if it has one.

Public Functions

bool

Builds a list of polygons which intersect a bounding volume for exporting.

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

Builds a list of polygons which intersect a bounding volume.

Removes all children from this Prefab and puts them into a SimGroup which is added to the Scene and returned to the caller.

Called after any property of the object is changed in the world editor.

bool

Called when the object is added to the sim.

Called when the editor is deactivated.

Called when the editor is activated.

Called when the object is removed from the sim.

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

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

Sets the scale for the object.

Sets the Object -> World transform.

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

Public Static Functions

If the passed object is a child of any Prefab return that Prefab.

bool
isValidChild(SimObject * child, bool logWarnings)

Returns false if the passed object is of a type that is not allowed as a child within a Prefab.

Protected Functions

Protected Static Functions

bool
protectedSetFile(void * object, const char * index, const char * data)

Detailed Description

Callbacks

DECLARE_CALLBACK(void , onLoad , (SimGroup *children) )

Private Types

MaskBits

Enumerator

TransformMask = Parent::NextFreeMask << 0
FileMask = Parent::NextFreeMask << 1
NextFreeMask = Parent::NextFreeMask << 2
typedef SceneObject Parent 

Protected Types

typedef Map< SimObjectId, Transform > ChildToMatMap 
typedef Map< SimObjectId, SimObjectId > ChildToPrefabMap 

Protected Attributes

SimObjectPtr< SimGroup > mChildGroup 

Group which holds all children objects.

ChildToMatMap mChildMap 

Lookup from a child object's id to its transform in this Prefab's object space.

String mFilename 

Prefab file which defines our children objects.

Protected Static Attributes

ChildToPrefabMap smChildToPrefabMap 

Lookup from a SimObject to its parent Prefab if it has one.

Public Functions

Prefab()

~Prefab()

buildExportPolyList(ColladaUtils::ExportData * exportData, const Box3F & box, const SphereF & sphere)

Reimplemented from: SceneObject

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

Reimplemented from: SceneObject

DECLARE_CONOBJECT(Prefab )

explode()

Removes all children from this Prefab and puts them into a SimGroup which is added to the Scene and returned to the caller.

getUtilizedAssets(Vector< StringTableEntry > * usedAssetsList)

Reimplemented from: SceneObject

inspectPostApply()

Reimplemented from: SceneObject

onAdd()

Reimplemented from: SceneObject

onEditorDisable()

Reimplemented from: SimObject

onEditorEnable()

Reimplemented from: SimObject

onRemove()

Reimplemented from: SceneObject

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

Reimplemented from: SceneObject

render(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)

setFile(String file)

setScale(const VectorF & scale)

Reimplemented from: SceneObject

setTransform(const MatrixF & mat)

Reimplemented from: SceneObject

unpackUpdate(NetConnection * conn, BitStream * stream)

Reimplemented from: SceneObject

Public Static Functions

getPrefabByChild(SimObject * child)

If the passed object is a child of any Prefab return that Prefab.

Note that this call is only valid if the editor is open and when passed server-side objects.

initPersistFields()

isValidChild(SimObject * child, bool logWarnings)

Returns false if the passed object is of a type that is not allowed as a child within a Prefab.

Protected Functions

_closeFile(bool removeFileNotify)

_loadFile(bool addFileNotify)

_onFileChanged(const Torque::Path & path)

_updateChildren()

_updateChildTransform(SceneObject * child)

Protected Static Functions

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