CCDSkeleton of Sphere?

byte_wrench

19-06-2007 21:17:01

Is is possible to generate a ccdskeleton for a sphere? If so, does anyone have any tips? - thank you

betajaen

19-06-2007 21:29:00

A CCDSkeleton of a sphere is a sphere. ;)

byte_wrench

19-06-2007 21:44:18

Hey, let me join the masses by saying thank you for your work! Sorry for posting a dumb question, I just need to do my homework i guess :)

betajaen

19-06-2007 21:48:07

It's not really a dumb question. The CCD Skeleton of a Cube is a Convex shape, funnily enough.

byte_wrench

19-06-2007 21:53:28

The reason I was wanting to use CCD is that with my past experience using physics engines (mainly ODE) that penetration is a bad problem, yet the ccd really seems to help alot. I have a ball that I still want to have the appearance of rolling. Right now, I have a cube ccd on the sphere. It works pretty well. I guess I could env map it and hide the fact that it is sliding, I really dont know, maybe a sphere skeleton would be too much?

betajaen

19-06-2007 22:12:25

Go for it. It's just a radius check. A lot faster than what a Cube/Convex Shape would be

byte_wrench

20-06-2007 19:33:43

I have looked al over the place, and tried every way I could find to get the mesh from an actor into a ccd skeleton. Everywhere i look, it is always cubes! Please help!
I am trying to do this:

NxCCDSkeleton * createCCDfromActor ( NxActor * newActor )
{
assert(newActor->getNbShapes() == 1);
NxShape * const * grabShapes = newActor->getShapes();

// use a couple of casts to get the pointer I need
NxShape * grabShape = const_cast<NxShape *>(grabShapes[0]);
NxConvexShape * grabConvex = (NxConvexShape * )grabShape;
NxConvexMesh * grabMesh = & grabConvex->getConvexMesh();

// Turn the mesh into a descriptor to read the details
NxConvexMeshDesc meshDesc;
grabMesh->saveToDesc(meshDesc);
NxSimpleTriangleMesh stm;

stm.numVertices = meshDesc.numVertices;
stm.numTriangles = meshDesc.numTriangles;
stm.pointStrideBytes = sizeof(NxVec3);
stm.triangleStrideBytes = sizeof(NxU32) * 3;

stm.points = meshDesc.points;
stm.triangles = meshDesc.triangles;
stm.flags |= NX_MF_FLIPNORMALS; // if you need.
return mWorld->mPhysicsSDK->createCCDSkeleton(stm);
}


passing in a body->actor created using the sphereShape. It cracks on the saveToDesc() call. Has anyone reading this made a ccd sphere? If so, How??

Thanks guys..
ej

Aiursrage2k

21-06-2007 17:33:24

From the Ageia documentation.

Limitations
64 vertex limit on CCD skeletons.
Skeletons limited to 256 edges.

Dynamic vs. static does not work when the static shape is an NxSphereShape, NxCapsuleShape, NxPlaneShape, etc. These shapes are not used for static geometry in many games and it would require significant work to support them since they are not polygon based shapes (the CCD algorithm works with meshes).
If the geometry of the static mesh is very complex and high detail (not common in a typical game), the dynamic object may get stuck on its surface after the collision due to conflicting contact points. Minimize this effect by reducing the penaltyZoneThickness, but depending on the mesh, it may not be fully resolved.
The dynamic vs. dynamic CCD uses an approximation which assumes one shape is rotating much faster than the other. If both shapes in a pair are rotating very quickly, the approximation may break down (causing unrealistic results).
The CCD code assumes shapes will not rotate by more than 180 degrees in a time step.
CCD works by limiting the motion of objects. When an interpenetration is detected, the objects are stopped dead, even if it is halfway through a time step. This may make objects appear to hang in mid air for one frame, etc.

Triggers do not take part in CCD.
Be very careful with assigning CCD skeletons only to some of a dynamic actor's shapes. There is the risk of a non-CCD shape penetrating another object before a CCD shape arrests the motion, leading to the actor getting stuck in penetration. Only create such actors if you can in some way insure that this will not occur.
Kinematic objects are never halted by CCD and so using CCD for fast-moving kinematic bodies has no effect. (This only applies when it's the kinematic object that is fast-moving, fast-moving dynamic CCD objects are halted by kinematic ones as usual.)
CCD does not work with restricted hardware scenes


I think you are you going to have to use a box, or some really simple sphere type shape.

byte_wrench

24-06-2007 01:31:55

Thanks for that info, sorry it took so long for my reply, I was in the mountains with no inet :). I will keep plugging away!