Panda3D
|
A capsule shaped collision detection primitive, also known as a line swept sphere. More...
#include "physxCapsuleShape.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
float | get_height () const |
Retrieves the height of the capsule. | |
float | get_radius () const |
Retrieves the radius of the capsule. | |
virtual TypeHandle | get_type () const |
void | link (NxShape *shapePtr) |
NxShape * | ptr () const |
void | save_to_desc (PhysxCapsuleShapeDesc &shapeDesc) const |
Saves the state of the shape object to a descriptor. | |
void | set_height (float height) |
Alters the height of the capsule. | |
void | set_radius (float radius) |
Alters the radius of the capsule. | |
void | unlink () |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. |
A capsule shaped collision detection primitive, also known as a line swept sphere.
'radius' is the radius of the capsule's hemispherical ends and its trunk. 'height' is the distance between the two hemispherical ends of the capsule. The height is along the capsule's Y axis. Each shape is owned by an actor that it is attached to.
An instance can be created by calling the createShape() method of the PhysxActor object that should own it, with a PhysxCapsuleShapeDesc object as the parameter, or by adding the shape descriptor into the PhysxActorDesc class before creating the actor.
The shape is deleted by calling release() on the shape itself.
Definition at line 46 of file physxCapsuleShape.h.
float PhysxCapsuleShape::get_height | ( | ) | const |
Retrieves the height of the capsule.
Definition at line 108 of file physxCapsuleShape.cxx.
float PhysxCapsuleShape::get_radius | ( | ) | const |
Retrieves the radius of the capsule.
Definition at line 96 of file physxCapsuleShape.cxx.
static void PhysxCapsuleShape::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from PhysxShape.
Definition at line 75 of file physxCapsuleShape.h.
References PhysxShape::init_type().
void PhysxCapsuleShape::save_to_desc | ( | PhysxCapsuleShapeDesc & | shapeDesc | ) | const |
Saves the state of the shape object to a descriptor.
Definition at line 60 of file physxCapsuleShape.cxx.
void PhysxCapsuleShape::set_height | ( | float | height | ) |
Alters the height of the capsule.
Definition at line 84 of file physxCapsuleShape.cxx.
void PhysxCapsuleShape::set_radius | ( | float | radius | ) |
Alters the radius of the capsule.
Definition at line 72 of file physxCapsuleShape.cxx.