20 #include "physphere.h"
21 #include "private/phyobjectprivate.h"
22 #include "private/worldprivate.h"
29 w->pushObject(
this );
35 #ifdef WORLDSIM_USE_NEWTON
41 #ifdef WORLDSIM_USE_NEWTON
42 NewtonCollision* c = NewtonCreateSphere( worldpriv->world, radiusv, radiusv, radiusv, 1, 0 );
44 priv->body = NewtonCreateBody( worldpriv->world, c, &initialTransformationMatrix[0][0] );
45 priv->collision = NewtonBodyGetCollision(
priv->body );
47 NewtonBodySetAutoSleep(
priv->body, 0 );
49 NewtonBodySetUserData(
priv->body,
this );
50 NewtonBodySetLinearDamping(
priv->body, 0.0 );
52 NewtonBodySetAngularDamping(
priv->body, &zero[0] );
53 NewtonBodySetAutoSleep(
priv->body, 0 );
54 NewtonBodySetFreezeState(
priv->body, 0 );
56 NewtonBodySetTransformCallback(
priv->body, (PhyObjectPrivate::setTransformHandler) );
57 NewtonBodySetForceAndTorqueCallback(
priv->body, (PhyObjectPrivate::applyForceAndTorqueHandler) );
static wMatrix identity()
create an identity matrix
void setMass(real)
Set the mass without touching the Inertia data.
void createPrivateObject()
Engine encapsulation.
PhyObjectPrivate * priv
Engine encapsulation.
real radius() const
return the radius
virtual ~PhySphere()
Destroy this object.
PhySphere(real radius, World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity())
Create a physics sphere object and insert it in the world passed.
virtual void changedMatrix()
syncronize this object with underlying physic object