- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FCDPhysicsModel Class Reference
[COLLADA Document Object Model.]

A COLLADA physics model. More...

`#include <FCDPhysicsModel.h>`

Inheritance diagram for FCDPhysicsModel:

List of all members.

## Public Member Functions
| FCDPhysicsModel (FCDocument *document)
| Constructor: do not use directly.
virtual | ~FCDPhysicsModel ()
| Destructor.
virtual Type | GetType () const
| Retrieves the entity type for this class.
FCDPhysicsModelInstanceContainer & | GetInstances ()
| Retrieves the instantiated physics models that are part of this physics model.
const FCDPhysicsModelInstanceContainer & | GetInstances () const
| See above.
size_t | GetInstanceCount () const
| Retrieves the number of instantiated physics models that are part of this physics model.
FCDPhysicsModelInstance * | GetInstance (size_t index)
| Retrieves a specific instantiated physics model that is a part of this physics model.
const FCDPhysicsModelInstance * | GetInstance (size_t index) const
| See above.
FCDPhysicsModelInstance * | AddPhysicsModelInstance (FCDPhysicsModel *model=NULL)
| Adds a instantiated physics model to this physics model.
FCDPhysicsRigidBodyContainer & | GetRigidBodies ()
| Retrieves the rigid bodies that are a part of this physics model.
const FCDPhysicsRigidBodyContainer & | GetRigidBodies () const
| See above.
size_t | GetRigidBodyCount () const
| Retrieves the number of rigid bodies that are a part of this physics model.
FCDPhysicsRigidBody * | GetRigidBody (size_t index)
| Retrieves a specific rigid body that is a part of this physics model by its index.
const FCDPhysicsRigidBody * | GetRigidBody (size_t index) const
| See above.
FCDPhysicsRigidBody * | FindRigidBodyFromSid (const fm::string &sid)
| Retrieves a specific rigid body that is a part of this physics model by its sid.
const FCDPhysicsRigidBody * | FindRigidBodyFromSid (const fm::string &sid) const
| See above.
FCDPhysicsRigidBody * | AddRigidBody ()
| Adds a rigid body to this physics model.
FCDPhysicsRigidConstraintContainer & | GetRigidConstraints ()
| Retrieves the rigid constraints that are a part of this physics model.
const FCDPhysicsRigidConstraintContainer & | GetRigidConstraints () const
| See above.
size_t | GetRigidConstraintCount () const
| Retrieves the number of rigid constraints that are a part of this physics model.
FCDPhysicsRigidConstraint * | GetRigidConstraint (size_t index)
| Retrieves a specific rigid constraint that is a part of tihs physics model by its index.
const FCDPhysicsRigidConstraint * | GetRigidConstraint (size_t index) const
| See above.
FCDPhysicsRigidConstraint * | FindRigidConstraintFromSid (const fm::string &sid)
| Retrieves a specific rigid constraint that is a part of tihs physics model by its sid.
const FCDPhysicsRigidConstraint * | FindRigidConstraintFromSid (const fm::string &sid) const
| See above.
FCDPhysicsRigidConstraint * | AddRigidConstraint ()
| Adds a rigid constraint to this physics model.
virtual FCDEntity * | Clone (FCDEntity *clone=NULL, bool cloneChildren=false) const
| Copies the physics model into a clone.
bool | AttachModelInstances ()
| [INTERNAL] Attaches the model instances.
virtual void | CleanSubId ()
| [INTERNAL] Cleans up the sub identifiers.

## Detailed Description

A COLLADA physics model.

A physics model can contain rigid bodies, rigid constraints, or instances of previously defined physics models. For example, a house physics model could contain a number of instantiated physics models such as walls.

## Constructor & Destructor Documentation

FCDPhysicsModel::FCDPhysicsModel | ( | FCDocument * | document | ) |

  | Constructor: do not use directly. Create new physics models using the FCDLibrary::AddEntity function. Parameters:
  | document | The COLLADA document that contains this physics model.

## Member Function Documentation

FCDPhysicsModelInstance* FCDPhysicsModel::AddPhysicsModelInstance | ( | FCDPhysicsModel * | model = `NULL` | ) |

  | Adds a instantiated physics model to this physics model. Parameters:
  | model | The physics model to be instanced in this physics model. If this value is NULL, then there is no associated physics model for the instance yet. It should be filled in.
Returns: The new physics model instance.

FCDPhysicsRigidBody* FCDPhysicsModel::AddRigidBody | ( |  | ) |

| Adds a rigid body to this physics model. Returns: The new rigid body.

FCDPhysicsRigidConstraint* FCDPhysicsModel::AddRigidConstraint | ( |  | ) |

| Adds a rigid constraint to this physics model. Returns: The new rigid constraint.

bool FCDPhysicsModel::AttachModelInstances | ( |  | ) |

| [INTERNAL] Attaches the model instances. Because model instances can instance other models, the ordering is unknown so this cannot be done in the LoadFromXML call. This method should be called after LoadFromXML is applied to all physics models.

virtual void FCDPhysicsModel::CleanSubId | ( |  | ) | `[virtual]`

| [INTERNAL] Cleans up the sub identifiers. The sub identifiers must be unique with respect to its parent. This method corrects the sub ids if there are conflicts.

virtual FCDEntity* FCDPhysicsModel::Clone | ( | FCDEntity * | clone = `NULL`,
|  | bool | cloneChildren = `false`
| ) | const`[virtual]`

  | Copies the physics model into a clone. Parameters:
  | clone | The empty clone. If this pointer is NULL, a new physics model will be created and you will need to release the returned pointer manually.
  | cloneChildren | Whether to recursively clone this entity's children.
Returns: The clone. Reimplemented from FCDEntity.

FCDPhysicsRigidBody* FCDPhysicsModel::FindRigidBodyFromSid | ( | const fm::string & | sid | ) | `[inline]`

  | Retrieves a specific rigid body that is a part of this physics model by its sid. Parameters:
  | sid | The sid of the rigid body.
Returns: The rigid body.

FCDPhysicsRigidConstraint* FCDPhysicsModel::FindRigidConstraintFromSid | ( | const fm::string & | sid | ) | `[inline]`

  | Retrieves a specific rigid constraint that is a part of tihs physics model by its sid. Parameters:
  | sid | The sid of the rigid constraint.
Returns: The rigid constraint.

FCDPhysicsModelInstance* FCDPhysicsModel::GetInstance | ( | size_t | index | ) | `[inline]`

  | Retrieves a specific instantiated physics model that is a part of this physics model. Parameters:
  | index | The index of the instance.
Returns: The physics model instance.

size_t FCDPhysicsModel::GetInstanceCount | ( |  | ) | const`[inline]`

| Retrieves the number of instantiated physics models that are part of this physics model. Returns: The number of instantiated physics models.

FCDPhysicsModelInstanceContainer& FCDPhysicsModel::GetInstances | ( |  | ) | `[inline]`

| Retrieves the instantiated physics models that are part of this physics model. Returns: The physics model instances.

FCDPhysicsRigidBodyContainer& FCDPhysicsModel::GetRigidBodies | ( |  | ) | `[inline]`

| Retrieves the rigid bodies that are a part of this physics model. Returns: The rigid bodies.

FCDPhysicsRigidBody* FCDPhysicsModel::GetRigidBody | ( | size_t | index | ) | `[inline]`

  | Retrieves a specific rigid body that is a part of this physics model by its index. Parameters:
  | index | The index of the rigid body.
Returns: The rigid body.

size_t FCDPhysicsModel::GetRigidBodyCount | ( |  | ) | const`[inline]`

| Retrieves the number of rigid bodies that are a part of this physics model. Returns: The number of rigid bodies.

FCDPhysicsRigidConstraint* FCDPhysicsModel::GetRigidConstraint | ( | size_t | index | ) | `[inline]`

  | Retrieves a specific rigid constraint that is a part of tihs physics model by its index. Parameters:
  | index | The index of the rigid constraint.
Returns: The rigid constraint.

size_t FCDPhysicsModel::GetRigidConstraintCount | ( |  | ) | const`[inline]`

| Retrieves the number of rigid constraints that are a part of this physics model. Returns: The number of rigid constraints.

FCDPhysicsRigidConstraintContainer& FCDPhysicsModel::GetRigidConstraints | ( |  | ) | `[inline]`

| Retrieves the rigid constraints that are a part of this physics model. Returns: The rigid constraints.

virtual Type FCDPhysicsModel::GetType | ( |  | ) | const`[inline, virtual]`

| Retrieves the entity type for this class. This function is part of the FCDEntity interface. Returns: The entity type: PHYSICS_MODEL. Reimplemented from FCDEntity.

The documentation for this class was generated from the following file:

- FCDocument/FCDPhysicsModel.h