Prefab
Classes:
Structure to keep track of child object initial transform and scale.
Callbacks
DECLARE_CALLBACK(void , onLoad , (SimGroup *children) )
Private Types
MaskBits { TransformMask = Parent::NextFreeMask << 0 FileMask = Parent::NextFreeMask << 1 NextFreeMask = Parent::NextFreeMask << 2 }
Parent
Protected Types
Map< SimObjectId, Transform >
ChildToMatMap
ChildToPrefabMap
Protected Attributes
Group which holds all children objects.
Protected Static Attributes
Public Functions
Prefab()
~Prefab()
bool
buildExportPolyList(ColladaUtils::ExportData * exportData, const Box3F & box, const SphereF & sphere)
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.
SimGroup *
getUtilizedAssets(Vector< StringTableEntry > * usedAssetsList)
Called after any property of the object is changed in the world editor.
bool
onAdd()
Called when the object is added to the sim.
Called when the editor is deactivated.
Called when the editor is activated.
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Instructs this object to pack its state for transfer over the network.
render(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
Public Static Functions
Prefab *
getPrefabByChild(SimObject * child)
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
_closeFile(bool removeFileNotify)
_onFileChanged(const Torque::Path & path)
_updateChildTransform(SceneObject * child)
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)