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

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

# FCDPhysicsShape Class Reference
[COLLADA Document Object Model.]

A COLLADA shape object. More...

`#include <FCDPhysicsShape.h>`

Inheritance diagram for FCDPhysicsShape:

List of all members.

## Public Member Functions
| FCDPhysicsShape (FCDocument *document)
| Constructor: do not use directly.
virtual | ~FCDPhysicsShape ()
| Destructor.
float | GetMass () const
| Retrieves the mass of this shape.
const float * | GetMassPointer () const
void | SetMass (float mass)
| Sets the mass of this shape.
bool | IsDensityMoreAccurate () const
| Retrieves whether density of this shape is more accurate than mass.
void | SetDensityMoreAccurate (bool value)
| [INTERNAL] Set 'DensityMoreAccurate'.
float | GetDensity () const
| Retrieves the density of this shape.
const float * | GetDensityPointer () const
void | SetDensity (float density)
| Sets the density of this shape.
bool | IsHollow () const
| Retrives whether this shape is hollow.
void | SetHollow (bool _hollow)
| Sets whether this shape is hollow.
bool | IsAnalyticalGeometry () const
| Retrieves whether this shape is an analyical geometry such as a box, plane, sphere, cylinder, tapered cylinder, capsule, or tapered capsule.
FCDPhysicsAnalyticalGeometry * | GetAnalyticalGeometry ()
| Gets the analytic geometry.
const FCDPhysicsAnalyticalGeometry * | GetAnalyticalGeometry () const
| See above.
void | SetAnalyticalGeometry (FCDPhysicsAnalyticalGeometry *aGeom)
| [INTERNAL] Set the analytical geometry.
bool | IsGeometryInstance () const
| Retrieves whether this shape is a geometry instance such as from mesh, convex mesh, or spline.
FCDGeometryInstance * | GetGeometryInstance ()
| Gets the geometry instance.
const FCDGeometryInstance * | GetGeometryInstance () const
| See above.
void | SetGeometryInstance (FCDGeometryInstance *instance)
| [INTERNAL] Set the geometry instance.
FCDGeometryInstance * | CreateGeometryInstance (FCDGeometry *geom, bool createConvexMesh=false)
| Creates a geometry instance for this shape.
FCDPhysicsAnalyticalGeometry * | CreateAnalyticalGeometry (FCDPhysicsAnalyticalGeometry::GeomType type)
| Creates an analytical geometry for this shape.
FCDTransformContainer & | GetTransforms ()
| Retrieves the transforms for this shape.
const FCDTransformContainer & | GetTransforms () const
| See above.
FCDTransform * | AddTransform (FCDTransform::Type type, size_t index=(size_t)-1)
| Adds a transform for this shape.
FCDPhysicsMaterial * | GetPhysicsMaterial ()
| Retrieves the physics material for this shape.
const FCDPhysicsMaterial * | GetPhysicsMaterial () const
| See above.
void | SetPhysicsMaterial (FCDPhysicsMaterial *physicsMaterial)
| Sets the physics material for this shape.
FCDPhysicsMaterial * | AddOwnPhysicsMaterial ()
| Adds a physics material for this shape.
FCDPhysicsShape * | Clone (FCDPhysicsShape *clone=NULL) const
| Copies the shape into a clone.
float | CalculateVolume () const
| Calculates the volume of the shape.
void | SetInstanceMaterial (FCDEntityInstance *instance)
| [INTERNAL] Set the material instance.
FCDEntityInstance * | GetInstanceMaterial ()
| [INTERNAL] Retrieve the material instance.
bool | OwnsPhysicsMaterial ()
| [INTERNAL] Determin if it owns the material.

## Detailed Description

A COLLADA shape object.

A shape describes the boundary used for collision detection within a rigid body. It belongs to a single rigid body and cannot be referenced from other elements.

## Constructor & Destructor Documentation

FCDPhysicsShape::FCDPhysicsShape | ( | FCDocument * | document | ) |

  | Constructor: do not use directly. Create new shapes using the FCDPhysicsRigidBody::AddPhysicsShape function. Parameters:
  | document | The COLLADA document that contains this rigid body.

## Member Function Documentation

FCDPhysicsMaterial* FCDPhysicsShape::AddOwnPhysicsMaterial | ( |  | ) |

| Adds a physics material for this shape. This shape is responsible for releasing the physics material. Returns: The new physics material.

FCDTransform* FCDPhysicsShape::AddTransform | ( | FCDTransform::Type | type,
|  | size_t | index = `(size_t)-1`
| ) |

  | Adds a transform for this shape. Parameters:
  | type | The type of transform.
  | index | The position in the transform list to add it to; an index greater than the size indicates adding the transform to the end.
Returns: The new transform.

float FCDPhysicsShape::CalculateVolume | ( |  | ) | const

| Calculates the volume of the shape. Currently it is calculating a simple bounding box volume if IsGeometryInstance it true, and it is calculating the exact volume if IsAnalyticalGeometry is true. Note that a volume of 1.0f is returned if it is a spline or plane. Returns: The volume of the shape.

FCDPhysicsShape* FCDPhysicsShape::Clone | ( | FCDPhysicsShape * | clone = `NULL` | ) | const

  | Copies the shape into a clone. Parameters:
  | clone | The empty clone. If this pointer is NULL, a new physics shape will be created and you will need to release the returned pointer manually.
Returns: The clone.

FCDPhysicsAnalyticalGeometry* FCDPhysicsShape::CreateAnalyticalGeometry | ( | FCDPhysicsAnalyticalGeometry::GeomType | type | ) |

  | Creates an analytical geometry for this shape. If IsGeometryInstance returned true before this call, it will return false afterwards as the geometry instance is released. Parameters:
  | type | The type of analytical geometry to create.
Returns: The new analytical geometry.

FCDGeometryInstance* FCDPhysicsShape::CreateGeometryInstance | ( | FCDGeometry * | geom,
|  | bool | createConvexMesh = `false`
| ) |

  | Creates a geometry instance for this shape. If IsAnalyticalGeometry returned true before this call, it will return false afterwards as the analytical geometry is released. Parameters:
  | geom | The geometry to instance.
  | createConvexMesh | True if want to create a convex mesh from geom
Returns: The new geometry instance.

FCDPhysicsAnalyticalGeometry* FCDPhysicsShape::GetAnalyticalGeometry | ( |  | ) | `[inline]`

| Gets the analytic geometry. NULL is returned if IsAnalyticalGeometry returns false. Returns: The analytical geometry.

float FCDPhysicsShape::GetDensity | ( |  | ) | const

| Retrieves the density of this shape. Returns: The density.

FCDGeometryInstance* FCDPhysicsShape::GetGeometryInstance | ( |  | ) | `[inline]`

| Gets the geometry instance. NULL is returned if IsGeometryInstance returns false. Returns: The geometry instance.

FCDEntityInstance* FCDPhysicsShape::GetInstanceMaterial | ( |  | ) | `[inline]`

| [INTERNAL] Retrieve the material instance. Returns: The material instance.

float FCDPhysicsShape::GetMass | ( |  | ) | const

| Retrieves the mass of this shape. Returns: The mass.

FCDPhysicsMaterial* FCDPhysicsShape::GetPhysicsMaterial | ( |  | ) | `[inline]`

| Retrieves the physics material for this shape. Returns: The physics material for this shape.

FCDTransformContainer& FCDPhysicsShape::GetTransforms | ( |  | ) | `[inline]`

| Retrieves the transforms for this shape. Returns: The transforms.

bool FCDPhysicsShape::IsAnalyticalGeometry | ( |  | ) | const`[inline]`

| Retrieves whether this shape is an analyical geometry such as a box, plane, sphere, cylinder, tapered cylinder, capsule, or tapered capsule. Returns: True if this shape is an analytical geometry.

bool FCDPhysicsShape::IsDensityMoreAccurate | ( |  | ) | const`[inline]`

| Retrieves whether density of this shape is more accurate than mass. It is more accurate if mass is not defined. In that case mass is calculated using approximations when it is non-analytic. Returns: True if density is more accurate.

bool FCDPhysicsShape::IsGeometryInstance | ( |  | ) | const`[inline]`

| Retrieves whether this shape is a geometry instance such as from mesh, convex mesh, or spline. Returns: True if this shape is a geometry instance.

bool FCDPhysicsShape::IsHollow | ( |  | ) | const`[inline]`

| Retrives whether this shape is hollow. Returns: True if this shape is hollow.

bool FCDPhysicsShape::OwnsPhysicsMaterial | ( |  | ) | `[inline]`

| [INTERNAL] Determin if it owns the material. Returns: True if this owns the material, false otherwise.

void FCDPhysicsShape::SetAnalyticalGeometry | ( | FCDPhysicsAnalyticalGeometry * | aGeom | ) | `[inline]`

  | [INTERNAL] Set the analytical geometry. Parameters:
  | aGeom | The analytical geometry.

void FCDPhysicsShape::SetDensity | ( | float | density | ) |

  | Sets the density of this shape. Parameters:
  | density | The new density.

void FCDPhysicsShape::SetDensityMoreAccurate | ( | bool | value | ) | `[inline]`

| [INTERNAL] Set 'DensityMoreAccurate'. value Value to be set.

void FCDPhysicsShape::SetGeometryInstance | ( | FCDGeometryInstance * | instance | ) | `[inline]`

  | [INTERNAL] Set the geometry instance. Parameters:
  | instance | The new geometry instance.

void FCDPhysicsShape::SetHollow | ( | bool | _hollow | ) | `[inline]`

  | Sets whether this shape is hollow. Parameters:
  | _hollow | True if this shape is hollow.

void FCDPhysicsShape::SetInstanceMaterial | ( | FCDEntityInstance * | instance | ) | `[inline]`

| [INTERNAL] Set the material instance. The new material instance.

void FCDPhysicsShape::SetMass | ( | float | mass | ) |

  | Sets the mass of this shape. Parameters:
  | mass | The new mass.

void FCDPhysicsShape::SetPhysicsMaterial | ( | FCDPhysicsMaterial * | physicsMaterial | ) |

  | Sets the physics material for this shape. Parameters:
  | physicsMaterial | The physics material for this shape.

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

- FCDocument/FCDPhysicsShape.h