Body.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #pragma once
  2. #include "World.h"
  3. #include "CommonMgd.h"
  4. namespace ODEManaged
  5. {
  6. __gc public class Body
  7. {
  8. public:
  9. //Constructors and Destructors
  10. Body(void);
  11. Body(World &world);
  12. ~Body(void);
  13. //Public Methods
  14. dBodyID Id();
  15. void SetData (void *data);
  16. void *GetData (void);
  17. //POSITION
  18. void SetPosition(double x, double y, double z);
  19. Vector3 GetPosition(void);
  20. void GetPosition(double position __gc[]);
  21. //ROTATION
  22. void SetRotationIdentity(void);
  23. void SetRotation(Matrix3 rotation);
  24. Matrix3 GetRotation(void);
  25. //MASS
  26. void SetMass(double mass, Vector3 centerOfGravity, Matrix3 inertia);
  27. void SetMassSphere(double density, double radius);
  28. void SetMassBox(double density, double sideX, double sideY, double sideZ);
  29. void SetMassCappedCylinder(double density, int axis, double cylinderRadius, double cylinderLength);
  30. //FORCE AND TORQUE
  31. void AddForce(double fX, double fY, double fZ);
  32. void AddRelForce(double fX, double fY, double fZ);
  33. void AddForceAtPos(double fX, double fY, double fZ,double pX, double pY, double pZ);
  34. void AddRelForceAtPos(double fX, double fY, double fZ,double pX, double pY, double pZ);
  35. void AddRelForceAtRelPos(double fX, double fY, double fZ,double pX, double pY, double pZ);
  36. void ApplyLinearVelocityDrag(double dragCoef);
  37. void ApplyAngularVelocityDrag(double dragCoef);
  38. void AddTorque(double fX, double fY, double fZ);
  39. void AddRelTorque(double fX, double fY, double fZ);
  40. //LINEAR VELOCITY
  41. void SetLinearVelocity (double x, double y, double z);
  42. Vector3 GetLinearVelocity(void);
  43. //ANGULAR VELOCITY
  44. void SetAngularVelocity (double x, double y, double z);
  45. Vector3 GetAngularVelocity(void);
  46. //POINT
  47. Vector3 GetRelPointPos(double pX, double pY, double pZ);
  48. Vector3 GetRelPointVel(double pX, double pY, double pZ);
  49. //CONNECTED TO
  50. int ConnectedTo (const Body &b);
  51. private:
  52. dBodyID _id;
  53. };
  54. }