//******************************************************************** // Newton Game dynamics // copyright 2000-2004 // By Julio Jerez // VC: 6.0 // One and only header file. //******************************************************************** module Newton; extern (C) { align(1): struct NewtonBody{} ; struct NewtonWorld{ } ; struct NewtonJoint{} ; struct NewtonContact{} ; struct NewtonMaterial{} ; struct NewtonCollision{} ; struct NewtonRagDoll{} ; struct NewtonRagDollBone{} ; struct NewtonUserMeshCollisionCollideDesc { float m_boxP0[4]; // lower bounding box of intersection query in local space float m_boxP1[4]; // upper bounding box of intersection query in local space void* m_userData; // user data passed to the collison geometry at creation time int m_faceCount; // the applycation should set here how many polygons inteset the query float* m_vertex; // the applycation should the pointer to the vertex array. int m_vertexStrideInBytes; // the applycation should set here the size of each vertex int* m_userAttribute; // the applycation should set here the pointer to the user data, one for each face int* m_faceIndexCount; // the applycation should set here the pointer to the vertex count of each face. int* m_faceVertexIndex; // the applycation should set here the pointer index array for each vertex on a face. NewtonBody* m_objBody; // pointer to the colliding body NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree } ; struct NewtonUserMeshCollisionRayHitDesc { float m_p0[4]; // ray origin in collision local space float m_p1[4]; // ray destination in collision local space float m_normalOut[4]; // copy here the normal at the rat intesection int m_userIdOut; // copy here a user defined id for further feedback void* m_userData; // user data passed to the collison geometry at creation time } ; struct NewtonHingeSliderUpdateDesc { float m_accel; float m_minFriction; float m_maxFriction; float m_timestep; } ; // Newton callback functions typedef void* function(int sizeInBytes) NewtonAllocMemory; typedef void function(void *ptr, int sizeInBytes) NewtonFreeMemory; alias void function(void* serializeHandle, void* buffer, size_t size) NewtonSerialize; alias void function(void* serializeHandle, void* buffer, size_t size) NewtonDeserialize; alias void function(NewtonUserMeshCollisionCollideDesc* collideDescData) NewtonUserMeshCollisionCollideCallback; alias float function(NewtonUserMeshCollisionRayHitDesc* lineDescData) NewtonUserMeshCollisionRayHitCallback; alias void function (void* descData) NewtonUserMeshCollisionDestroyCallback; alias void function(NewtonBody* bodyWithTreeCollision, NewtonBody* _body , float* vertex, int vertexstrideInBytes, int indexCount, int* indexArray) NewtonTreeCollisionCallback; alias void function (NewtonBody* _body) NewtonBodyDestructor; alias void function (NewtonBody* _body) NewtonApplyForceAndTorque; alias void function (NewtonBody* _body, uint state) NewtonBodyActivationState; alias void function (NewtonBody* _body, float* matrix) NewtonSetTransform; alias void function (NewtonRagDollBone* bone) NewtonSetRagDollTransform; alias void function (void *context, float* globalSpaceMatrix, float* globalSpacePlane) NewtonGetBuoyancyPlane; alias void function (NewtonJoint* vehicle) NewtonVehicleTireUpdate; alias float function (NewtonBody* _body, float* hitNormal, int collisionID, void* userData, float intersetParam) NewtonWorldRayFilterCallback; alias void function(NewtonBody* _body) NewtonBodyLeaveWorld; alias int function ( NewtonMaterial* material, NewtonBody* body0, NewtonBody* body1) NewtonContactBegin; alias int function ( NewtonMaterial* material, NewtonContact* contact) NewtonContactProcess; alias void function (NewtonMaterial* material) NewtonContactEnd; alias void function (NewtonBody* _body) NewtonBodyIterator; alias void function(NewtonBody* _body, int vertexCount, float* FaceArray, int faceId) NewtonCollisionIterator; alias void function (NewtonJoint* ball) NewtonBallCallBack; alias uint function (NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc) NewtonHingeCallBack; alias uint function (NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc) NewtonSliderCallBack; alias uint function (NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc) NewtonUniversalCallBack; alias uint function (NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc) NewtonCorkscrewCallBack; alias void function (NewtonJoint* userJoint) NewtonUserBilateralCallBack; alias void function (NewtonJoint* me) NewtonConstraintDestructor; // ********************************************************************************************** // // world control functions // // ********************************************************************************************** NewtonWorld* NewtonCreate (NewtonAllocMemory malloc, NewtonFreeMemory mfree); void NewtonDestroy (NewtonWorld* newtonWorld); void NewtonDestroyAllBodies (NewtonWorld* newtonWorld); void NewtonUpdate (NewtonWorld* newtonWorld, float timestep); void NewtonSetSolverModel (NewtonWorld* newtonWorld, int model); void NewtonSetFrictionModel (NewtonWorld* newtonWorld, int model); float NewtonGetTimeStep (NewtonWorld* newtonWorld); void NewtonSetMinimumFrameRate (NewtonWorld* newtonWorld, float frameRate); void NewtonSetBodyLeaveWorldEvent (NewtonWorld* newtonWorld, NewtonBodyLeaveWorld callback); void NewtonSetWorldSize (NewtonWorld* newtonWorld, float* minPoint, float* maxPoint); void NewtonWorldFreezeBody (NewtonWorld* newtonWorld, NewtonBody* _body ); void NewtonWorldUnfreezeBody (NewtonWorld* newtonWorld, NewtonBody* _body ); void NewtonWorldForEachBodyDo (NewtonWorld* newtonWorld, NewtonBodyIterator callback); void NewtonWorldSetUserData (NewtonWorld* newtonWorld, void* userData); void* NewtonWorldGetUserData (NewtonWorld* newtonWorld); int NewtonWorldGetVersion (NewtonWorld* newtonWorld); void NewtonWorldRayCast (NewtonWorld* newtonWorld, float* p0, float* p1, NewtonWorldRayFilterCallback filter, void* userData); int NewtonWorldCollide (NewtonWorld* newtonWorld, int maxSize, NewtonCollision* collsionA, float* matrixA, NewtonCollision* collsionB, float* matrixB, float* contacts, float* normals, float* penetration); // world utility functions // int NewtonGetBodiesCount(); // int NewtonGetActiveBodiesCount(); // int NewtonGetActiveConstraintsCount(); // float NewtonGetGlobalScale (NewtonWorld* newtonWorld); // ********************************************************************************************** // // Physics Material Section // // ********************************************************************************************** int NewtonMaterialGetDefaultGroupID(NewtonWorld* newtonWorld); int NewtonMaterialCreateGroupID(NewtonWorld* newtonWorld); void NewtonMaterialDestroyAllGroupID(NewtonWorld* newtonWorld); void NewtonMaterialSetDefaultSoftness (NewtonWorld* newtonWorld, int id0, int id1, float value); void NewtonMaterialSetDefaultElasticity (NewtonWorld* newtonWorld, int id0, int id1, float elasticCoef); void NewtonMaterialSetDefaultCollidable (NewtonWorld* newtonWorld, int id0, int id1, int state); void NewtonMaterialSetDefaultFriction (NewtonWorld* newtonWorld, int id0, int id1, float staticFriction, float kineticFriction); void NewtonMaterialSetCollisionCallback (NewtonWorld* newtonWorld, int id0, int id1, void* userData, NewtonContactBegin begin, NewtonContactProcess process, NewtonContactEnd end); void* NewtonMaterialGetUserData (NewtonWorld* newtonWorld, int id0, int id1); // ********************************************************************************************** // // Physics Contact control functions // // ********************************************************************************************** void NewtonMaterialDisableContact (NewtonMaterial* material); float NewtonMaterialGetCurrentTimestep (NewtonMaterial* material); void *NewtonMaterialGetMaterialPairUserData (NewtonMaterial* material); uint NewtonMaterialGetContactFaceAttribute (NewtonMaterial* material); uint NewtonMaterialGetBodyCollisionID (NewtonMaterial* material, NewtonBody* _body ); float NewtonMaterialGetContactNormalSpeed (NewtonMaterial* material, NewtonContact* contactlHandle); void NewtonMaterialGetContactForce (NewtonMaterial* material, float* force); void NewtonMaterialGetContactPositionAndNormal (NewtonMaterial* material, float* posit, float* normal); void NewtonMaterialGetContactTangentDirections (NewtonMaterial* material, float* dir0, float* dir); float NewtonMaterialGetContactTangentSpeed (NewtonMaterial* material, NewtonContact* contactlHandle, int index); void NewtonMaterialSetContactSoftness (NewtonMaterial* material, float softness); void NewtonMaterialSetContactElasticity (NewtonMaterial* material, float restitution); void NewtonMaterialSetContactFrictionState (NewtonMaterial* material, int state, int index); void NewtonMaterialSetContactStaticFrictionCoef (NewtonMaterial* material, float coef, int index); void NewtonMaterialSetContactKineticFrictionCoef (NewtonMaterial* material, float coef, int index); void NewtonMaterialSetContactTangentAcceleration (NewtonMaterial* material, float accel, int index); void NewtonMaterialContactRotateTangentDirections (NewtonMaterial* material, float* directionVector); // ********************************************************************************************** // // convex collision primitives creation functions // // ********************************************************************************************** NewtonCollision* NewtonCreateNull (NewtonWorld* newtonWorld); NewtonCollision* NewtonCreateSphere (NewtonWorld* newtonWorld, float radiusX, float radiusY, float radiusZ, float *offsetMatrix); NewtonCollision* NewtonCreateBox (NewtonWorld* newtonWorld, float dx, float dy, float dz, float *offsetMatrix); NewtonCollision* NewtonCreateCone (NewtonWorld* newtonWorld, float radius, float height, float *offsetMatrix); NewtonCollision* NewtonCreateCapsule (NewtonWorld* newtonWorld, float radius, float height, float *offsetMatrix); NewtonCollision* NewtonCreateCylinder (NewtonWorld* newtonWorld, float radius, float height, float *offsetMatrix); NewtonCollision* NewtonCreateChamferCylinder (NewtonWorld* newtonWorld, float radius, float height, float *offsetMatrix); NewtonCollision* NewtonCreateConvexHull (NewtonWorld* newtonWorld, int count, float* vertexCloud, int strideInBytes, float *offsetMatrix); NewtonCollision* NewtonCreateConvexHullModifier (NewtonWorld* newtonWorld, NewtonCollision* convexHullCollision); void NewtonConvexHullModifierGetMatrix (NewtonCollision* convexHullCollision, float* matrix); void NewtonConvexHullModifierSetMatrix (NewtonCollision* convexHullCollision, float* matrix); void NewtonConvexCollisionSetUserID (NewtonCollision* convexCollision, uint id); uint NewtonConvexCollisionGetUserID (NewtonCollision* convexCollision); // ********************************************************************************************** // // complex collision primitives creation functions // note: can only be used with static bodies (bodies with infinite mass) // // ********************************************************************************************** NewtonCollision* NewtonCreateCompoundCollision (NewtonWorld* newtonWorld, int count, NewtonCollision* collisionPrimitiveArray[]); NewtonCollision* NewtonCreateUserMeshCollision (NewtonWorld* newtonWorld, float *minBox, float *maxBox, void *userData, NewtonUserMeshCollisionCollideCallback collideCallback, NewtonUserMeshCollisionRayHitCallback rayHitCallback, NewtonUserMeshCollisionDestroyCallback destroyCallback); // ********************************************************************************************** // // CollisionTree Utility functions // // ********************************************************************************************** NewtonCollision* NewtonCreateTreeCollision (NewtonWorld* newtonWorld, NewtonTreeCollisionCallback userCallback); void NewtonTreeCollisionBeginBuild (NewtonCollision* treeCollision); void NewtonTreeCollisionAddFace (NewtonCollision* treeCollision, int vertexCount, float* vertexPtr, int strideInBytes, int faceAttribute); void NewtonTreeCollisionEndBuild (NewtonCollision* treeCollision, int optimize); void NewtonTreeCollisionSerialize (NewtonCollision* treeCollision, NewtonSerialize serializeFunction, void* serializeHandle); NewtonCollision* NewtonCreateTreeCollisionFromSerialization (NewtonWorld* newtonWorld, NewtonTreeCollisionCallback userCallback, NewtonDeserialize deserializeFunction, void* serializeHandle); int NewtonTreeCollisionGetFaceAtribute (NewtonCollision* treeCollision, int* faceIndexArray); void NewtonTreeCollisionSetFaceAtribute (NewtonCollision* treeCollision, int* faceIndexArray, int attribute); // ********************************************************************************************** // // Collision Miscelaneos function // // ********************************************************************************************** void NewtonReleaseCollision (NewtonWorld* newtonWorld, NewtonCollision* collision); void NewtonCollisionCalculateAABB (NewtonCollision* collision, float *matrix, float* p0, float* p1); float NewtonCollisionRayCast (NewtonCollision* collision, float* p0, float* p1, float* normals, int* attribute); // ********************************************************************************************** // // transforms utility functions // // ********************************************************************************************** void NewtonGetEulerAngle (float* matrix, float* eulersAngles); void NewtonSetEulerAngle (float* eulersAngles, float* matrix); // ********************************************************************************************** // // body manipulation functions // // ********************************************************************************************** NewtonBody* NewtonCreateBody (NewtonWorld* newtonWorld, NewtonCollision* collision); void NewtonDestroyBody(NewtonWorld* newtonWorld, NewtonBody* _body ); void NewtonBodyAddForce (NewtonBody* _body , float* force); void NewtonBodyAddTorque (NewtonBody* _body , float* torque); void NewtonBodySetMatrix (NewtonBody* _body , float* matrix); void NewtonBodySetMatrixRecursive (NewtonBody* _body , float* matrix); void NewtonBodySetMassMatrix (NewtonBody* _body , float mass, float Ixx, float Iyy, float Izz); void NewtonBodySetMaterialGroupID (NewtonBody* _body , int id); void NewtonBodySetContinuousCollisionMode (NewtonBody* _body , uint state); void NewtonBodySetJointRecursiveCollision (NewtonBody* _body , uint state); void NewtonBodySetOmega (NewtonBody* _body , float* omega); void NewtonBodySetVelocity (NewtonBody* _body , float* velocity); void NewtonBodySetForce (NewtonBody* _body , float* force); void NewtonBodySetTorque (NewtonBody* _body , float* torque); void NewtonBodySetLinearDamping (NewtonBody* _body , float linearDamp); void NewtonBodySetAngularDamping (NewtonBody* _body , float* angularDamp); void NewtonBodySetUserData (NewtonBody* _body , void* userData); void NewtonBodyCoriolisForcesMode (NewtonBody* _body , int mode); void NewtonBodySetCollision (NewtonBody* _body , NewtonCollision* collision); void NewtonBodySetAutoFreeze (NewtonBody* _body , int state); void NewtonBodySetFreezeTreshold (NewtonBody* _body , float freezeSpeed2, float freezeOmega2, int framesCount); void NewtonBodySetTransformCallback (NewtonBody* _body , NewtonSetTransform callback); void NewtonBodySetDestructorCallback (NewtonBody* _body , NewtonBodyDestructor callback); void NewtonBodySetAutoactiveCallback (NewtonBody* _body , NewtonBodyActivationState callback); void NewtonBodySetForceAndTorqueCallback (NewtonBody* _body , NewtonApplyForceAndTorque callback); NewtonWorld* NewtonBodyGetWorld (NewtonBody* _body ); void* NewtonBodyGetUserData (NewtonBody* _body ); NewtonCollision* NewtonBodyGetCollision (NewtonBody* _body ); int NewtonBodyGetMaterialGroupID (NewtonBody* _body ); int NewtonBodyGetContinuousCollisionMode (NewtonBody* _body ); int NewtonBodyGetJointRecursiveCollision (NewtonBody* _body ); void NewtonBodyGetMatrix(NewtonBody* _body , float* matrix); void NewtonBodyGetMassMatrix (NewtonBody* _body , float* mass, float* Ixx, float* Iyy, float* Izz); void NewtonBodyGetInvMass(NewtonBody* _body , float* invMass, float* invIxx, float* invIyy, float* invIzz); void NewtonBodyGetOmega(NewtonBody* _body , float* vector); void NewtonBodyGetVelocity(NewtonBody* _body , float* vector); void NewtonBodyGetForce(NewtonBody* _body , float* vector); void NewtonBodyGetTorque(NewtonBody* _body , float* vector); int NewtonBodyGetSleepingState(NewtonBody* _body ); int NewtonBodyGetAutoFreeze(NewtonBody* _body ); float NewtonBodyGetLinearDamping (NewtonBody* _body ); void NewtonBodyGetAngularDamping (NewtonBody* _body , float* vector); void NewtonBodyGetAABB (NewtonBody* _body , float* p0, float* p1); void NewtonBodyGetFreezeTreshold (NewtonBody* _body , float* freezeSpeed2, float* freezeOmega2); float NewtonBodyGetTotalVolume(NewtonBody* _body ); void NewtonBodyAddBuoyancyForce (NewtonBody* _body , float fluidDensity, float fluidLinearViscosity, float fluidAngularViscosity, float* gravityVector, NewtonGetBuoyancyPlane buoyancyPlane, void *context); void NewtonBodyForEachPolygonDo (NewtonBody* _body , NewtonCollisionIterator callback); void NewtonAddBodyImpulse (NewtonBody* _body , float* pointDeltaVeloc, float* pointPosit); // ********************************************************************************************** // // Common joint funtions // // ********************************************************************************************** void* NewtonJointGetUserData (NewtonJoint* joint); void NewtonJointSetUserData (NewtonJoint* joint, void* userData); int NewtonJointGetCollisionState (NewtonJoint* joint); void NewtonJointSetCollisionState (NewtonJoint* joint, int state); float NewtonJointGetStiffness (NewtonJoint* joint); void NewtonJointSetStiffness (NewtonJoint* joint, float state); void NewtonDestroyJoint(NewtonWorld* newtonWorld, NewtonJoint* joint); void NewtonJointSetDestructor (NewtonJoint* joint, NewtonConstraintDestructor destructor); // ********************************************************************************************** // // Ball and Socket joint functions // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateBall (NewtonWorld* newtonWorld, float* pivotPoint, NewtonBody* childBody, NewtonBody* parentBody); void NewtonBallSetUserCallback (NewtonJoint* ball, NewtonBallCallBack callback); void NewtonBallGetJointAngle (NewtonJoint* ball, float* angle); void NewtonBallGetJointOmega (NewtonJoint* ball, float* omega); void NewtonBallGetJointForce (NewtonJoint* ball, float* force); void NewtonBallSetConeLimits (NewtonJoint* ball, float* pin, float maxConeAngle, float maxTwistAngle); // ********************************************************************************************** // // Hinge joint functions // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateHinge (NewtonWorld* newtonWorld, float* pivotPoint, float* pinDir, NewtonBody* childBody, NewtonBody* parentBody); void NewtonHingeSetUserCallback (NewtonJoint* hinge, NewtonHingeCallBack callback); float NewtonHingeGetJointAngle (NewtonJoint* hinge); float NewtonHingeGetJointOmega (NewtonJoint* hinge); void NewtonHingeGetJointForce (NewtonJoint* hinge, float* force); float NewtonHingeCalculateStopAlpha (NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc, float angle); // ********************************************************************************************** // // Slider joint functions // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateSlider (NewtonWorld* newtonWorld, float* pivotPoint, float* pinDir, NewtonBody* childBody, NewtonBody* parentBody); void NewtonSliderSetUserCallback (NewtonJoint* slider, NewtonSliderCallBack callback); float NewtonSliderGetJointPosit (NewtonJoint* slider); float NewtonSliderGetJointVeloc (NewtonJoint* slider); void NewtonSliderGetJointForce (NewtonJoint* slider, float* force); float NewtonSliderCalculateStopAccel (NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc, float position); // ********************************************************************************************** // // Corkscrew joint functions // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateCorkscrew (NewtonWorld* newtonWorld, float* pivotPoint, float* pinDir, NewtonBody* childBody, NewtonBody* parentBody); void NewtonCorkscrewSetUserCallback (NewtonJoint* corkscrew, NewtonCorkscrewCallBack callback); float NewtonCorkscrewGetJointPosit (NewtonJoint* corkscrew); float NewtonCorkscrewGetJointAngle (NewtonJoint* corkscrew); float NewtonCorkscrewGetJointVeloc (NewtonJoint* corkscrew); float NewtonCorkscrewGetJointOmega (NewtonJoint* corkscrew); void NewtonCorkscrewGetJointForce (NewtonJoint* corkscrew, float* force); float NewtonCorkscrewCalculateStopAlpha (NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc, float angle); float NewtonCorkscrewCalculateStopAccel (NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc, float position); // ********************************************************************************************** // // Universal joint functions // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateUniversal (NewtonWorld* newtonWorld, float* pivotPoint, float* pinDir0, float* pinDir1, NewtonBody* childBody, NewtonBody* parentBody); void NewtonUniversalSetUserCallback (NewtonJoint* universal, NewtonUniversalCallBack callback); float NewtonUniversalGetJointAngle0 (NewtonJoint* universal); float NewtonUniversalGetJointAngle1 (NewtonJoint* universal); float NewtonUniversalGetJointOmega0 (NewtonJoint* universal); float NewtonUniversalGetJointOmega1 (NewtonJoint* universal); void NewtonUniversalGetJointForce (NewtonJoint* universal, float* force); float NewtonUniversalCalculateStopAlpha0 (NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc, float angle); float NewtonUniversalCalculateStopAlpha1 (NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc, float angle); // ********************************************************************************************** // // SlidingContact joint functions // // ********************************************************************************************** /* NewtonJoint* NewtonConstraintCreateSlidingContact (NewtonWorld* newtonWorld, float* pivotPoint, float* pinDir0, float* pinDir1, NewtonBody* childBody, NewtonBody* parentBody); void NewtonSlidingContactSetUserCallback (NewtonJoint* contact, NewtonSlidingContactCallBack callback); */ // ********************************************************************************************** // // Up vector joint functions // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateUpVector (NewtonWorld* newtonWorld, float* pinDir, NewtonBody* _body ); void NewtonUpVectorGetPin (NewtonJoint* upVector, float *pin); void NewtonUpVectorSetPin (NewtonJoint* upVector, float *pin); // ********************************************************************************************** // // User defined bilateral Joint // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateUserJoint (NewtonWorld* newtonWorld, int maxDOF, NewtonUserBilateralCallBack callback, NewtonBody* childBody, NewtonBody* parentBody); void NewtonUserJointAddLinearRow (NewtonJoint* joint, float *pivot0, float *pivot1, float *dir); void NewtonUserJointAddAngularRow (NewtonJoint* joint, float relativeAngle, float *dir); void NewtonUserJointSetRowMinimunFriction (NewtonJoint* joint, float friction); void NewtonUserJointSetRowMaximunFriction (NewtonJoint* joint, float friction); void NewtonUserJointSetRowAcceleration (NewtonJoint* joint, float acceleration); void NewtonUserJointSetRowStiffness (NewtonJoint* joint, float stiffness); float NewtonUserJointGetRowForce (NewtonJoint* joint, int row); // ********************************************************************************************** // // Ragdoll joint contatiner funtion // // ********************************************************************************************** NewtonRagDoll* NewtonCreateRagDoll (NewtonWorld* newtonWorld); void NewtonDestroyRagDoll (NewtonWorld* newtonWorld, NewtonRagDoll* ragDoll); void NewtonRagDollBegin (NewtonRagDoll* ragDoll); void NewtonRagDollEnd (NewtonRagDoll* ragDoll); // void NewtonRagDollSetFriction (NewtonRagDoll* ragDoll, float friction); NewtonRagDollBone* NewtonRagDollFindBone (NewtonRagDoll* ragDoll, int id); NewtonRagDollBone* NewtonRagDollGetRootBone (NewtonRagDoll* ragDoll); void NewtonRagDollSetForceAndTorqueCallback (NewtonRagDoll* ragDoll, NewtonApplyForceAndTorque callback); void NewtonRagDollSetTransformCallback (NewtonRagDoll* ragDoll, NewtonSetRagDollTransform callback); NewtonRagDollBone* NewtonRagDollAddBone (NewtonRagDoll* ragDoll, NewtonRagDollBone* parent, void *userData, float mass, float* matrix, NewtonCollision* boneCollision, float* size); void* NewtonRagDollBoneGetUserData (NewtonRagDollBone* bone); NewtonBody* NewtonRagDollBoneGetBody (NewtonRagDollBone* bone); void NewtonRagDollBoneSetID (NewtonRagDollBone* bone, int id); void NewtonRagDollBoneSetLimits (NewtonRagDollBone* bone, float* coneDir, float minConeAngle, float maxConeAngle, float maxTwistAngle, float* bilateralConeDir, float negativeBilateralConeAngle, float positiveBilateralConeAngle); // NewtonRagDollBone* NewtonRagDollBoneGetChild (NewtonRagDollBone* bone); // NewtonRagDollBone* NewtonRagDollBoneGetSibling (NewtonRagDollBone* bone); // NewtonRagDollBone* NewtonRagDollBoneGetParent (NewtonRagDollBone* bone); // void NewtonRagDollBoneSetLocalMatrix (NewtonRagDollBone* bone, float* matrix); // void NewtonRagDollBoneSetGlobalMatrix (NewtonRagDollBone* bone, float* matrix); void NewtonRagDollBoneGetLocalMatrix (NewtonRagDollBone* bone, float* matrix); void NewtonRagDollBoneGetGlobalMatrix (NewtonRagDollBone* bone, float* matrix); // ********************************************************************************************** // // Vehicle joint functions // // ********************************************************************************************** NewtonJoint* NewtonConstraintCreateVehicle (NewtonWorld* newtonWorld, float* upDir, NewtonBody* _body ); void NewtonVehicleReset (NewtonJoint* vehicle); void NewtonVehicleSetTireCallback (NewtonJoint* vehicle, NewtonVehicleTireUpdate update); int NewtonVehicleAddTire (NewtonJoint* vehicle, float* localMatrix, float* pin, float mass, float width, float radius, float suspesionShock, float suspesionSpring, float suspesionLength, void* userData, int collisionID); void NewtonVehicleRemoveTire (NewtonJoint* vehicle, int tireIndex); void NewtonVehicleBalanceTires (NewtonJoint* vehicle, float gravityMag); int NewtonVehicleGetFirstTireID (NewtonJoint* vehicle); int NewtonVehicleGetNextTireID (NewtonJoint* vehicle, int tireId); int NewtonVehicleTireIsAirBorne (NewtonJoint* vehicle, int tireId); int NewtonVehicleTireLostSideGrip (NewtonJoint* vehicle, int tireId); int NewtonVehicleTireLostTraction (NewtonJoint* vehicle, int tireId); void* NewtonVehicleGetTireUserData (NewtonJoint* vehicle, int tireId); float NewtonVehicleGetTireOmega (NewtonJoint* vehicle, int tireId); float NewtonVehicleGetTireNormalLoad (NewtonJoint* vehicle, int tireId); float NewtonVehicleGetTireSteerAngle (NewtonJoint* vehicle, int tireId); float NewtonVehicleGetTireLateralSpeed (NewtonJoint* vehicle, int tireId); float NewtonVehicleGetTireLongitudinalSpeed (NewtonJoint* vehicle, int tireId); void NewtonVehicleGetTireMatrix (NewtonJoint* vehicle, int tireId, float* matrix); void NewtonVehicleSetTireTorque (NewtonJoint* vehicle, int tireId, float torque); void NewtonVehicleSetTireSteerAngle (NewtonJoint* vehicle, int tireId, float angle); void NewtonVehicleSetTireMaxSideSleepSpeed (NewtonJoint* vehicle, int tireId, float speed); void NewtonVehicleSetTireSideSleepCoeficient (NewtonJoint* vehicle, int tireId, float coeficient); void NewtonVehicleSetTireMaxLongitudinalSlideSpeed (NewtonJoint* vehicle, int tireId, float speed); void NewtonVehicleSetTireLongitudinalSlideCoeficient (NewtonJoint* vehicle, int tireId, float coeficient); float NewtonVehicleTireCalculateMaxBrakeAcceleration (NewtonJoint* vehicle, int tireId); void NewtonVehicleTireSetBrakeAcceleration (NewtonJoint* vehicle, int tireId, float accelaration, float torqueLimit); };