convexShape question

NickM

19-11-2007 07:08:24

Hi, I used to be able to do this in an earlier version of nxOgre but is it still possible or will it be possible in the future to do it with the newer versions?...

shapeGroup* carShape = new shapeGroup();

//Plotting the convex shape verts for the collision model

std::vector<Vector3> verts;
verts.push_back(Vector3(0.9,-0.,2.8)); //+left,+up,+forward
verts.push_back(Vector3(0.9,0.85,2.8));
verts.push_back(Vector3(0.9,0.85,1.2));
verts.push_back(Vector3(0.9,1.4,0.5));
verts.push_back(Vector3(0.9,1.4,-1.2));
verts.push_back(Vector3(0.9,0.85,-1.75));
verts.push_back(Vector3(0.9,0.85,-2.8));
verts.push_back(Vector3(0.9,-0.,-2.8));
verts.push_back(Vector3(-0.9,-0.,2.8));
verts.push_back(Vector3(-0.9,0.85,2.8));
verts.push_back(Vector3(-0.9,0.85,1.2));
verts.push_back(Vector3(-0.9,1.4,0.5));
verts.push_back(Vector3(-0.9,1.4,-1.2));
verts.push_back(Vector3(-0.9,0.85,-1.75));
verts.push_back(Vector3(-0.9,0.85,-2.8));
verts.push_back(Vector3(-0.9,-0.,-2.8));

//Create the Convex shape, using the vertices and car body material as arguments.
carShape->addShape(new convexShape(verts,CarBodyMaterial));


Many thanks
Nick.

NickM

19-11-2007 19:19:53

I had to cut my previous post slightly short as I had lost track of time and realised I should have already left for work!

In my game I'm trying to impliment my own custom way of damaging the body work of my vehicle but I need to be able to create my collision shape from a list of vertices, is this possible with NxOgre version 0.9?

betajaen

19-11-2007 19:57:30

I believe you can now.

If the worst thing comes to worst you could quickly create an Ogre mesh with those coordinates, or implement your own ConvexShape class in NxOgre.

Otherwise you can wait until I've finished the ResourceSystem which has what you want.

NickM

20-11-2007 06:43:02

Thanks for taking the time to reply betajaen, I'll have a think about which route is going to be best for me to take, I'm not being pushy, it'll just help me decide on my next step but is there any timescale on when the resource system will be ready?