42 NxCookingParams params;
44 params.targetPlatform = PLATFORM_PC;
45 params.skinWidth = skinWidth;
46 params.hintCollisionSpeed = hintCollisionSpeed;
48 _cooking->NxSetCookingParams(params);
57 nassertr_always(!filename.empty(),
false);
58 nassertr_always(filename.
touch(),
false);
59 nassertr_always(meshDesc.
is_valid(),
false);
62 return _cooking->NxCookConvexMesh(meshDesc.get_desc(), fs);
71 nassertr_always(!filename.empty(),
false);
72 nassertr_always(filename.
touch(),
false);
73 nassertr_always(meshDesc.
is_valid(),
false);
76 return _cooking->NxCookTriangleMesh(meshDesc.get_desc(), fs);
85 nassertr_always(!filename.empty(),
false);
86 nassertr_always(filename.
touch(),
false);
87 nassertr_always(meshDesc.
is_valid(),
false);
90 return _cooking->NxCookClothMesh(meshDesc.get_desc(), fs);
99 nassertr_always(!filename.empty(),
false);
100 nassertr_always(filename.
touch(),
false);
101 nassertr_always(meshDesc.
is_valid(),
false);
104 return _cooking->NxCookSoftBodyMesh(meshDesc.get_desc(), fs);
113 nassertr_always(!filename.empty(),
false);
114 nassertr_always(filename.
touch(),
false);
115 nassertr_always(meshDesc.
is_valid(),
false);
134 fs.storeDword(texcoords.size());
137 plist<LPoint2f>::const_iterator it;
138 for(it=texcoords.begin(); it!=texcoords.end(); it++) {
141 fs.storeFloat(v.get_x());
142 fs.storeFloat(v.get_y());
154 nassertr_always(meshDesc.
is_valid(),
nullptr);
157 bool status = _cooking->NxCookConvexMesh(meshDesc.get_desc(), buffer);
158 nassertr(status,
nullptr);
160 NxPhysicsSDK *sdk = NxGetPhysicsSDK();
161 nassertr(sdk,
nullptr);
164 nassertr(mesh,
nullptr);
167 nassertr(meshPtr,
nullptr);
180 nassertr_always(meshDesc.
is_valid(),
nullptr);
183 bool status = _cooking->NxCookTriangleMesh(meshDesc.get_desc(), buffer);
184 nassertr(status,
nullptr);
186 NxPhysicsSDK *sdk = NxGetPhysicsSDK();
187 nassertr(sdk,
nullptr);
190 nassertr(mesh,
nullptr);
193 nassertr(meshPtr,
nullptr);
206 nassertr_always(meshDesc.
is_valid(),
nullptr);
209 bool status = _cooking->NxCookClothMesh(meshDesc.get_desc(), wbuffer);
210 nassertr(status,
nullptr);
212 NxPhysicsSDK *sdk = NxGetPhysicsSDK();
213 nassertr(sdk,
nullptr);
216 nassertr(mesh,
nullptr);
219 NxClothMesh *meshPtr = sdk->createClothMesh(rbuffer);
220 nassertr(meshPtr,
nullptr);
233 nassertr_always(meshDesc.
is_valid(),
nullptr);
236 bool status = _cooking->NxCookSoftBodyMesh(meshDesc.get_desc(), wbuffer);
237 nassertr(status,
nullptr);
239 NxPhysicsSDK *sdk = NxGetPhysicsSDK();
240 nassertr(sdk,
nullptr);
243 nassertr(mesh,
nullptr);
246 NxSoftBodyMesh *meshPtr = sdk->createSoftBodyMesh(rbuffer);
247 nassertr(meshPtr,
nullptr);
bool is_valid() const
Returns true if the descriptor is valid.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL list.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool touch() const
Updates the modification time of the file to the current time.
The name of a file, such as a texture file or an Egg file.
bool is_valid() const
Returns true if the descriptor is valid.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_cooking_params(float skinWidth, bool hintCollisionSpeed)
Sets two parameters which affect mesh cooking:
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_valid() const
Returns true if the descriptor is valid.
bool is_valid() const
Returns true if the descriptor is valid.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.