15 #include "physxShapeDesc.h"
16 #include "physxManager.h"
17 #include "physxMaterial.h"
27 _name = name ? name :
"";
28 ptr()->name = _name.c_str();
43 ptr()->shapeFlags |= NX_TRIGGER_ENABLE;
46 ptr()->shapeFlags &= ~(NX_TRIGGER_ENABLE);
80 set_local_hpr(
float h,
float p,
float r) {
117 nassertv(skinWidth >= 0.0f);
118 ptr()->skinWidth = skinWidth;
126 void PhysxShapeDesc::
127 set_shape_flag(
const PhysxShapeFlag flag,
bool value) {
130 ptr()->shapeFlags |= flag;
133 ptr()->shapeFlags &= ~(flag);
166 nassertv(density > 0.0f);
167 ptr()->density = density;
175 void PhysxShapeDesc::
176 set_group(
unsigned short group) {
178 ptr()->group = group;
186 const char *PhysxShapeDesc::
198 get_local_pos()
const {
209 get_local_mat()
const {
219 float PhysxShapeDesc::
220 get_skin_width()
const {
222 return ptr()->skinWidth;
230 bool PhysxShapeDesc::
231 get_shape_flag(
const PhysxShapeFlag flag)
const {
233 return (ptr()->shapeFlags & flag) ?
true :
false;
241 float PhysxShapeDesc::
252 float PhysxShapeDesc::
253 get_density()
const {
255 return ptr()->density;
263 unsigned short PhysxShapeDesc::
274 void PhysxShapeDesc::
277 ptr()->materialIndex = material.ptr()->getMaterialIndex();
285 void PhysxShapeDesc::
286 set_material_index(
unsigned short index) {
288 ptr()->materialIndex = index;
296 unsigned short PhysxShapeDesc::
297 get_material_index()
const {
299 return ptr()->materialIndex;
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
void extract_to_matrix(LMatrix3f &m) const
Based on the quat lib from VRPN.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
A class for describing a shape's surface properties.
static NxMat34 mat4_to_nxMat34(const LMatrix4f &m)
Converts from LMatrix4f to NxMat34.
This is a 4-by-4 transform matrix.
void set_density(float density)
Sets the density of this individual shape when computing mass inertial properties for a rigidbody (un...
static NxMat33 mat3_to_nxMat33(const LMatrix3f &m)
Converts from LMatrix3f to NxMat33.
void set_hpr(const LVecBase3f &hpr, CoordinateSystem cs=CS_default)
Sets the quaternion as the unit quaternion that is equivalent to these Euler angles.
void set_trigger(bool value)
This shape will become a trigger shape if this parameter is set to TRUE.
This is the base quaternion class.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
void set_mass(float mass)
Sets the mass of this individual shape when computing mass inertial properties for a rigidbody...
void set_name(const char *name)
Sets a possible debug name.
This is a 3-by-3 transform matrix.
static LMatrix4f nxMat34_to_mat4(const NxMat34 &m)
Converts from NxMat34 to LMatrix4f.
void set_skin_width(float skinWidth)
Specifies by how much shapes can interpenetrate.
bool is_nan() const
Returns true if any component of the matrix is not-a-number, false otherwise.