Here is my solution
Yes, I took your suggestion. Thanks for your help.
Body class is same as yours
* @author Paul Speed
*/
public class Body {
public final EntityId bodyId;
public Vec3d pos = new Vec3d();
public Vec3d velocity = new Vec3d();
public Vec3d acceleration = new Vec3d();
public double radius = 1;
public double invMass = 1;
public AaBBox bounds = new AaBBox(radius);
public Quatd orientation = new Quatd();
public volatile ControlDriver driver;
public Body( EntityId bodyId ) {
this.bodyId = bodyId;
this.bounds = new AaBBox(radius);
}
public Body( EntityId bodyId, double x, double y, double z ) {
this.bodyId = bodyId;
this.pos.set(x, y, z);
}
public void setPosition( Vec3d position ) {
this.pos.set(position);
}
public void setRotation( Quatd rotation ) {
this.orientation.set(rotation);
}
public void integrate( double stepTime ) {
// Update the bounds since it's easy to do here and helps
// other things know where the object is for real
bounds.setCenter(pos);
}
}
Are you effectively keeping a physics-only set of spatials?
Only if we want some kind of mesh accurate collision shapes.
No needs for primitive ones.