Component Resource. More...
#include <deComponent.h>
Public Member Functions | |
Constructors and Destructors | |
| deComponent (deComponentManager *manager, deModel *model, deSkin *skin) | |
| Creates a new component. | |
| virtual | ~deComponent () |
| Frees the component. | |
Management | |
| const decDVector & | GetPosition () const |
| Retrieves the position. | |
| void | SetPosition (const decDVector &pos) |
| Sets the position. | |
| const decQuaternion & | GetOrientation () const |
| Retrieves the orientation. | |
| void | SetOrientation (const decQuaternion &orientation) |
| Sets the orientation. | |
| const decVector & | GetScaling () const |
| Retrieves the scaling. | |
| void | SetScaling (const decVector &scale) |
| Sets the scaling. | |
| deModel * | GetModel () const |
| Retrieves the model or NULL if not assigned. | |
| void | SetModel (deModel *model) |
| Sets the model or NULL if not assigned. | |
| deSkin * | GetSkin () const |
| Retrieves the skin or NULL if not assigned. | |
| void | SetSkin (deSkin *skin) |
| Sets the skin or NULL if not assigned. | |
| deRig * | GetRig () const |
| Retrieves the rig or NULL if not assigned. | |
| void | SetRig (deRig *rig) |
| Sets the rig or NULL if not assigned. | |
| void | SetModelAndSkin (deModel *model, deSkin *skin) |
| Sets the model and skin at the same time. | |
| deModel * | GetOccluder () const |
| Retrieves the occluder model or NULL if not assigned. | |
| void | SetOccluder (deModel *model) |
| Sets the occluder model or NULL if not assigned. | |
| bool | GetVisible () const |
| Determines if the component is visible. | |
| void | SetVisible (bool visible) |
| Sets if the component is visible. | |
| bool | GetCastShadows () const |
| Determines if the component casts shadows. | |
| void | SetCastShadows (bool castShadows) |
| Sets if the component casts shadows. | |
| bool | GetStatic () const |
| Determines if the component is static. | |
| void | SetStatic (bool bStatic) |
| Sets if the component is static. | |
| int | GetImportance () const |
| void | SetImportance (int importance) |
| const decVector & | GetMinimumExtend () |
| const decVector & | GetMaximumExtend () |
| const decMatrix & | GetMatrix () |
| const decMatrix & | GetInverseMatrix () |
| void | SetClosestExtends () |
| int | GetWeightsCount () const |
| int | GetBoneCount () const |
| int | GetVertexCount () const |
| int | GetNormalCount () const |
| int | GetFaceCount () const |
| deComponentBone * | GetBone (int index) const |
| void | UpdateBoneAt (int index) |
| Updates the given bone. | |
| const decMatrix & | GetWeights (int index) const |
| const decVector & | GetVertex (int index) const |
| const decVector & | GetNormal (int index) const |
| const decVector & | GetFaceNormal (int index) const |
| decVector | GetFaceCenter (int index) const |
| void | InvalidateBones () |
| Marks bones dirty. | |
| void | ValidateBones () |
| Marks bones no more dirty. | |
| void | InvalidateMesh () |
| Marks the mesh dirty. | |
| void | InvalidateExtends () |
| Marks the extends dirty. | |
| deDynamicSkin * | GetDynamicSkin () const |
| Retrieves the dynamic skin or null if not used. | |
| void | SetDynamicSkin (deDynamicSkin *dynamicSkin) |
| Sets the dynamic skin or null if not used. | |
| int | GetModifierCount () const |
| deComponentModifier * | GetModifierAt (int index) const |
| deComponentModifier * | GetModifierFor (int renderModifierIndex) const |
| int | IndexOfModifier (deComponentModifier *modifier) const |
| int | IndexOfModifierFor (int renderModifierIndex) const |
| bool | HasModifier (deComponentModifier *modifier) const |
| bool | HasModifierFor (int renderModifierIndex) const |
| void | AddModifier (deComponentModifier *modifier) |
| void | RemoveModifier (deComponentModifier *modifier) |
| void | RemoveAllModifiers () |
| void | NotifyModifierChanged (deComponentModifier *modifier) |
| bool | MatchesModelSkin () const |
| int | GetModelRigMappingCount () const |
| int | GetModelRigMapping (int boneIndex) const |
| bool | MatchesModelRig () const |
| void | UpdateSkin (float time) |
| void | PrepareExtends () |
| void | PrepareMatrix () |
| void | PrepareBones () |
| void | PrepareWeights () |
| void | PrepareMesh () |
Textures | |
| int | GetTextureCount () const |
| Retrieves the number of textures. | |
| deComponentTexture & | GetTextureAt (int index) const |
| Retrieves the texture with the given index. | |
| void | NotifyTextureChanged (int index) const |
| Notifies the peers that a texture changed. | |
Decals Management | |
| int | GetDecalCount () const |
| Retrieves the count of decals. | |
| deDecal * | GetDecalAt (int index) const |
| Retrieves the decal at the given index. | |
| int | IndexOfDecal (deDecal *decal) const |
| Retrieves the index of the given decal of -1 if not found. | |
| void | AddDecal (deDecal *decal) |
| Adds a decal to the world. | |
| void | RemoveDecal (deDecal *decal) |
| Removes the given decal from the world. | |
| void | RemoveAllDecals () |
| Removes all decals from the world. | |
Collision Detection | |
| void | FindDecalsAt (const decVector &point, deDecalList *list) |
| Stores all decals in contact with the given surface point into the provided list. | |
| void | FindDecalsTouching (decShape *shape, deDecalList *list) |
| Stores all decals in contact with the given shape into the provided list. | |
System Peers | |
| deBaseGraphicComponent * | GetGraphicComponent () const |
| void | SetGraphicComponent (deBaseGraphicComponent *comp) |
| deBasePhysicsComponent * | GetPhysicsComponent () const |
| void | SetPhysicsComponent (deBasePhysicsComponent *comp) |
| deBaseAudioComponent * | GetAudioComponent () const |
| void | SetAudioComponent (deBaseAudioComponent *audComp) |
| deBaseScriptingComponent * | GetScriptingComponent () const |
| void | SetScriptingComponent (deBaseScriptingComponent *comp) |
Component Resource.
A component resource is the most important element after the world itself. This object ties together various other objects to form a renderable object. A world component requires at least a model object and a skin object to be set. The textures in the model are then mapped to the skin textures used for rendering. In addition a rig and an animation object can be set. If the rig is set the bones of the rig are considere the component bones. The bones of the model are mapped to the rig bones for vertex weighting. If an animation object is set too the bones of the animation object are mapped to the rig bones too for retrieving the correct bone states. The following mapping table shows those relations.
The rig bones are the component bones. All bone indices are range checked against rig bones.
| deComponent::deComponent | ( | deComponentManager * | manager, |
| deModel * | model, | ||
| deSkin * | skin | ||
| ) |
Creates a new component.
| virtual deComponent::~deComponent | ( | ) | [virtual] |
Frees the component.
| void deComponent::AddDecal | ( | deDecal * | decal ) |
Adds a decal to the world.
| void deComponent::AddModifier | ( | deComponentModifier * | modifier ) |
| void deComponent::FindDecalsAt | ( | const decVector & | point, |
| deDecalList * | list | ||
| ) |
Stores all decals in contact with the given surface point into the provided list.
The point is best taken from an earlier collision test and is in world coordinates. The point is considered to be in the same sector as the component.
| point | Point on the surface to test. |
| list | List of decals to fill in. Not emptied before filling. |
| void deComponent::FindDecalsTouching | ( | decShape * | shape, |
| deDecalList * | list | ||
| ) |
Stores all decals in contact with the given shape into the provided list.
The shape is considered to be in the same sector as the component.
| shape | Shape to test. |
| list | List of decals to fill in. Not emptied before filling. |
| deBaseAudioComponent* deComponent::GetAudioComponent | ( | ) | const [inline] |
| deComponentBone* deComponent::GetBone | ( | int | index ) | const |
| int deComponent::GetBoneCount | ( | ) | const [inline] |
| bool deComponent::GetCastShadows | ( | ) | const [inline] |
Determines if the component casts shadows.
| deDecal* deComponent::GetDecalAt | ( | int | index ) | const |
Retrieves the decal at the given index.
| int deComponent::GetDecalCount | ( | ) | const [inline] |
Retrieves the count of decals.
| deDynamicSkin* deComponent::GetDynamicSkin | ( | ) | const [inline] |
Retrieves the dynamic skin or null if not used.
| decVector deComponent::GetFaceCenter | ( | int | index ) | const |
| int deComponent::GetFaceCount | ( | ) | const [inline] |
| const decVector& deComponent::GetFaceNormal | ( | int | index ) | const |
| deBaseGraphicComponent* deComponent::GetGraphicComponent | ( | ) | const [inline] |
| int deComponent::GetImportance | ( | ) | const [inline] |
| const decMatrix& deComponent::GetInverseMatrix | ( | ) |
| const decMatrix& deComponent::GetMatrix | ( | ) |
| const decVector& deComponent::GetMaximumExtend | ( | ) |
| const decVector& deComponent::GetMinimumExtend | ( | ) |
| deModel* deComponent::GetModel | ( | ) | const [inline] |
Retrieves the model or NULL if not assigned.
| int deComponent::GetModelRigMapping | ( | int | boneIndex ) | const |
| int deComponent::GetModelRigMappingCount | ( | ) | const [inline] |
| deComponentModifier* deComponent::GetModifierAt | ( | int | index ) | const |
| int deComponent::GetModifierCount | ( | ) | const [inline] |
| deComponentModifier* deComponent::GetModifierFor | ( | int | renderModifierIndex ) | const |
| const decVector& deComponent::GetNormal | ( | int | index ) | const |
| int deComponent::GetNormalCount | ( | ) | const [inline] |
| deModel* deComponent::GetOccluder | ( | ) | const [inline] |
Retrieves the occluder model or NULL if not assigned.
| const decQuaternion& deComponent::GetOrientation | ( | ) | const [inline] |
Retrieves the orientation.
| deBasePhysicsComponent* deComponent::GetPhysicsComponent | ( | ) | const [inline] |
| const decDVector& deComponent::GetPosition | ( | ) | const [inline] |
Retrieves the position.
| deRig* deComponent::GetRig | ( | ) | const [inline] |
Retrieves the rig or NULL if not assigned.
| const decVector& deComponent::GetScaling | ( | ) | const [inline] |
Retrieves the scaling.
| deBaseScriptingComponent* deComponent::GetScriptingComponent | ( | ) | const [inline] |
| deSkin* deComponent::GetSkin | ( | ) | const [inline] |
Retrieves the skin or NULL if not assigned.
| bool deComponent::GetStatic | ( | ) | const [inline] |
Determines if the component is static.
| deComponentTexture& deComponent::GetTextureAt | ( | int | index ) | const |
Retrieves the texture with the given index.
| int deComponent::GetTextureCount | ( | ) | const [inline] |
Retrieves the number of textures.
| const decVector& deComponent::GetVertex | ( | int | index ) | const |
| int deComponent::GetVertexCount | ( | ) | const [inline] |
| bool deComponent::GetVisible | ( | ) | const [inline] |
Determines if the component is visible.
| const decMatrix& deComponent::GetWeights | ( | int | index ) | const |
| int deComponent::GetWeightsCount | ( | ) | const [inline] |
| bool deComponent::HasModifier | ( | deComponentModifier * | modifier ) | const |
| bool deComponent::HasModifierFor | ( | int | renderModifierIndex ) | const |
| int deComponent::IndexOfDecal | ( | deDecal * | decal ) | const |
Retrieves the index of the given decal of -1 if not found.
| int deComponent::IndexOfModifier | ( | deComponentModifier * | modifier ) | const |
| int deComponent::IndexOfModifierFor | ( | int | renderModifierIndex ) | const |
| void deComponent::InvalidateBones | ( | ) |
Marks bones dirty.
Mesh, weights and extends are set dirty too and the appropriate notifiers are called if required.
| void deComponent::InvalidateExtends | ( | ) |
Marks the extends dirty.
| void deComponent::InvalidateMesh | ( | ) |
Marks the mesh dirty.
| bool deComponent::MatchesModelRig | ( | ) | const |
| bool deComponent::MatchesModelSkin | ( | ) | const |
| void deComponent::NotifyModifierChanged | ( | deComponentModifier * | modifier ) |
| void deComponent::NotifyTextureChanged | ( | int | index ) | const |
Notifies the peers that a texture changed.
| void deComponent::PrepareBones | ( | ) |
| void deComponent::PrepareExtends | ( | ) |
| void deComponent::PrepareMatrix | ( | ) |
| void deComponent::PrepareMesh | ( | ) |
| void deComponent::PrepareWeights | ( | ) |
| void deComponent::RemoveAllDecals | ( | ) |
Removes all decals from the world.
| void deComponent::RemoveAllModifiers | ( | ) |
| void deComponent::RemoveDecal | ( | deDecal * | decal ) |
Removes the given decal from the world.
| void deComponent::RemoveModifier | ( | deComponentModifier * | modifier ) |
| void deComponent::SetAudioComponent | ( | deBaseAudioComponent * | audComp ) |
| void deComponent::SetCastShadows | ( | bool | castShadows ) |
Sets if the component casts shadows.
| void deComponent::SetClosestExtends | ( | ) |
| void deComponent::SetDynamicSkin | ( | deDynamicSkin * | dynamicSkin ) |
Sets the dynamic skin or null if not used.
| void deComponent::SetGraphicComponent | ( | deBaseGraphicComponent * | comp ) |
| void deComponent::SetImportance | ( | int | importance ) |
| void deComponent::SetModel | ( | deModel * | model ) |
Sets the model or NULL if not assigned.
Sets the model and skin at the same time.
Either one can be NULL.
| void deComponent::SetOccluder | ( | deModel * | model ) |
Sets the occluder model or NULL if not assigned.
| void deComponent::SetOrientation | ( | const decQuaternion & | orientation ) |
Sets the orientation.
| void deComponent::SetPhysicsComponent | ( | deBasePhysicsComponent * | comp ) |
| void deComponent::SetPosition | ( | const decDVector & | pos ) |
Sets the position.
| void deComponent::SetRig | ( | deRig * | rig ) |
Sets the rig or NULL if not assigned.
| void deComponent::SetScaling | ( | const decVector & | scale ) |
Sets the scaling.
| void deComponent::SetScriptingComponent | ( | deBaseScriptingComponent * | comp ) |
| void deComponent::SetSkin | ( | deSkin * | skin ) |
Sets the skin or NULL if not assigned.
| void deComponent::SetStatic | ( | bool | bStatic ) |
Sets if the component is static.
| void deComponent::SetVisible | ( | bool | visible ) |
Sets if the component is visible.
| void deComponent::UpdateBoneAt | ( | int | index ) |
Updates the given bone.
| void deComponent::UpdateSkin | ( | float | time ) |
| void deComponent::ValidateBones | ( | ) |
Marks bones no more dirty.
No other action is carried out except setting the dirty flag for bones. Use this function if you updated all bones on your own ( typically physics modules during simulation ). The mesh, weight and extends dirty flag keep their values. You have to call the InvalidateMesh function after validating bones to ensure they are updated correctly during the next update step.
1.7.2