overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Static Public Member Functions
gameplay::PhysicsCollisionShape Class Reference

#include <PhysicsCollisionShape.h>

Inheritance diagram for gameplay::PhysicsCollisionShape:
gameplay::Ref

List of all members.

Classes

struct  Definition
struct  HeightfieldData
struct  MeshData

Public Types

enum  Type {
  SHAPE_NONE, SHAPE_BOX, SHAPE_SPHERE, SHAPE_CAPSULE,
  SHAPE_MESH, SHAPE_HEIGHTFIELD
}

Public Member Functions

PhysicsCollisionShape::Type getType () const
btCollisionShape * getShape () const

Static Public Member Functions

static
PhysicsCollisionShape::Definition 
box ()
static
PhysicsCollisionShape::Definition 
box (const Vector3 &extents, const Vector3 &center=Vector3::zero(), bool absolute=false)
static
PhysicsCollisionShape::Definition 
sphere ()
static
PhysicsCollisionShape::Definition 
sphere (float radius, const Vector3 &center=Vector3::zero(), bool absolute=false)
static
PhysicsCollisionShape::Definition 
capsule ()
static
PhysicsCollisionShape::Definition 
capsule (float radius, float height, const Vector3 &center=Vector3::zero(), bool absolute=false)
static
PhysicsCollisionShape::Definition 
heightfield ()
static
PhysicsCollisionShape::Definition 
heightfield (HeightField *heightfield)
static
PhysicsCollisionShape::Definition 
mesh (Mesh *mesh)

Detailed Description

Defines the physics collision shape class that all supported shapes derive from.


Member Enumeration Documentation

Defines the supported collision shape types.


Member Function Documentation

Defines a box shape, using the bounding volume of the node it is attached to.

Returns:
Definition of a box shape.
static PhysicsCollisionShape::Definition gameplay::PhysicsCollisionShape::box ( const Vector3 extents,
const Vector3 center = Vector3::zero(),
bool  absolute = false 
) [static]

Defines a box shape, using the specified shape information and center.

Parameters:
extentsExtents of the box shape along the x, y and z axes.
centerCenter point of the box.
absoluteTrue to specify that the given center point is an absolute position. By default the center point is treated as relative to the location of the node that the shape is attached to.
Returns:
Definition of a box shape.

Defines a capsule shape, using the bounding volume of the node it is attached to.

Returns:
Definition of a capsule shape.
static PhysicsCollisionShape::Definition gameplay::PhysicsCollisionShape::capsule ( float  radius,
float  height,
const Vector3 center = Vector3::zero(),
bool  absolute = false 
) [static]

Defines a capsule shape, using the specified shape information and center.

Parameters:
radiusRadius of the capsule.
heightHeight of the capsule.
centerCenter point of the capsule.
absoluteTrue to specify that the given center point is an absolute position. By default the center point is treated as relative to the location of the node that the shape is attached to.
Returns:
Definition of a capsule shape.
btCollisionShape* gameplay::PhysicsCollisionShape::getShape ( ) const [inline]

Returns the internal bullet physics shape object.

Returns:
The bullet shape object.

Returns the type of this collision shape.

Returns:
The collision shape type.

Defines a heightfield shape, using the height data of a terrain on the node that is attached to.

This method only results in a valid heightfield collision object when the shape is used to create a collision object on a node that has a Terrain attached to it. If there is no Terrain attached to the node, the collision object creation will fail.

Returns:
Definition of a heightfield shape.

Defines a heightfield shape using the specified array of height values.

The dimensions of the heightfield will be (width, maxHeight, height), where width and height are the dimensions of the passed in height array and maxHeight is the maximum height value in the height array.

Heightfield rigid bodies are always assumed be Y-up (height value on the Y axis) and be centered around the X and Z axes.

The heightfield can be scaled once a PhysicsRigidBody has been created for it, using the PhysicsRigidBody::setLocalScaling method.

Parameters:
heightfieldHeightField object containing the array of height values representing the heightfield.
Returns:
Definition of a heightfield shape.

Defines a mesh shape using the specified mesh.

Returns:
Definition of a mesh shape.

Defines a sphere shape, using the bounding volume of the node it is attached to.

Returns:
Definition of a sphere shape.
static PhysicsCollisionShape::Definition gameplay::PhysicsCollisionShape::sphere ( float  radius,
const Vector3 center = Vector3::zero(),
bool  absolute = false 
) [static]

Defines a sphere shape, using the specified shape information and center.

Parameters:
radiusRadius of the sphere.
centerCenter point of the sphere.
absoluteTrue to specify that the given center point is an absolute position. By default the center point is treated as relative to the location of the node that the shape is attached to.
Returns:
Definition of a sphere shape.

Member Data Documentation

 All Classes Functions Variables Typedefs Enumerations Enumerator