I need an infinite collision plane ( a "floor" for my scene ) which will be a tangent to a sphere with its origin in 3D space. My set up is a whole-earth visual system in real size, and I want to model a local scene, so for all practical intents and purposes, an infinite plane located on the sphere will do. My gravity vector always points to the centre of the sphere, so however the plane is oriented, the gravity always points "down", inverse normal to the sphere.
This means, I need to specify an orientation vector (normal to the plane), and an offset of R, radius of the sphere. It does NOT need to have a visual component - my objects just need to bounce off it.
What's the best way to build this? I looked into NewtonCreateHeightFieldCollision, but creating the whole flat height field seems a bit of an overkill. I've also looked at
- Code: Select all
NewtonCollision* CreateInfinitePlane (NewtonWorld* const world, const dVector& planeEquation)
{
dInfinitePlane* const planeCollision = new dInfinitePlane (world, planeEquation);
return planeCollision->m_collision;
}
It seems to me this could work: plane equation "orients" the plane, all I'd have to add is the placement of it...