PixelLightAPI  .
Public Member Functions | Protected Member Functions | Protected Attributes
PLPhysics::BodyMesh Class Reference

Abstract PL physics mesh body. More...

#include <BodyMesh.h>

Inheritance diagram for PLPhysics::BodyMesh:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual PLPHYSICS_API ~BodyMesh ()
 Destructor.
PLPHYSICS_API PLCore::String GetMesh () const
 Returns the collision mesh.
PLPHYSICS_API const
PLMath::Vector3
GetMeshScale () const
 Returns the mesh scale.
PLPHYSICS_API bool GetOptimize () const
 Returns whether the physics API is allowed to optimize the mesh or not (if supported)

Protected Member Functions

PLPHYSICS_API BodyMesh (World &cWorld, BodyImpl &cBodyImpl, const PLCore::String &sMesh, const PLMath::Vector3 &vMeshScale, bool bOptimize)
 Constructor.

Protected Attributes

PLCore::String m_sMesh
PLMath::Vector3 m_vMeshScale
bool m_bOptimize

Detailed Description

Abstract PL physics mesh body.

Remarks:
Tree collision is the preferred method for collision with polygonal meshes of arbitrary complexity. The mesh must be made of flat non-intersecting polygons, but they do not explicitly need to be triangles. Tree collision can be serialized by the application to/from an arbitrary storage device.
If concave polygons are added to the tree collision, the variable 'Optimize' must be set to 1. With the optimize variable set to 1, we will optimize the collision mesh by removing non essential edges from adjacent flat polygons. We will not change the topology of the mesh but significantly reduces the number of polygons in the mesh. The reduction factor of the number of polygons in the mesh depends upon the irregularity of the mesh topology. A reduction factor of 1.5 to 2 is common. If the variable optimize is set to zero, will leave the mesh geometry unaltered.
Note:
  • When a mesh is assigned to a body the mass of the body is ignored in all dynamics calculations. This makes the body behave as a static body.
  • The "TwoSided" material parameter should be supported

Constructor & Destructor Documentation

virtual PLPHYSICS_API PLPhysics::BodyMesh::~BodyMesh ( ) [virtual]

Destructor.

PLPHYSICS_API PLPhysics::BodyMesh::BodyMesh ( World cWorld,
BodyImpl &  cBodyImpl,
const PLCore::String sMesh,
const PLMath::Vector3 vMeshScale,
bool  bOptimize 
) [protected]

Constructor.

Parameters:
[in]cWorldWorld this body is in
[in]cBodyImplReference to the physics API specific body implementation
[in]sMeshCollision mesh
[in]vMeshScaleMesh scale
[in]bOptimizeAllow the physics API to optimize the mesh? (if supported)

Member Function Documentation

Returns the collision mesh.

Returns:
The collision mesh
PLPHYSICS_API const PLMath::Vector3& PLPhysics::BodyMesh::GetMeshScale ( ) const

Returns the mesh scale.

Returns:
The mesh scale
PLPHYSICS_API bool PLPhysics::BodyMesh::GetOptimize ( ) const

Returns whether the physics API is allowed to optimize the mesh or not (if supported)

Returns:
'true' if the physics API is allowed to optimize the mesh, else 'false'

Member Data Documentation

Collision mesh

Mesh scale

Allow the physics API to optimize the mesh? (if supported)


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:21
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported