From: Oliver O. <fr...@us...> - 2007-06-17 08:15:43
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31819 Modified Files: Tag: projectx body.h Log Message: merge from HEAD Index: body.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/body.h,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.1.2.1 diff -C2 -d -r1.2.2.1 -r1.2.2.1.2.1 *** body.h 15 Feb 2007 21:00:18 -0000 1.2.2.1 --- body.h 17 Jun 2007 08:15:36 -0000 1.2.2.1.2.1 *************** *** 91,94 **** --- 91,100 ---- void SetSphere(float density, float radius); + /** adds a mass representing a sphere of the given radius and + density, with the matrix determining its center and + orientation + */ + void Addphere(float density, float radius, const salt::Matrix& matrix); + /** sets the mass parameters to represent a sphere of the given radius and total mass, with the center of mass at (0,0,0) *************** *** 97,100 **** --- 103,111 ---- void SetSphereTotal(float total_mass, float radius); + /** add a mass representing a sphere of the given radius and total + mass, with the matrix determining its center and orientation + */ + void AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix); + /** Set the mass parameters to represent a box of the given dimensions and density, with the center of mass at (0,0,0) *************** *** 103,106 **** --- 114,123 ---- void SetBox(float density, const salt::Vector3f& size); + /** Add a mass representing a box of the given dimensions and + density, with the matrix determining its center and + orientation + */ + void AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix); + /** Set the mass parameters to represent a box of the given dimensions and total mass, with the center of mass at (0,0,0) *************** *** 109,112 **** --- 126,135 ---- void SetBoxTotal(float total_mass, const salt::Vector3f& size); + /** Add a mass representing a box of the given dimensions and + total mass, with the matrix determining its center and + orientation + */ + void AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix); + /** Set the mass parameters to represent a flat-ended cylinder of the given parameters and density, with the center of mass at *************** *** 115,119 **** long axis is oriented along the body's z axis. */ ! void SetCylinder (float density, float radius, float length); /** Set the mass parameters to represent a flat-ended cylinder of --- 138,148 ---- long axis is oriented along the body's z axis. */ ! void SetCylinder(float density, float radius, float length); ! ! /** Add a mass representing a flat-ended cylinder of the given ! parameters and density, with the matrix determining its center ! and orientation ! */ ! void AddCylinder(float density, float radius, float length, const salt::Matrix& matrix); /** Set the mass parameters to represent a flat-ended cylinder of *************** *** 125,128 **** --- 154,163 ---- void SetCylinderTotal(float total_mass, float radius, float length); + /** Add a mass representing a flat-ended cylinder of the given + parameters and total mass, with the matrix determining its + center and orientation + */ + void AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix); + /* Set the mass parameters to represent a capped cylinder of the given parameters and density, with the center of mass at *************** *** 134,137 **** --- 169,178 ---- void SetCappedCylinder (float density, float radius, float length); + /* Add a mass representing a capped cylinder of the given + parameters and density, with the matrix determining its center + and orientation + */ + void AddCappedCylinder (float density, float radius, float length, const salt::Matrix& matrix); + /* Set the mass parameters to represent a capped cylinder of the given parameters and total mass, with the center of mass at *************** *** 143,146 **** --- 184,193 ---- void SetCappedCylinderTotal(float total_mass, float radius, float length); + /* Add a mass representing a capped cylinder of the given + parameters and total mass, with the matrix determining its + center and orientation + */ + void AddCappedCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix); + /** displace the mass center relative to the body frame */ void TranslateMass(const salt::Vector3f& v); *************** *** 179,182 **** --- 226,241 ---- virtual void DestroyODEObject(); + /** synchronize parent node with the bodies position and + orientation + */ + void SynchronizeParent() const; + + /** adds the given ode mass to this body. The given matrix is + applied to the mass center + */ + void AddMass(const dMass& mass, const salt::Matrix& matrix); + + salt::Vector3f GetMassCenter() const; + protected: /** creates the managed ODE body and moves it to the position of *************** *** 188,191 **** --- 247,304 ---- bool CreateBody(); + /** sets up an ode mass struct representing a box of the given + size and total_mass + */ + void PrepareBoxTotal(dMass& mass, float total_mass, const salt::Vector3f& size) const; + + /** sets up an ode mass struct representing a box of the given + density and size + */ + void PrepareBox(dMass& mass, float density, const salt::Vector3f& size) const; + + /** sets up an ode mass struct representing a sphere of the given + density and radius + */ + void PrepareSphere(dMass& mass, float density, float radius) const; + + /** sets up an ode mass struct representing a sphere of the given + radius and total_mass + */ + void PrepareSphereTotal(dMass& mass, float total_mass, float radius) const; + + /** sets up an ode mass struct representing a flat-ended cylinder + of the given parameters and density, with the center of mass + at (0,0,0) relative to the body. The radius of the cylinder is + radius. The length of the cylinder is length. The cylinder's + long axis is oriented along the body's z axis. + */ + void PrepareCylinder (dMass& mass, float density, float radius, float length) const; + + /** sets up an ode mass struct representing a flat-ended cylinder + of the given parameters and total mass, with the center of + mass at (0,0,0) relative to the body. The radius of the + cylinder is radius. The length of the cylinder is length. The + cylinder's long axis is oriented along the body's z axis. + */ + void PrepareCylinderTotal(dMass& mass, float total_mass, float radius, float length) const; + + /* sets up an ode mass struct representing a capped cylinder of + the given parameters and density, with the center of mass at + (0,0,0) relative to the body. The radius of the cylinder (and + the spherical cap) is radius. The length of the cylinder (not + counting the spherical cap) is length. The cylinder's long axis + is oriented along the body's z axis. + */ + void PrepareCappedCylinder (dMass& mass, float density, float radius, float length) const; + + /* sets up an ode mass struct representing a capped cylinder of + the given parameters and total mass, with the center of mass at + (0,0,0) relative to the body. The radius of the cylinder (and + the spherical cap) is radius. The length of the cylinder (not + counting the spherical cap) is length. The cylinder's long axis + is oriented along the body's z axis. + */ + void PrepareCappedCylinderTotal(dMass& mass, float total_mass, float radius, float length) const; + private: /** updates the the internal state after physics calculation, |