Drag[en]gine Game Engine
1.21
|
Rig file resource. More...
#include <deRig.h>
Public Types | |
typedef deTObjectReference< deRig > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deResource | |
typedef deTObjectReference< deResource > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deObject | |
typedef deTObjectReference< deObject > | Ref |
Type holding strong reference. More... | |
Public Member Functions | |
Management | |
const decVector & | GetCentralMassPoint () const |
Central mass point position. More... | |
void | SetCentralMassPoint (const decVector &cmp) |
Set central mass point position. More... | |
bool | GetModelCollision () const |
Use component model for collision instead of shapes if present. More... | |
void | SetModelCollision (bool modelCollision) |
Set if component model is used for collision instead of shapes if present. More... | |
bool | Verify () const |
Verify rig is valid. More... | |
void | Prepare () |
Prepare rig after loading. More... | |
Bones | |
int | GetBoneCount () const |
Number of bones. More... | |
deRigBone & | GetBoneAt (int index) const |
Bone at index. More... | |
int | IndexOfBoneNamed (const char *name) const |
Index of named bone or -1 if absent. More... | |
bool | HasBoneNamed (const char *name) const |
Named bone is present. More... | |
void | AddBone (deRigBone *bone) |
Add bone. More... | |
void | RemoveAllBones () |
Remove all bones. More... | |
int | GetRootBone () const |
Index of physics root bone or -1 if not set. More... | |
void | SetRootBone (int rootBone) |
Set physics root bone or -1 if not set. More... | |
Shapes | |
const decShapeList & | GetShapes () const |
Shapes. More... | |
void | SetShapes (const decShapeList &shapes) |
Set shapes. More... | |
const decStringList & | GetShapeProperties () const |
Shape properties. More... | |
void | SetShapeProperties (const decStringList &properties) |
Set shape properties. More... | |
System Peers | |
deBasePhysicsRig * | GetPeerPhysics () const |
Physics system peer or NULL if not set. More... | |
void | SetPeerPhysics (deBasePhysicsRig *peer) |
Set physics system peer or NULL if not set. More... | |
Public Member Functions inherited from deFileResource | |
deVirtualFileSystem * | GetVirtualFileSystem () const |
Virtual file system or NULL if build from memory. More... | |
const decString & | GetFilename () const |
Filename or empty string if build from memory. More... | |
TIME_SYSTEM | GetModificationTime () const |
Modification time used to detect resources changing on disk while loaded. More... | |
void | SetModificationTime (TIME_SYSTEM modificationTime) |
Set modification time used to detect resources changing on disk while loaded. More... | |
bool | GetAsynchron () const |
Resource is asynchron. More... | |
void | SetAsynchron (bool asynchron) |
Set if resource is asynchron. More... | |
bool | GetOutdated () const |
void | MarkOutdated () |
deFileResource (deFileResourceManager *resourceManager, deVirtualFileSystem *vfs, const char *filename, TIME_SYSTEM modificationTime) | |
Create file resource. More... | |
Public Member Functions inherited from deResource | |
deResourceManager * | GetResourceManager () const |
Resource manager or NULL if resource is leaking. More... | |
deEngine * | GetEngine () const |
Game engine object from resource manager. More... | |
deResource * | GetLLManagerPrev () const |
Previous resource in the resource manager linked list. More... | |
void | SetLLManagerPrev (deResource *resource) |
Set next resource in the resource manager linked list. More... | |
deResource * | GetLLManagerNext () const |
Next resource in the resource manager linked list. More... | |
void | SetLLManagerNext (deResource *resource) |
Set next resource in the resource manager linked list. More... | |
void | MarkLeaking () |
Marks the resource leaking. More... | |
deResource (deResourceManager *resourceManager) | |
Create resource. More... | |
Public Member Functions inherited from deObject | |
int | GetRefCount () const |
Reference count. More... | |
void | AddReference () |
Add reference increasing reference count by 1. More... | |
void | FreeReference () |
Decrease reference count by one and delete object if count reaches 0. More... | |
deObject () | |
Create object with reference count of 1. More... | |
Constructors and Destructors | |
deRig (deRigManager *resourceManager, deVirtualFileSystem *vfs, const char *filename, TIME_SYSTEM modificationTime) | |
Create rig. More... | |
virtual | ~deRig () |
Clean up rig. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from deFileResource | |
virtual | ~deFileResource () |
Clean up file resource. More... | |
Protected Member Functions inherited from deResource | |
virtual | ~deResource () |
Clean up resource. More... | |
Protected Member Functions inherited from deObject | |
virtual | ~deObject () |
Clean up object. More... | |
Rig file resource.
Rigs define the sceleton of a static or articulated physics bodies. Animations and components are mapped to a rig for animation. Rigs are also used by the physics system to provide collision detection and physical simulations. For the physics system the root bone is mapped to the component collider. If this bone is missing the simulation produces incorrect behavior.
Shapes can be assigned a single shape property string. This allows to transport some additional game specific information with individual shapes of a rig. A typical use case is modifying the material sound for certain shapes. The user can choose the content and format of the string. By default all shapes have an empty string assigned.
typedef deTObjectReference<deRig> deRig::Ref |
Type holding strong reference.
deRig::deRig | ( | deRigManager * | resourceManager, |
deVirtualFileSystem * | vfs, | ||
const char * | filename, | ||
TIME_SYSTEM | modificationTime | ||
) |
Create rig.
|
protectedvirtual |
Clean up rig.
void deRig::AddBone | ( | deRigBone * | bone | ) |
Add bone.
deeInvalidParam | Named bone is present. |
deRigBone& deRig::GetBoneAt | ( | int | index | ) | const |
Bone at index.
deeOutOfBoundary | index is less than 0 or greater than or equal to GetBoneCount(). |
|
inline |
Number of bones.
|
inline |
Central mass point position.
|
inline |
Use component model for collision instead of shapes if present.
|
inline |
Physics system peer or NULL if not set.
|
inline |
Index of physics root bone or -1 if not set.
|
inline |
Shape properties.
|
inline |
Shapes.
bool deRig::HasBoneNamed | ( | const char * | name | ) | const |
Named bone is present.
int deRig::IndexOfBoneNamed | ( | const char * | name | ) | const |
Index of named bone or -1 if absent.
void deRig::Prepare | ( | ) |
Prepare rig after loading.
void deRig::RemoveAllBones | ( | ) |
Remove all bones.
void deRig::SetCentralMassPoint | ( | const decVector & | cmp | ) |
Set central mass point position.
void deRig::SetModelCollision | ( | bool | modelCollision | ) |
Set if component model is used for collision instead of shapes if present.
void deRig::SetPeerPhysics | ( | deBasePhysicsRig * | peer | ) |
Set physics system peer or NULL if not set.
void deRig::SetRootBone | ( | int | rootBone | ) |
Set physics root bone or -1 if not set.
deeOutOfBoundary | index is less than -1 or greater than or equal to GetBoneCount(). |
void deRig::SetShapeProperties | ( | const decStringList & | properties | ) |
Set shape properties.
deeInvalidParam | Number of strings in properties does not match GetShapes().GetCount(). |
void deRig::SetShapes | ( | const decShapeList & | shapes | ) |
Set shapes.
Resets shape properties to empty strings for all shapes.
bool deRig::Verify | ( | ) | const |
Verify rig is valid.