15 #include "physxClothDesc.h" 16 #include "physxClothMesh.h" 17 #include "physxManager.h" 25 set_name(
const char *name) {
27 _name = name ? name :
"";
28 _desc.name = _name.c_str();
37 set_global_pos(
const LPoint3f &pos) {
59 set_global_hpr(
float h,
float p,
float r) {
77 set_thickness(
float thickness) {
79 _desc.thickness = thickness;
88 set_density(
float density) {
90 _desc.density = density;
99 set_bending_stiffness(
float stiffness) {
101 _desc.bendingStiffness = stiffness;
109 void PhysxClothDesc::
110 set_stretching_stiffness(
float stiffness) {
112 _desc.stretchingStiffness = stiffness;
120 void PhysxClothDesc::
121 set_damping_coefficient(
float damping) {
123 _desc.dampingCoefficient = damping;
131 void PhysxClothDesc::
132 set_friction(
float friction) {
134 _desc.friction = friction;
142 void PhysxClothDesc::
143 set_pressure(
float pressure) {
145 _desc.pressure = pressure;
153 void PhysxClothDesc::
154 set_tear_factor(
float tearFactor) {
156 _desc.tearFactor = tearFactor;
171 _desc.flags &= ~(flag);
185 _desc.solverIterations = iterations;
193 void PhysxClothDesc::
196 _desc.clothMesh = mesh->ptr();
204 const char *PhysxClothDesc::
216 get_global_pos()
const {
227 get_global_mat()
const {
237 float PhysxClothDesc::
238 get_thickness()
const {
240 return _desc.thickness;
248 float PhysxClothDesc::
249 get_density()
const {
251 return _desc.density;
259 float PhysxClothDesc::
260 get_bending_stiffness()
const {
262 return _desc.bendingStiffness;
270 float PhysxClothDesc::
271 get_stretching_stiffness()
const {
273 return _desc.stretchingStiffness;
281 float PhysxClothDesc::
282 get_damping_coefficient()
const {
284 return _desc.dampingCoefficient;
292 float PhysxClothDesc::
293 get_friction()
const {
295 return _desc.friction;
303 float PhysxClothDesc::
304 get_pressure()
const {
306 return _desc.pressure;
314 float PhysxClothDesc::
315 get_tear_factor()
const {
317 return _desc.tearFactor;
325 bool PhysxClothDesc::
326 get_flag(PhysxClothFlag flag)
const {
328 return (_desc.flags & flag) ? true :
false;
336 unsigned int PhysxClothDesc::
337 get_solver_iterations()
const {
339 return _desc.solverIterations;
344 // Function: PhysxClothDesc::get_mesh_numbers
346 // Description: Used by PhysScene to query the sizes of arrays
347 // to allocate for the user buffers in PhysxClothNode.
349 void PhysxClothDesc::
350 get_mesh_numbers(NxU32 &numVertices, NxU32 &numTriangles) {
352 NxClothMeshDesc meshDesc;
353 _desc.clothMesh->saveToDesc(meshDesc);
355 numVertices = meshDesc.numVertices;
356 numTriangles = meshDesc.numTriangles;
void set_solver_iterations(unsigned int interations)
Number of solver iterations.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
void extract_to_matrix(LMatrix3f &m) const
Based on the quat lib from VRPN.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
static NxMat34 mat4_to_nxMat34(const LMatrix4f &m)
Converts from LMatrix4f to NxMat34.
This is a 4-by-4 transform matrix.
static NxMat33 mat3_to_nxMat33(const LMatrix3f &m)
Converts from LMatrix3f to NxMat33.
void set_flag(PhysxClothFlag flag, bool value)
Raise or lower individual ClothFlag flags.
void set_hpr(const LVecBase3f &hpr, CoordinateSystem cs=CS_default)
Sets the quaternion as the unit quaternion that is equivalent to these Euler angles.
This is the base quaternion class.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
This is a 3-by-3 transform matrix.
static LMatrix4f nxMat34_to_mat4(const NxMat34 &m)
Converts from NxMat34 to LMatrix4f.