From: <a-...@us...> - 2010-02-03 09:28:00
|
Revision: 157 http://simspark.svn.sourceforge.net/simspark/?rev=157&view=rev Author: a-held Date: 2010-02-03 09:27:51 +0000 (Wed, 03 Feb 2010) Log Message: ----------- Derive engine-specific classes from engine-specific superclasses again Commented interfaces Left hint in all engine-specific header files that methods are documented in the implementation files Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint.h branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeangularmotor.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeangularmotor.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecompoundcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecompoundcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconcavecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconcavecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecontactjointhandler.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecontactjointhandler.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeemptycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeemptycollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odetransformcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odetransformcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h branches/multiphys/spark/lib/oxygen/physicsserver/space.h branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/world.h Modified: branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h 2010-02-03 09:27:51 UTC (rev 157) @@ -71,7 +71,8 @@ void SetNumAxes(int num); /** returns the number of angular axes that are controlled by the - angular motor */ + angular motor + */ int GetNumAxes(); /** sets one of the motor axis. \param idx gives the motor axis to @@ -83,15 +84,14 @@ be determined automatically at each time step. Axes 0 and 2 must be perpendicular to each other. Axis 0 must be anchored to the first body, axis 2 must be anchored to the second body. - */ + */ void SetMotorAxis(EAxisIndex idx, EAxisAnchor anchor, const salt::Vector3f& axis); /** returns the motor axis \param idx */ salt::Vector3f GetMotorAxis(EAxisIndex idx); - /** returns the relative anchor mode of the motor axis \param idx - */ + /** returns the relative anchor mode of the motor axis \param idx */ EAxisAnchor GetAxisAnchor(EAxisIndex idx); /** sets the current angle along axis \param idx. This function @@ -104,14 +104,14 @@ 'user' mode this is simply the value that was previoulsy set with SetAxisAngle(). In 'euler' mode this is the corresponding euler angle. - */ + */ float GetAxisAngle(EAxisIndex idx); /** Return the current angle rate for axis anum. In dAMotorUser mode this is always zero, as not enough information is available. In dAMotorEuler mode this is the corresponding euler angle rate. - */ + */ float GetAxisAngleRate(EAxisIndex idx); protected: Modified: branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.h 2010-02-03 09:27:51 UTC (rev 157) @@ -73,7 +73,8 @@ protected: /** constructs a default capsule with an radius of 1 and a - length of 1 */ + length of 1 + */ virtual bool ConstructInternal(); private: Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-02-03 09:27:51 UTC (rev 157) @@ -24,7 +24,6 @@ #include <oxygen/physicsserver/impfactory.h> #include <oxygen/physicsserver/collisionhandler.h> #include <oxygen/physicsserver/space.h> -#include <oxygen/physicsserver/staticphysicsmethods.h> #include <oxygen/physicsserver/transformcollider.h> #include <oxygen/physicsserver/rigidbody.h> #include <oxygen/sceneserver/scene.h> Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h 2010-02-03 09:27:51 UTC (rev 157) @@ -24,7 +24,6 @@ #include <oxygen/sceneserver/basenode.h> #include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/ode/odewrapper.h> namespace oxygen { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,8 +30,8 @@ { class ContactJointHandlerInt; -/** \class ContactJointHandler is a CollisionHandler that creates an - ODE contact joint between the two bodies associated with the two +/** \class ContactJointHandler is a CollisionHandler that creates a + contact joint between the two bodies associated with the two affected collision geoms. */ class OXYGEN_API ContactJointHandler : public CollisionHandler @@ -75,7 +75,7 @@ */ int GetContactMode() const; - /** sets or resets the dContactBounce mode flag */ + /** sets or resets Bounce mode flag */ void SetContactBounceMode(bool set); /** sets the bounce value */ @@ -112,8 +112,7 @@ /** returns the constraint force mixing parameter (CFM) */ float GetContactSoftCFM() const; - /** sets or resets the force dependent contact slip mode (FDS) - */ + /** sets or resets the force dependent contact slip mode (FDS) */ void SetContactSlipMode (bool set); /** sets the force dependent slip (FDS) in both friction Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -31,20 +31,78 @@ class RigidBody; class Joint; +/** An angular motor allows the relative angular velocities of two + bodies to be controlled. The angular velocity can be controlled on + up to three axes, allowing torque motors and stops to be set for + rotation about those axes. +*/ + class OXYGEN_API AngularMotorInt { -public: +public: + /** Creates a new angular motor within the physics world specified + by \param worldID + */ virtual long CreateAngularMotor(long worldID) = 0; + + /** Sets the mode of this angular motor to user mode */ virtual void SetModeUserMode(long jointID) = 0; + + /** Sets the mode of this angular motor to euler mode */ virtual void SetModeEulerMode(long jointID) = 0; + + /** returns the current motor mode - zero if motor is in user mode, + or one if motor is in euler mode. + */ virtual int GetMode(long jointID) = 0; + + /** sets the number of angular axes that will be controlled by the + angular motor. \param num can range from 0 which effectively + disables the motor to 3, which are automatically set in euler + mode. + */ virtual void SetNumAxes(int num, long jointID) = 0; + + /** returns the number of angular axes that are controlled by the + angular motor + */ virtual int GetNumAxes(long jointID) = 0; + + /** sets one of the motor axis. \param idx gives the motor axis to + be set. \param anchor gives the relative anchor mode of the + axis. \param axis gives the axis vector relative to the joint node + orientation. + + For Euler mode only axes 0 and 2 need to be set. Axis 1 will + be determined automatically at each time step. Axes 0 and 2 + must be perpendicular to each other. Axis 0 must be anchored + to the first body, axis 2 must be anchored to the second body. + */ virtual void SetMotorAxis(int idx, int anchor, salt::Vector3f axis, long jointID) = 0; + + /** returns the relative anchor mode of the motor axis \param idx */ virtual int GetAxisAnchor(int idx, long jointID) = 0; + + /** returns the motor axis \param idx */ virtual salt::Vector3f GetMotorAxis(int idx, long jointID) = 0; + + /** sets the current angle along axis \param idx. This function + should only be called in 'user' mode, as in this mode the + motor has no other way of knowing the joint angles. + */ virtual void SetAxisAngle(int idx, float degAngle, long jointID) = 0; + + /** sets the current angle along axis \param idx. This function + should only be called in 'user' mode, as in this mode the + motor has no other way of knowing the joint angles. + */ virtual float GetAxisAngle(int idx, long jointID) = 0; + + /** Return the current angle rate for axis anum. In dAMotorUser + mode this is always zero, as not enough information is + available. In dAMotorEuler mode this is the corresponding + euler angle rate. + */ virtual float GetAxisAngleRate(int idx, long jointID) = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -34,10 +34,29 @@ class OXYGEN_API BallJointInt { public: + + /** Set the joint anchor point. The joint will try to keep this + point on each body together. The input is specified in local + coordinates. + */ virtual void SetAnchor(const salt::Vector3f& anchor, long jointID) = 0; + + /** Returns the joint anchor point in local coordinates on the first of + the two bodies. If the joint is perfectly satisfied, the joint + anchor point will be the same for both bodies. + */ virtual salt::Vector3f GetAnchor1(long jointID) = 0; + + /** Returns the joint anchor point in local coordinates on the second of + the two bodies. If the joint is perfectly satisfied, the joint + anchor point will be the same for both bodies. + */ virtual salt::Vector3f GetAnchor2(long jointID) = 0; - virtual long CreateBallJoint(long world) = 0; + + /** Creates a new BallJoint in the physics world specified + by \param worldID + */ + virtual long CreateBallJoint(long worldID) = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API BodyInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -33,9 +33,20 @@ { public: + /** sets the side lengths of the box geom */ virtual void SetBoxLengths(const salt::Vector3f& extents, long geomID) = 0; + + /** gets the side lengths of the box geom */ virtual void GetBoxLengths(salt::Vector3f& extents, long geomID) = 0; + + /** returns the depth of the given relative position in the + managed box geom. Points inside the geom will have positive + depth, points outside it will have negative depth, and points + on the surface will have zero depth. + */ virtual float GetPointDepth(const salt::Vector3f& pos, long geomID) = 0; + + /** Creates a new box geom and returns the ID of the newly created box */ virtual long CreateBox() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -32,13 +32,37 @@ class OXYGEN_API CapsuleColliderInt { public: + + /** sets the parameters of the capsule. + + \param radius is the radius of the caps, and of the cylinder itself + \param length is the height of the cylinder, not counting the caps + */ virtual void SetParams(float radius, float length, long geomID) = 0; + + /** sets the radius of the capsule */ virtual void SetRadius(float radius, long geomID) = 0; + + /** sets the length of the capsule */ virtual void SetLength(float length, long geomID) = 0; + + /** gets the radius and the length of the capsule */ virtual void GetParams(float& radius, float& length, long geomID) = 0; + + /** returns the radius of the capsule */ virtual float GetRadius(long geomID) = 0; + + /** return the length of the capsule */ virtual float GetLength(long geomID) = 0; + + /** returns the depth of the given relative position in the + managed capsule geom. Points inside the geom will have + positive depth, points outside it will have negative depth, and + points on the surface will have zero depth. + */ virtual float GetPointDepth(const salt::Vector3f& pos, long geomID) = 0; + + /** Creates a new Capsule and returns the ID of the newly created capsule */ virtual long CreateCapsule() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -42,16 +42,56 @@ */ virtual Collider* GetColliderPointer(long geomID) = 0; + /** sets the relative position of the managed geom directly. If + the geom is connected to a body, the position of the body will + also be changed + */ virtual void SetPosition(const salt::Vector3f& globalPos, long geomID) = 0; + + /** sets the relative position of the managed geom to the body's center. + Only use for colliders encapsulated in a TransformCollider! + */ virtual void SetLocalPosition(const salt::Vector3f& pos, long geomID) = 0; + + /** returns the absolute position of the managed geom */ virtual salt::Vector3f GetPosition(long geomID) const = 0; + + /** sets the relative orientation of the managed geom directly. If + the geom is connected to a body, the orientation of the body + will also be changed + */ virtual void SetRotation(const salt::Matrix& rot, long geomID) = 0; + + /** returns true if the geom managed by this + Collider intersects with the geom managed by the given collider + */ virtual bool Intersect(boost::shared_ptr<Collider> collider, long geomID) = 0; + + /** returns the handle ID of the containing parent space */ virtual long GetParentSpaceID(long geomID) = 0; + + /** Destroys the collider specified by \param geomID */ virtual void DestroyGeom(long geomID) = 0; + + /** Registers the collider specified by \param geomID to the transform + collider specified by \param parentGeomID + */ virtual void TransformSetGeom(long parentGeomID, long geomID) = 0; + + /** Puts the collider specified by \param geomID into the space + specified by spaceID. It also registers \param collider as the + abstract collider object managing this collider. + */ virtual void SetSpace(long spaceID, long geomID, Collider* collider) = 0; + + /** Registers the collider specified by \param geomID to the body + specified by \param bodyID + */ virtual void SetBody(long bodyID, long geomID) = 0; + + /** Removes the collider specified by \param geomID from the space + specified by \param spaceID + */ virtual void RemoveFromSpace(long geomID, long spaceID) = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API CompoundColliderInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API ConcaveColliderInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API ConeColliderInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API ConeTwistJointInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -33,33 +33,106 @@ class OXYGEN_API ContactJointHandlerInt { -public: - virtual float MixValues(const float v1, const float v2, const int n) const = 0; +public: + /** Returns a pointer to a SurfaceParameter class whose values were initialized + with default values that make sense for most physics simulations. + */ virtual GenericSurfaceParameter* Initialize() = 0; + + /** Finds and returns the ID of the body that the collider specified by + \param geomID has been registered to. */ virtual long RetrieveBody(long geomID) = 0; + + /** Creates a contact joint in the world specified by \param worldID, within the joint + group specified by \param jointGroupID + */ virtual long CreateContactJoint(long worldID, long jointGroupID, GenericContact& contact) = 0; + + /** Attaches the contact joint specified by \param jointID to the two bodies + specified by \param body1 and \param body2 + */ virtual void AttachContactJoint(long jointID, long bodyID1, long bodyID2) = 0; + + /** Calculates the surface parameters to take into account for a collision + by factoring in the surface parameters of the two colliding objects, + specified by \param colideeParam and \param surfacePtr + */ virtual void CalcSurfaceParam(GenericContact& surface, GenericSurfaceParameter& collideeParam, GenericSurfaceParameter* surfacePtr) = 0; + + /** returns the current set of contact mode flags in the surface + parameter + */ virtual int GetContactMode(GenericSurfaceParameter* surface) const = 0; + + /** sets or resets the Bounce mode flag */ virtual void SetContactBounceMode(bool set, GenericSurfaceParameter* surface) = 0; + + /** sets the bounce value */ virtual void SetBounceValue(float bounce, GenericSurfaceParameter* surface) = 0; + + /** returns the bounce value */ virtual float GetBounceValue(GenericSurfaceParameter* surface) const = 0; + + /** sets the mininum incoming velocity necessary for bounce */ virtual void SetMinBounceVel(float vel, GenericSurfaceParameter* surface) = 0; + + /** returns the mininum incoming velocity necessary for bounce */ virtual float GetMinBounceVel(GenericSurfaceParameter* surface) const = 0; + + /** sets or resets the error reduction parameter (ERP) mode, + useful to make surfaces soft. + */ virtual void SetContactSoftERPMode(bool set, GenericSurfaceParameter* surface) = 0; + + /** sets the contact normal error reduction parameter (ERP) */ virtual void SetContactSoftERP(float erp, GenericSurfaceParameter* surface) = 0; + + /** returns the contact normal error reduction parameter (ERP) */ virtual float GetContactSoftERP(GenericSurfaceParameter* surface) const = 0; + + /** sets or resets the constraint force mixing mode (CFM), useful + to make surfaces soft + */ virtual void SetContactSoftCFMMode(bool set, GenericSurfaceParameter* surface) = 0; + + /** sets the constraint force mixing parameter (CFM) */ virtual void SetContactSoftCFM(float cfm, GenericSurfaceParameter* surface) = 0; + + /** returns the constraint force mixing parameter (CFM) */ virtual float GetContactSoftCFM(GenericSurfaceParameter* surface) const = 0; + + /** sets or resets the force dependent contact slip mode (FDS) */ virtual void SetContactSlipMode (bool set, GenericSurfaceParameter* surface) = 0; + + /** sets the force dependent slip (FDS) in both friction + directions + */ virtual void SetContactSlip(float slip, GenericSurfaceParameter* surface) = 0; + + /** returns the force dependent slip in the first slip direction + (FDS) + */ virtual float GetContactSlip1(GenericSurfaceParameter* surface) const = 0; + + /** returns the force dependent slip in the second slip direction + (FDS) + */ virtual float GetContactSlip2(GenericSurfaceParameter* surface) const = 0; + + /** sets the Coulomb friction coefficient */ virtual void SetContactMu(float mu, GenericSurfaceParameter* surface) = 0; + + /** returns the Coulomb friction coefficient */ virtual float GetContactMu(GenericSurfaceParameter* surface) const = 0; + +protected: + /** returns \param v1 for \param n =1, \param v2 for /param n =2, and + (\param v1 + \param v2) * 0.5 for \param n =3. Undefined for all + other values of n. + */ + virtual float MixValues(const float v1, const float v2, const int n) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API ConvexColliderInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API CylinderColliderInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API DynamicBodyInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API EmptyColliderInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -27,7 +27,14 @@ class OXYGEN_API FixedJointInt{ public: + /** Creates a fixed joint within the physics world specified + by \param worldID + */ virtual long CreateFixedJoint(long world) = 0; + + /** Declares that the joint specified by \param jointID is a + fixed joint + */ virtual void SetFixed(long jointID) = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -30,7 +30,7 @@ class OXYGEN_API Generic6DOFJointInt { - + /** This class is currently not implemented. */ }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -28,15 +28,42 @@ class OXYGEN_API Hinge2JointInt{ public: - virtual long CreateHinge2Joint(long world) = 0; + /** Creates a hinge2joint within the physics world specified + by \param worldID + */ + virtual long CreateHinge2Joint(long worldID) = 0; + + /** sets the joint anchor point. The joint will try to keep this + point on each body together. The input is specified in local + coordinates. + */ virtual void SetAnchor(const salt::Vector3f& anchor, const salt::Vector3f& up, const salt::Vector3f& right, long jointID) = 0; + + /** returns the joint anchor point in local coordinates on the first of + the two bodies. If the joint is perfectly satisfied, the joint + anchor point will be the same for both bodies. + */ virtual salt::Vector3f GetAnchor1(long jointID) = 0; + + /** returns the joint anchor point in local coordinates on the second of + the two bodies. If the joint is perfectly satisfied, the joint + anchor point will be the same for both bodies. + */ virtual salt::Vector3f GetAnchor2(long jointID) = 0; + + /** returns one of the hinge2 angles in degrees, measured between + the two bodies, or between the body and the static + environment. + */ virtual float GetAngle(long jointID) = 0; + + /** returns the time derivate of the first of the hinge2 angles */ virtual float GetAngleRate1(long jointID) = 0; + + /** returns the time derivate of the second of the hinge2 angles */ virtual float GetAngleRate2(long jointID) = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -28,13 +28,44 @@ class OXYGEN_API HingeJointInt{ public: - virtual long CreateHingeJoint(long world) = 0; + /** Creates a new hingejoint within the physics world specified + by \param worldID + */ + virtual long CreateHingeJoint(long worldID) = 0; + + /** sets the joint anchor point. The joint will try to keep this + point on each body together. The input is specified in local + coordinates. + */ virtual void SetAnchor(const salt::Vector3f& anchor, long jointID) = 0; + + /** returns the joint anchor point in local coordinates on the first of + the two bodies. If the joint is perfectly satisfied, the joint + anchor point will be the same for both bodies. + */ virtual salt::Vector3f GetAnchor1(long jointID) = 0; + + /** returns the joint anchor point in local coordinates on the second of + the two bodies. If the joint is perfectly satisfied, the joint + anchor point will be the same for both bodies. + */ virtual salt::Vector3f GetAnchor2(long jointID) = 0; + + /** Sets the joint axis in the local coordinate system. The + connected bodies movements will be constrained to move around + this axis. + */ virtual void SetAxis(const salt::Vector3f& axis, long jointID) = 0; + + /** Returns the hinge axis in the local coordinate system */ virtual salt::Vector3f GetAxis(long jointID) = 0; + + /** returns the hinge angle in degrees, measured between the two + bodies, or between the body and the static environment. + */ virtual float GetAngle(long jointID) const = 0; + + /** returns the time derivate of the hinge angle */ virtual float GetAngleRate(long jointID) const = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -37,65 +37,209 @@ class OXYGEN_API JointInt { -public: - - /** Gets the pointer to the Joint object that manages the joint - specified by jointID. +public: + /** Returns a pointer to the Joint object that manages the joint + specified by \param jointID. */ virtual Joint* GetJoint(long jointID) = 0; - /** Checks if two bodies, specified by bodyID1 and bodyID2, are - connected by a joint. + /** Checks if two bodies, specified by \param bodyID1 and + \param bodyID2, are connected by a joint. */ virtual bool AreConnected(long bodyID1, long bodyID2) = 0; - /** Checks if two bodies, specified by bodyID1 and bodyID2, are - connected by a joint that is not of the type specified by joint_type. + /** Checks if two bodies, specified by \param bodyID1 and + \param bodyID2, are connected by a joint that is not of the type + specified by \param joint_type. */ virtual bool AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type) = 0; + /** Destroys the Joint specified by \param jointID */ virtual void DestroyJoint(long jointID, boost::shared_ptr<GenericJointFeedback> feedback) = 0; + + /** attaches the joint to some new bodies. If the joint is already + attached, it will be detached from the old bodies first. To + attach this joint to only one body, set body1 or body2 to + null. A null body refers to the static environment. Setting + both bodies to zero puts the joint into "limbo", i.e. it will + have no effect on the simulation. + */ virtual void Attach(long bodyID1, long bodiID2, long jointID) = 0; + + /** returns the type of the managed joint, possible return + values from ODE are dJointTypeNone, dJointTypeBall, dJointTypeHinge, + dJointTypeSlider, dJointTypeContact, dJointTypeUniversal, + dJointTypeHinge2, dJointTypeFixed or dJointTypeAMotor. + */ virtual int GetType(long jointID) const = 0; + + /** Returns the ID of one of the bodies the joint specified + by \param jointID is connected to. Since a joint is always + connected to two bodies, use \param idx to address the first or + second body. + */ virtual long GetBodyID(int idx, long jointID) = 0; + + /** during the world time step, the forces that are applied by + each joint are added directly to the joined bodies, and the + user normally has no way of telling which joint contributed + how much force. If this information is desired the joint can + be enabled to collect feedback information. By default a joint + does not collect any feedback information. + */ virtual void EnableFeedback(bool enable, long jointID, boost::shared_ptr<GenericJointFeedback> feedback) = 0; + + /** returns true if the joint is set to collect feedback + information + */ virtual bool FeedbackEnabled(long jointID) const = 0; + + /** queries the force that the joint applied to one body attached + to it during the last timestep. + */ virtual salt::Vector3f GetFeedbackForce(int idx, boost::shared_ptr<GenericJointFeedback> feedback) const = 0; + + /** queries the torque that the joint applied to one body attached + to it during the last timestep. + */ virtual salt::Vector3f GetFeedbackTorque(int idx, boost::shared_ptr<GenericJointFeedback> feedback) const = 0; + + /** sets the fudgefactor parameter, making this value too small can + prevent the motor from being able to move the joint away from + a stop + */ virtual void SetFudgeFactor(int idx, float fudge_factor, long jointID) = 0; + + /** returns the fudgefactor paramter */ virtual float GetFudgeFactor(int idx, long jointID) const = 0; + + /** sets the bouncyness of the stops. This is a restitution + parameter in the range 0..1. 0 means the stops are not bouncy + at all, 1 means maximum bouncyness. + */ virtual void SetBounce(int idx, float bounce, long jointID) = 0; + + /** returns the bouncyness of the stops */ virtual float GetBounce(int idx, long jointID) const = 0; + + /** sets the low stop angle in degrees, this stop must be greater + than -180 to be effective + */ virtual void SetLowStopDeg(int idx, float deg, long jointID) = 0; + + /** returns the low stop angle in degrees */ virtual float GetLowStopDeg(int idx, long jointID) const = 0; + + /** sets the high stop angle in degrees, this stop must be less + than +180 to be effective + */ virtual void SetHighStopDeg(int idx, float deg, long jointID) = 0; + + /** returns the high stop angle in degrees */ virtual float GetHighStopDeg(int idx, long jointID) const = 0; + + /** sets the low stop position */ virtual void SetLowStopPos(int idx, float deg, long jointID) = 0; + + /** returns the low stop position */ virtual float GetLowStopPos(int idx, long jointID) const = 0; + + /** sets the high stop position */ virtual void SetHighStopPos(int idx, float deg, long jointID) = 0; + + /** returns the high stop position */ virtual float GetHighStopPos(int idx, long jointID) const = 0; + + /** the constraint force mixing (CFM) value used when not at a + stop + */ virtual void SetCFM(int idx, float cfm, long jointID) = 0; + + /** returns the constraint force mixing value used when not a a + stop + */ virtual float GetCFM(int idx, long jointID) const = 0; + + /** sets the constraint force mixing (CFM) value used by the + stops. Together with the ERP value this can be used to get + spongy or soft stops. This is intended for unpowered joints, + it does not really work as expected when a powered joint + reaches its limit. + */ virtual void SetStopCFM(int idx, float cfm, long jointID) = 0; + + /** returns the constraint force mixing value used by the stops */ virtual float GetStopCFM(int idx, long jointID) const = 0; + + /** sets the error reduction parameter (ERP) used by the stops. */ virtual void SetStopERP(int idx, float erp, long jointID) = 0; + + /** returns the error reduction parameter used by the stops */ virtual float GetStopERP(int idx, long jointID) const = 0; + + /** sets the suspension error reduction parameter (ERP). As of ode + 0.039 this is only implemented on the hinge-2 joint. + */ virtual void SetSuspensionERP(int idx, float erp, long jointID) = 0; + + /** returns the suspension error reduction parameter (ERP). As of + ode 0.039 this is only implemented on the hinge-2 joint. + */ virtual float GetSuspensionERP(int idx, long jointID) const = 0; + + /** sets the suspension constraint force mixing value. As of ode + 0.039 this is only implemented on the hinge-2 joint. + */ virtual void SetSuspensionCFM(int idx, float cfm, long jointID) = 0; + + /** returns the suspension constraint force mixing value. As of + ode 0.039 this is only implemented on the hinge-2 joint. + */ virtual float GetSuspensionCFM(int idx, long jointID) const = 0; + + /** sets the linear motor velocity */ virtual void SetLinearMotorVelocity(int idx, float vel, long jointID) = 0; + + /** returns the linear motor velocity */ virtual float GetLinearMotorVelocity(int idx, long jointID) const = 0; + + /** sets the angular motor velocity in degrees */ virtual void SetAngularMotorVelocity(int idx, float deg, long jointID) = 0; + + /** returns the angular motor velocity in degrees */ virtual float GetAngularMotorVelocity(int idx, long jointID) const = 0; + + /** sets the maximum force or torque that the motor will use to + achieve the desired velocity. This must always be greater than + or equal to zero. Setting this to zero (the default value) + turns off the motor. + */ virtual void SetMaxMotorForce(int idx, float f, long jointID) = 0; + + /** returns the maximum force or torque that the motor will use to + achieve the desired velocity. + */ virtual float GetMaxMotorForce(int idx, long jointID) const = 0; + + /** Sets the joint parameter indexed by \param parameter of the joint + specified by \param jointID to \param value + */ virtual void SetParameter(int parameter, float value, long jointID) = 0; + + /** Returns the joint parameter indexed by \param parameter of the joint + specified by \param jointID + */ virtual float GetParameter(int parameter, long jointID) const = 0; + + /** Links the ID of the joint specified by \param jointID to the Joint + object specified by \param joint. Doing this allows us to later + find the Joint object that manages the joint specified + by \param jointID. + */ virtual void OnLink(long jointID, Joint* joint) = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -35,7 +35,12 @@ { public: + /** converts the rotation part of a salt::Matrix to an + engine-specific matrix that arranges the values in a different way + */ virtual void ConvertRotationMatrix(const salt::Matrix& rot, GenericPhysicsMatrix& matrix) = 0; + + /** coverts an engine-specific matrix to the rotation part of a salt::Matrix */ virtual void ConvertRotationMatrix(const GenericPhysicsMatrix* matrix, salt::Matrix& rot) const = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -33,9 +33,24 @@ class OXYGEN_API PlaneColliderInt { public: + /** sets the parameters of the plane equation a*x+b*y+c*z = d , + all parameters are given in global coordinates + */ virtual void SetPlaneParams(float a, float b, float c, float d, long geomID) = 0; + + /** set the parameters of the plane given a position and a normal + vector; all parameters are given in global coordinates + */ virtual void SetParams(const salt::Vector3f& pos, salt::Vector3f normal, long geomID) = 0; + + /** returns the depth of the given relative position in the + managed plane. Points inside the geom will have positive + depth, points outside it will have negative depth, and points + on the surface will have zero depth. + */ virtual float GetPointDepth(const salt::Vector3f& pos, long geomID) = 0; + + /** Creates a plane collider and returns the ID of the newly created plane */ virtual long CreatePlane() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -31,8 +31,24 @@ class OXYGEN_API RayColliderInt { +/** RayCollider encapsulates an ODE ray geometry "object". + + A ray is different from all the other geom classes in that it does not + represent a solid object. It is an infinitely thin line that starts + from the geom's position and extends in the direction of the geom's + local Z-axis. +*/ + public: + /** Sets the parameters of the ray. + * + * \param pos starting position of the ray + * \param dir new direction of the ray + * \param length length of the ray starting at its position + */ virtual void SetParams(salt::Vector3f pos, salt::Vector3f dir, float length, long geomID) = 0; + + /* Creates a ray and returns the ID of the newly created ray */ virtual long CreateRay() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-02-02 08:17:15 UTC (rev 156) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-02-03 09:27:51 UTC (rev 157) @@ -34,58 +34,219 @@ { public: + /** Returns a pointer to the abstract RigidBody object that + manages the rigid body specified by \param bodyID + */ virtual RigidBody* GetBodyPointer(long bodyID) = 0; + /** enables this body. Each body can be enabled or + disabled. Disabled bodies are effectively turned off and are + not updated during a simulation step. Disabling bodies is an + effective way to save computation time when it is known that + the bodies are motionless or otherwise irrelevent to the + simulation. + */ virtual void Enable(long bodyID) = 0; + + /** disables this body */ virtual void Disable(long bodyID) = 0; + + /** returns true if this body is enabled */ virtual bool IsEnabled(long bodyID) const = 0; + + /** sets whether the body is influenced by the world's gravity or + not. Bodies are constructed to be influenced by the world's + gravity by default. + */ virtual void UseGravity(bool f, long bodyID) = 0; + + /** returns true, if this body is influenced by the world's + gravity + */ virtual bool UsesGravity(long bodyID) const = 0; + + /** sets the mass of this body */ virtual void SetMass(float mass, long bodyID) = 0; + + /** Sets the mass parameters of this body */ virtual void SetMassParameters(const GenericMass& mass, long bodyID) = 0; + + /** returns the mass of this body */ virtual float GetMass(long bodyID) const = 0; + + /** sets the mass parameters to represent a sphere of the given + radius and density, with the center of mass at (0,0,0) + relative to the body. + */ virtual void SetSphere(float density, float radius, long bodyID) = 0; + + /** adds a mass representing a sphere of the given radius and + density, with the matrix determining its center and + orientation + */ virtual salt::Vector3f AddSphere(float density, float radius, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /** sets the mass parameters to represent a sphere of the given + radius and total mass, with the center of mass at (0,0,0) + relative to the body. + */ virtual void SetSphereTotal(float total_mass, float radius, long bodyID) = 0; + + /** add a mass representing a sphere of the given radius and total + mass, with the matrix determining its center and orientation + */ virtual salt::Vector3f AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /** Set the mass parameters to represent a box of the given + dimensions and density, with the center of mass at (0,0,0) + relative to the body. + */ virtual void SetBox(float density, const salt::Vector3f& size, long bodyID) = 0; + + /** Add a mass representing a box of the given dimensions and + density, with the matrix determining its center and + orientation + */ virtual salt::Vector3f AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /** Set the mass parameters to represent a box of the given + dimensions and total mass, with the center of mass at (0,0,0) + relative to the body. + */ virtual void SetBoxTotal(float total_mass, const salt::Vector3f& size, long bodyID) = 0; + + /** Add a mass representing a box of the given dimensions and + total mass, with the matrix determining its center and + orientation + */ virtual salt::Vector3f AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /** Set the mass parameters to represent 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. + */ virtual void SetCylinder(float density, float radius, float length, long bodyID) = 0; + + /** Add a mass representing a flat-ended cylinder of the given + parameters and density, with the matrix determining its center + and orientation + */ virtual salt::Vector3f AddCylinder(float density, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /** Set the mass parameters to represent 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. + */ virtual void SetCylinderTotal(float total_mass, float radius, float length, long bodyID) = 0; + + /** Add a mass representing a flat-ended cylinder of the given + parameters and total mass, with the matrix determining its + center and orientation + */ virtual salt::Vector3f AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /* Set the mass parameters to represent a capsule 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. + */ virtual void SetCapsule(float density, float radius, float length, long bodyID) = 0; + + /** Add a mass representing a capsule of the given + parameters and density, with the matrix determining its center + and orientation + */ virtual salt::Vector3f AddCapsule(float density, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /** Set the mass parameters to represent a capsule 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. + */ virtual void SetCapsuleTotal(float total_mass, float radius, float length, long bodyID) = 0; + + /** Add a mass representing a capsule of the given + parameters and total mass, with the matrix determining its + center and orientation + */ virtual salt::Vector3f AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + + /** displace the mass center relative to the body frame */ v... [truncated message content] |