24 _name = name ? name :
"";
25 ptr()->name = _name.c_str();
37 ptr()->shapeFlags |= NX_TRIGGER_ENABLE;
40 ptr()->shapeFlags &= ~(NX_TRIGGER_ENABLE);
48 set_local_pos(
const LPoint3f &pos) {
50 nassertv(!pos.is_nan());
58 set_local_mat(
const LMatrix4f &mat) {
60 nassertv(!mat.is_nan());
68 set_local_hpr(
float h,
float p,
float r) {
74 q.set_hpr(LVector3f(h, p, r));
75 q.extract_to_matrix(rot);
99 nassertv(skinWidth >= 0.0f);
100 ptr()->skinWidth = skinWidth;
106 void PhysxShapeDesc::
107 set_shape_flag(
const PhysxShapeFlag flag,
bool value) {
110 ptr()->shapeFlags |= flag;
113 ptr()->shapeFlags &= ~(flag);
139 nassertv(density > 0.0f);
140 ptr()->density = density;
146 void PhysxShapeDesc::
147 set_group(
unsigned short group) {
149 ptr()->group = group;
155 const char *PhysxShapeDesc::
164 LPoint3f PhysxShapeDesc::
165 get_local_pos()
const {
173 LMatrix4f PhysxShapeDesc::
174 get_local_mat()
const {
182 float PhysxShapeDesc::
183 get_skin_width()
const {
185 return ptr()->skinWidth;
191 bool PhysxShapeDesc::
192 get_shape_flag(
const PhysxShapeFlag flag)
const {
194 return (ptr()->shapeFlags & flag) ? true :
false;
200 float PhysxShapeDesc::
209 float PhysxShapeDesc::
210 get_density()
const {
212 return ptr()->density;
218 unsigned short PhysxShapeDesc::
227 void PhysxShapeDesc::
230 ptr()->materialIndex = material.ptr()->getMaterialIndex();
236 void PhysxShapeDesc::
237 set_material_index(
unsigned short index) {
239 ptr()->materialIndex = index;
245 unsigned short PhysxShapeDesc::
246 get_material_index()
const {
248 return ptr()->materialIndex;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class for describing a shape's surface properties.
static NxMat34 mat4_to_nxMat34(const LMatrix4f &m)
Converts from LMatrix4f to NxMat34.
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_trigger(bool value)
This shape will become a trigger shape if this parameter is set to TRUE.
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.
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.