moagames
13-04-2008 18:05:42
Hi,
I need to make a Convex mesh from a list of vertices.
Is there any way to make this ?
Is there any way to make it at least with a TriangleMeshShape ?
Thank you very much
moagames
13-04-2008 18:12:02
thanx for the fast reply, but i don't meen the Ogre stuff, but the physics stuff, so if i have 8 points of a box and want to make a physics object of that.
How can i do that ?
betajaen
13-04-2008 18:44:49
moagames
13-04-2008 18:59:15
That sounds very interesting, but i am still using 0.9 becaus i need characters.
So is there any way to make something similiar with 0.9 ??
thank you very much for your support
NickM
13-04-2008 21:05:28
I'm sure in the past I've done this?
Is this something like what you want...
NxConvexMeshDesc convexDesc;
convexDesc.numVertices = metalBody->metalMeshVertexCount;
convexDesc.pointStrideBytes = sizeof(NxVec3);
convexDesc.points = collisionShapeVerts;
convexDesc.flags = NX_CF_COMPUTE_CONVEX;//, NX_SF_POINT_CONTACT_FORCE;
static NxCookingInterface *gCooking = NxGetCookingLib(NX_PHYSICS_SDK_VERSION);
//Make sure to initialize the cooking library.
gCooking->NxInitCooking();
NxOgre::NxString filename;
filename = modelOfCar + "collision_model.nxs";
UserStream buf(filename.c_str(),false);
bool status = NxCookConvexMesh(convexDesc, buf);
if(!status){
GameManager::getSingletonPtr()->throwErrorMessage(filename + "failed to cook properly");
}
fclose(buf.fp);
convex = new NxOgre::ConvexShape(filename, "material: CarBodyMaterial");
betajaen
13-04-2008 21:22:00
Well yes, you can do that. But ManualMesh is much easier and more "NxOgrey" than that PhysX code there.