Panda3D
|
A plane collision detection primitive. More...
#include "physxPlaneShape.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
void | link (NxShape *shapePtr) |
NxShape * | ptr () const |
void | save_to_desc (PhysxPlaneShapeDesc &shapeDesc) const |
Saves the state of the shape object to a descriptor. | |
void | set_plane (const LVector3f &normal, float d) |
Sets the plane equation. | |
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 plane collision detection primitive.
By default it is configured to be the y == 0 plane. You can then set a normal and a d to specify an arbitrary plane. d is the distance of the plane from the origin along the normal, assuming the normal is normalized. Thus the plane equation is: normal.x * X + normal.y * Y + normal.z * Z = d
Note: the plane does not represent an infinitely thin object, but rather a completely solid negative half space (all points p for which normal.dot(p) - d < 0 are inside the solid region.)
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 PhysxPlaneShapeDesc 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 54 of file physxPlaneShape.h.
static void PhysxPlaneShape::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 79 of file physxPlaneShape.h.
References PhysxShape::init_type().
void PhysxPlaneShape::save_to_desc | ( | PhysxPlaneShapeDesc & | shapeDesc | ) | const |
Saves the state of the shape object to a descriptor.
Definition at line 61 of file physxPlaneShape.cxx.
void PhysxPlaneShape::set_plane | ( | const LVector3f & | normal, |
float | d | ||
) |
Sets the plane equation.
Definition at line 77 of file physxPlaneShape.cxx.
References PhysxManager::vec3_to_nxVec3().