From: <he...@us...> - 2012-05-19 18:41:05
|
Revision: 313 http://simspark.svn.sourceforge.net/simspark/?rev=313&view=rev Author: hedayat Date: 2012-05-19 18:40:58 +0000 (Sat, 19 May 2012) Log Message: ----------- Add virtual destructor to physics interface classes to ensure correct destruction of implementation objects. Modified Paths: -------------- trunk/spark/ChangeLog trunk/spark/lib/oxygen/physicsserver/int/angularmotorint.h trunk/spark/lib/oxygen/physicsserver/int/balljointint.h trunk/spark/lib/oxygen/physicsserver/int/boxcolliderint.h trunk/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h trunk/spark/lib/oxygen/physicsserver/int/colliderint.h trunk/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h trunk/spark/lib/oxygen/physicsserver/int/fixedjointint.h trunk/spark/lib/oxygen/physicsserver/int/hinge2jointint.h trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h trunk/spark/lib/oxygen/physicsserver/int/jointint.h trunk/spark/lib/oxygen/physicsserver/int/physicsobjectint.h trunk/spark/lib/oxygen/physicsserver/int/physicsserverint.h trunk/spark/lib/oxygen/physicsserver/int/planecolliderint.h trunk/spark/lib/oxygen/physicsserver/int/raycolliderint.h trunk/spark/lib/oxygen/physicsserver/int/rigidbodyint.h trunk/spark/lib/oxygen/physicsserver/int/sliderjointint.h trunk/spark/lib/oxygen/physicsserver/int/spaceint.h trunk/spark/lib/oxygen/physicsserver/int/spherecolliderint.h trunk/spark/lib/oxygen/physicsserver/int/transformcolliderint.h trunk/spark/lib/oxygen/physicsserver/int/universaljointint.h trunk/spark/lib/oxygen/physicsserver/int/worldint.h Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/ChangeLog 2012-05-19 18:40:58 UTC (rev 313) @@ -1,5 +1,28 @@ 2012-05-19 Hedayat Vatankhah <hed...@gm...> + * lib/oxygen/physicsserver/int/angularmotorint.h: + * lib/oxygen/physicsserver/int/balljointint.h: + * lib/oxygen/physicsserver/int/boxcolliderint.h: + * lib/oxygen/physicsserver/int/capsulecolliderint.h: + * lib/oxygen/physicsserver/int/colliderint.h: + * lib/oxygen/physicsserver/int/contactjointhandlerint.h: + * lib/oxygen/physicsserver/int/fixedjointint.h: + * lib/oxygen/physicsserver/int/hinge2jointint.h: + * lib/oxygen/physicsserver/int/hingejointint.h: + * lib/oxygen/physicsserver/int/jointint.h: + * lib/oxygen/physicsserver/int/physicsobjectint.h: + * lib/oxygen/physicsserver/int/physicsserverint.h: + * lib/oxygen/physicsserver/int/planecolliderint.h: + * lib/oxygen/physicsserver/int/raycolliderint.h: + * lib/oxygen/physicsserver/int/rigidbodyint.h: + * lib/oxygen/physicsserver/int/sliderjointint.h: + * lib/oxygen/physicsserver/int/spaceint.h: + * lib/oxygen/physicsserver/int/spherecolliderint.h: + * lib/oxygen/physicsserver/int/transformcolliderint.h: + * lib/oxygen/physicsserver/int/universaljointint.h: + * lib/oxygen/physicsserver/int/worldint.h: + - added virtual distructor + * NEWS: * CMakeLists.txt: - updated for 0.2.3 release Modified: trunk/spark/lib/oxygen/physicsserver/int/angularmotorint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/angularmotorint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/angularmotorint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -40,34 +40,36 @@ class OXYGEN_API AngularMotorInt { public: + virtual ~AngularMotorInt() {} + /** 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 + 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 @@ -79,25 +81,25 @@ 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 Modified: trunk/spark/lib/oxygen/physicsserver/int/balljointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/balljointint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/balljointint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -33,27 +33,28 @@ class OXYGEN_API BallJointInt { -public: +public: + virtual ~BallJointInt() {} /** 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; - - /** Creates a new BallJoint in the physics world specified + + /** Creates a new BallJoint in the physics world specified by \param worldID */ virtual long CreateBallJoint(long worldID) = 0; Modified: trunk/spark/lib/oxygen/physicsserver/int/boxcolliderint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -32,20 +32,22 @@ class OXYGEN_API BoxColliderInt { -public: +public: + virtual ~BoxColliderInt() {} + /** 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: trunk/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -32,6 +32,7 @@ class OXYGEN_API CapsuleColliderInt { public: + virtual ~CapsuleColliderInt() {} /** sets the parameters of the capsule. @@ -39,29 +40,29 @@ \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: trunk/spark/lib/oxygen/physicsserver/int/colliderint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/colliderint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/colliderint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -36,58 +36,60 @@ { public: + virtual ~ColliderInt() {} + /** Gets the pointer to the Collider object that manages the geom specified by geomID. */ 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 + + /** 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 + + /** 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 */ Modified: trunk/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -31,103 +31,105 @@ class OXYGEN_API ContactJointHandlerInt { -public: +public: + virtual ~ContactJointHandlerInt() {} + /** 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. */ + \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, + 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 + /** 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; Modified: trunk/spark/lib/oxygen/physicsserver/int/fixedjointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -27,11 +27,13 @@ class OXYGEN_API FixedJointInt{ public: - /** Creates a fixed joint within the physics world specified + virtual ~FixedJointInt() {} + + /** 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 */ Modified: trunk/spark/lib/oxygen/physicsserver/int/hinge2jointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -28,11 +28,13 @@ class OXYGEN_API Hinge2JointInt{ public: - /** Creates a hinge2joint within the physics world specified + virtual ~Hinge2JointInt() {} + + /** 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. @@ -41,28 +43,28 @@ 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: trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/hingejointint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -28,43 +28,45 @@ class OXYGEN_API HingeJointInt{ public: + virtual ~HingeJointInt() {} + /** 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: trunk/spark/lib/oxygen/physicsserver/int/jointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/jointint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/jointint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -37,6 +37,8 @@ class OXYGEN_API JointInt { public: + virtual ~JointInt() {} + /** Returns a pointer to the Joint object that manages the joint specified by \param jointID. */ Modified: trunk/spark/lib/oxygen/physicsserver/int/physicsobjectint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/physicsobjectint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/physicsobjectint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -35,6 +35,8 @@ { public: + virtual ~PhysicsObjectInt() {} + /** converts the rotation part of a salt::Matrix to an engine-specific matrix that arranges the values in a different way */ Modified: trunk/spark/lib/oxygen/physicsserver/int/physicsserverint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/physicsserverint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/physicsserverint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -29,8 +29,9 @@ { class OXYGEN_API PhysicsServerInt -{ +{ public: + virtual ~PhysicsServerInt() {} /** Initialises the physics engine */ virtual void InitEngine() = 0; Modified: trunk/spark/lib/oxygen/physicsserver/int/planecolliderint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/planecolliderint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/planecolliderint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -33,23 +33,25 @@ class OXYGEN_API PlaneColliderInt { public: + virtual ~PlaneColliderInt() {} + /** 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: trunk/spark/lib/oxygen/physicsserver/int/raycolliderint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/raycolliderint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/raycolliderint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -32,14 +32,16 @@ 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: + virtual ~RayColliderInt() {} + /** Sets the parameters of the ray. * * \param pos starting position of the ray @@ -47,7 +49,7 @@ * \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: trunk/spark/lib/oxygen/physicsserver/int/rigidbodyint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -34,11 +34,13 @@ { public: - /** Returns a pointer to the abstract RigidBody object that + virtual ~RigidBodyInt() {} + + /** 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 @@ -47,84 +49,84 @@ 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 + 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 @@ -132,14 +134,14 @@ 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 @@ -147,14 +149,14 @@ 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 @@ -163,14 +165,14 @@ 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 @@ -179,85 +181,85 @@ 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 */ virtual void TranslateMass(const salt::Vector3f& v, long bodyID) = 0; - + /** returns the current linear velocity vector of this body */ virtual salt::Vector3f GetVelocity(long bodyID) const = 0; - + /** sets the current linear velocity of this body */ virtual void SetVelocity(const salt::Vector3f& vel, long bodyID) = 0; - + /** sets the roation of this body */ virtual void SetRotation(const salt::Matrix& rot, long bodyID) = 0; - + /** gets the rotation of this body */ virtual salt::Matrix GetRotation(long bodyID) const = 0; - + /** returns the current angular velocity of this body in local coordinates */ virtual salt::Vector3f GetLocalAngularVelocity(long bodyID) const = 0; - + /** returns the current angular velocity of this body */ virtual salt::Vector3f GetAngularVelocity(long bodyID) const = 0; - + /** sets the current angular velocity of this body */ virtual void SetAngularVelocity(const salt::Vector3f& vel, long bodyID) = 0; - + /** applies a force to the managed body */ virtual void AddForce(const salt::Vector3f& force, long bodyID) = 0; - + /** returns the total force applied to this body */ virtual salt::Vector3f GetForce(long bodyID) const = 0; - + /** aplies a force to the managed body */ virtual void AddTorque(const salt::Vector3f& torque, long bodyID) = 0; - + /** sets the position of the managed body */ virtual void SetPosition(const salt::Vector3f& pos, long bodyID) = 0; - + /** returns the current poosition of this body */ virtual salt::Vector3f GetPosition(long bodyID) const = 0; - + /** destroys the rigid body specified by \param bodyID */ virtual void DestroyRigidBody(long bodyID) = 0; - + /** Gets the matrix needed by the SynchronizeParent method */ virtual salt::Matrix GetSynchronisationMatrix(long bodyID) = 0; - - /** Links the rigid body specified by \param bodyID with the + + /** Links the rigid body specified by \param bodyID with the abstract RigidBody object managing it. This allows retrieving it at a later point. */ virtual void BodySetData(RigidBody* rb, long bodyID) = 0; - + /** Returns a pointer to the abstract RigidBody object managing - the rigid body specified by \param bodyID + the rigid body specified by \param bodyID */ virtual RigidBody* BodyGetData(long bodyID) = 0; - + /** Creates a new rigid body within the physics world specified by \param worldID - */ + */ virtual long CreateBody(long worldID) = 0; - + /** Creates a new mass object with the information passed on to this method via \param mass and \param cVector */ virtual GenericMass& CreateMass(float mass, salt::Vector3f cVector) = 0; - + /** Sets the value of the inertia tensor of this body. \param i is the index of the \param value 's position in the inertia tensor. (It's a 3x3 matrix) */ - virtual void SetInertiaTensorAt(int i, float value, GenericMass& mass) = 0; + virtual void SetInertiaTensorAt(int i, float value, GenericMass& mass) = 0; }; } //namespace oxygen Modified: trunk/spark/lib/oxygen/physicsserver/int/sliderjointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/sliderjointint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/sliderjointint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -33,6 +33,8 @@ class OXYGEN_API SliderJointInt { public: + virtual ~SliderJointInt() {} + /** Creates a Slider Joint within the given world */ virtual long CreateSliderJoint(long world) = 0; Modified: trunk/spark/lib/oxygen/physicsserver/int/spaceint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/spaceint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/spaceint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -38,53 +38,55 @@ { public: + virtual ~SpaceInt() {} + virtual long CreateSpace(long spaceID) = 0; - - /** Destroys the space specified by \param spaceID and the + + /** Destroys the space specified by \param spaceID and the contact group specified by \param contactGroup */ virtual void DestroySpace(long contactGroup, long spaceID) = 0; - + /** returns the ID of the containing parent space */ virtual long GetParentSpaceID(long spaceID) = 0; - + /** calls collision detection for this space if internal collision detection is enabled for this space. */ virtual void Collide(long space, Space* callee) = 0; - + /** collide all geoms internal to the space \param callee */ - virtual void Collide2(long obj1, long obj2, Space* callee) = 0; - + virtual void Collide2(long obj1, long obj2, Space* callee) = 0; + /** Creates a Contact Group and returns its ID */ virtual long CreateContactGroup() = 0; - + /** updates internal state after physics calculation */ virtual void PostPhysicsUpdateInternal(long contactGroup) = 0; - - /** Returns true if the physics object specified - by \param objectID is a space - */ + + /** Returns true if the physics object specified + by \param objectID is a space + */ virtual bool ObjectIsSpace(long objectID) = 0; - + /** Retrieves the ID of the body that the geom specified - by \param geomID is linked with + by \param geomID is linked with */ virtual long FetchBody(long geomID) = 0; - + /** Retrieves the ID of the space that the geom specified by \param geomID is inside of */ virtual long FetchSpace(long geomID) = 0; - + /** Returns true if the two bodies specified by \param bodyID1 and \param bodyID2 are connected with a joint */ virtual bool AreConnectedWithJoint(long bodyID1, long bodyID2) = 0; - /** Collides the two geoms managed by \param collider + /** Collides the two geoms managed by \param collider and \param collidee */ - virtual void CollideInternal(boost::shared_ptr<Collider> collider, + virtual void CollideInternal(boost::shared_ptr<Collider> collider, boost::shared_ptr<Collider> collidee, long geomID1, long geomID2) = 0; }; Modified: trunk/spark/lib/oxygen/physicsserver/int/spherecolliderint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/spherecolliderint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/spherecolliderint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -32,22 +32,24 @@ class OXYGEN_API SphereColliderInt { -public: +public: + virtual ~SphereColliderInt() {} + /** sets the radius of the managed sphere geom */ virtual void SetRadius(float r, long geomID) = 0; - + /** get the radius of this sphere */ virtual float GetRadius(long geomID) const = 0; - + /** returns the depth of the given relative position in the managed sphere. 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 sphere and returns its ID */ - virtual long CreateSphere() = 0; + virtual long CreateSphere() = 0; }; } //namespace oxygen Modified: trunk/spark/lib/oxygen/physicsserver/int/transformcolliderint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/transformcolliderint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/transformcolliderint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -48,11 +48,13 @@ they allow multiple displaced geoms to be connected to one body. */ -public: +public: + virtual ~TransformColliderInt() {} + /** Creates a new TransformCollider and returns its ID */ virtual long CreateTransformCollider() = 0; - - /** Set the parameters /param cleanup and /param info of the + + /** Set the parameters /param cleanup and /param info of the transformcollider specified by \param geomID */ virtual void SetColliderParameters(int cleanup, int info, long geomID) = 0; Modified: trunk/spark/lib/oxygen/physicsserver/int/universaljointint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/universaljointint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/universaljointint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -32,65 +32,67 @@ class OXYGEN_API UniversalJointInt { -public: +public: + virtual ~UniversalJointInt() {} + /** Creates a Universal Joint and returns its ID */ virtual long CreateUniversalJoint(long world) = 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; - + /** This function sets up the first axis of the joint \param axis a vector describing the axis in relative coordinates */ virtual void SetAxis1(const salt::Vector3f& axis, long jointID) = 0; - + /** This function sets up the second axis of the joint \param axis a vector describing the axis in local coordinates */ virtual void SetAxis2(const salt::Vector3f& axis, long jointID) = 0; - + /** returns the vector describing the first of the two axis (in local coordinates) \param idx index of the desired axis */ virtual salt::Vector3f GetAxis1(long jointID) const = 0; - + /** returns the vector describing the second of the two axis (in local coordinates) \param idx index of the desired axis */ virtual salt::Vector3f GetAxis2(long jointID) const = 0; - + /** returns the first axis' angles in degrees, measured between the two bodies, or between the body and the static environment. */ virtual float GetAngle1(long jointID) const = 0; - + /** returns the second axis' angles in degrees, measured between the two bodies, or between the body and the static environment. */ virtual float GetAngle2(long jointID) const = 0; - + /** returns the time derivate of the first of the hinge angles */ virtual float GetAngleRate1(long jointID) const = 0; - + /** returns the time derivate of the second of the hinge angles */ virtual float GetAngleRate2(long jointID) const = 0; }; Modified: trunk/spark/lib/oxygen/physicsserver/int/worldint.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/int/worldint.h 2012-05-19 18:17:11 UTC (rev 312) +++ trunk/spark/lib/oxygen/physicsserver/int/worldint.h 2012-05-19 18:40:58 UTC (rev 313) @@ -37,14 +37,16 @@ time, thus one reason to use separate worlds is to simulate systems at different rates. */ - + public: + virtual ~WorldInt() {} + /** sets the gravity vector of this world */ virtual void SetGravity(const salt::Vector3f& gravity, long worldID) = 0; - + /** gets the gravity vector of this world */ virtual salt::Vector3f GetGravity(long worldID) const = 0; - + /** sets the Error Reduction Parameter of this world. The ERP specifies what proportion of a joint error will be fixed during the next simulation step. if ERP=0 then no correcting @@ -57,10 +59,10 @@ is the default). */ virtual void SetERP(float erp, long worldID) = 0; - + /** returns the Error Reduction Parameter of this World. */ virtual float GetERP(long worldID) const = 0; - + /** sets the Constraint Force mixing (CFM) value. If CFM is set to zero, the constraint will be hard. If CFM is set to a positive value, it will be possible to violate the constraint by @@ -71,18 +73,18 @@ have undesirable bad effects, such as instability. */ virtual void SetCFM(float cfm, long worldID) = 0; - + /** returns the Constraint Force mixing (CFM) value. */ virtual float GetCFM(long worldID) const = 0; - + /** steps the world deltatime forward, i.e. performs physics simulation for a deltaTime seconds interval. */ virtual void Step(float deltaTime, long worldID) = 0; - + virtual bool GetAutoDisableFlag(long worldID) const = 0; virtual void SetAutoDisableFlag(bool flag, long worldID) = 0; - + /** Set and get the depth of the surface layer around all geometry objects. Contacts are allowed to sink into the surface layer up to the given depth before coming to rest. The default value is @@ -92,10 +94,10 @@ */ virtual void SetContactSurfaceLayer(float depth, long worldID) = 0; virtual float GetContactSurfaceLayer(long worldID) const = 0; - + /** Create the world an return its ID */ virtual long CreateWorld() = 0; - + /** destroys the world */ virtual void DestroyWorld(long worldID) = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |