From: <a-...@us...> - 2010-01-06 07:25:08
|
Revision: 137 http://simspark.svn.sourceforge.net/simspark/?rev=137&view=rev Author: a-held Date: 2010-01-06 07:25:00 +0000 (Wed, 06 Jan 2010) Log Message: ----------- Don't store GeomIDs or JointIDs internally anymore Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.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/fixedjointint.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/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/spherecolliderint.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/ode/odeballjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.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/odefixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.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/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.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/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/planecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -49,7 +49,7 @@ { // calculate anchor position in world coordinates Vector3f gAnchor = GetWorldTransform() * anchor; - mBallJointImp->SetAnchor(gAnchor); + mBallJointImp->SetAnchor(gAnchor, mJointID); } Vector3f BallJoint::GetAnchor(EBodyIndex idx) @@ -60,13 +60,13 @@ { case BI_FIRST: { - pos = mBallJointImp->GetAnchor1(); + pos = mBallJointImp->GetAnchor1(mJointID); break; } case BI_SECOND: { - pos = mBallJointImp->GetAnchor2(); + pos = mBallJointImp->GetAnchor2(mJointID); break; } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -33,7 +33,7 @@ void BoxCollider::SetBoxLengths(const Vector3f& extents) { - mBoxColliderImp->SetBoxLengths(extents); + mBoxColliderImp->SetBoxLengths(extents, mGeomID); } bool BoxCollider::ConstructInternal() @@ -51,7 +51,7 @@ void BoxCollider::GetBoxLengths(Vector3f& extents) { - mBoxColliderImp->GetBoxLengths(extents); + mBoxColliderImp->GetBoxLengths(extents, mGeomID); } float BoxCollider::GetBoxLength(int axis) @@ -72,5 +72,5 @@ float BoxCollider::GetPointDepth(const Vector3f& pos) { Vector3f worldPos(GetWorldTransform() * pos); - return mBoxColliderImp->GetPointDepth(worldPos); + return mBoxColliderImp->GetPointDepth(worldPos, mGeomID); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -32,32 +32,32 @@ void CapsuleCollider::SetParams(float radius, float length) { - mCapsuleColliderImp->SetParams(radius, length); + mCapsuleColliderImp->SetParams(radius, length, mGeomID); } void CapsuleCollider::SetRadius(float radius) { - mCapsuleColliderImp->SetRadius(radius); + mCapsuleColliderImp->SetRadius(radius, mGeomID); } void CapsuleCollider::SetLength(float length) { - mCapsuleColliderImp->SetLength(length); + mCapsuleColliderImp->SetLength(length, mGeomID); } void CapsuleCollider::GetParams(float& radius, float& length) { - mCapsuleColliderImp->GetParams(radius, length); + mCapsuleColliderImp->GetParams(radius, length, mGeomID); } float CapsuleCollider::GetRadius() { - return mCapsuleColliderImp->GetRadius(); + return mCapsuleColliderImp->GetRadius(mGeomID); } float CapsuleCollider::GetLength() { - return mCapsuleColliderImp->GetLength(); + return mCapsuleColliderImp->GetLength(mGeomID); } bool CapsuleCollider::ConstructInternal() @@ -75,5 +75,5 @@ float CapsuleCollider::GetPointDepth(const Vector3f& pos) { Vector3f worldPos(GetWorldTransform() * pos); - return mCapsuleColliderImp->GetPointDepth(worldPos); + return mCapsuleColliderImp->GetPointDepth(worldPos, mGeomID); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -45,18 +45,18 @@ void FixedJoint::SetParameter(int /*parameter*/, float /*value*/) { - GetLog()->Error() << + GetLog()->Warning() << "(FixedJoint) WARNING: SetParameter function undefined for FixedJoint, ignored\n"; } float FixedJoint::GetParameter(int /*parameter*/) const { - GetLog()->Error() << + GetLog()->Warning() << "(FixedJoint) WARNING: GetParameter function undefined for FixedJoint, returned zero\n"; return 0; } void FixedJoint::SetFixed() { - mFixedJointImp->SetFixed(); + mFixedJointImp->SetFixed(mJointID); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -56,7 +56,7 @@ // relative universal hinge2 axis 2 points right Vector3f right(GetWorldTransform().Rotate(Vector3f(1,0,0))); - mHinge2JointImp->SetAnchor(gAnchor, up, right); + mHinge2JointImp->SetAnchor(gAnchor, up, right, mJointID); } Vector3f Hinge2Joint::GetAnchor(EBodyIndex idx) @@ -67,12 +67,12 @@ { case BI_FIRST: { - pos = mHinge2JointImp->GetAnchor1(); + pos = mHinge2JointImp->GetAnchor1(mJointID); } case BI_SECOND: { - pos = mHinge2JointImp->GetAnchor2(); + pos = mHinge2JointImp->GetAnchor2(mJointID); } default: @@ -87,10 +87,10 @@ switch (idx) { case AI_FIRST: - return mHinge2JointImp->GetAngle(); + return mHinge2JointImp->GetAngle(mJointID); case AI_SECOND: - GetLog()->Error() << + GetLog()->Warning() << "(Hinge2Joint) WARNING: GetAngle is undefined for EAxisIndex::AI_SECOND, returned zero\n"; return 0; @@ -104,10 +104,10 @@ switch (idx) { case AI_FIRST: - return mHinge2JointImp->GetAngleRate1(); + return mHinge2JointImp->GetAngleRate1(mJointID); case AI_SECOND: - return mHinge2JointImp->GetAngleRate2(); + return mHinge2JointImp->GetAngleRate2(mJointID); default: return 0; @@ -116,10 +116,10 @@ void Hinge2Joint::SetParameter(int parameter, float value) { - mHinge2JointImp->SetParameter(parameter, value); + mHinge2JointImp->SetParameter(parameter, value, mJointID); } float Hinge2Joint::GetParameter(int parameter) const { - return mHinge2JointImp->GetParameter(parameter); + return mHinge2JointImp->GetParameter(parameter, mJointID); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -49,7 +49,7 @@ { // calculate anchor position in world coordinates Vector3f gAnchor(GetWorldTransform() * anchor); - mHingeJointImp->SetAnchor(gAnchor); + mHingeJointImp->SetAnchor(gAnchor, mJointID); } Vector3f HingeJoint::GetAnchor(EBodyIndex idx) @@ -60,13 +60,13 @@ { case BI_FIRST: { - pos = mHingeJointImp->GetAnchor1(); + pos = mHingeJointImp->GetAnchor1(mJointID); break; } case BI_SECOND: { - pos = mHingeJointImp->GetAnchor2(); + pos = mHingeJointImp->GetAnchor2(mJointID); break; } @@ -107,30 +107,30 @@ void HingeJoint::SetAxis(const Vector3f& axis) { Vector3f absAxis(GetWorldTransform().Rotate(axis)); - mHingeJointImp->SetAxis(absAxis); + mHingeJointImp->SetAxis(absAxis, mJointID); } Vector3f HingeJoint::GetAxis() { - return mHingeJointImp->GetAxis(); + return mHingeJointImp->GetAxis(mJointID); } float HingeJoint::GetAngle() const { - return mHingeJointImp->GetAngle(); + return mHingeJointImp->GetAngle(mJointID); } float HingeJoint::GetAngleRate() const { - return mHingeJointImp->GetAngleRate(); + return mHingeJointImp->GetAngleRate(mJointID); } void HingeJoint::SetParameter(int parameter, float value) { - mHingeJointImp->SetParameter(parameter, value); + mHingeJointImp->SetParameter(parameter, value, mJointID); } float HingeJoint::GetParameter(int parameter) const { - return mHingeJointImp->GetParameter(parameter); + return mHingeJointImp->GetParameter(parameter, mJointID); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -34,9 +34,9 @@ class OXYGEN_API BallJointInt { public: - virtual void SetAnchor(const salt::Vector3f& anchor) = 0; - virtual salt::Vector3f GetAnchor1() = 0; - virtual salt::Vector3f GetAnchor2() = 0; + virtual void SetAnchor(const salt::Vector3f& anchor, long jointID) = 0; + virtual salt::Vector3f GetAnchor1(long jointID) = 0; + virtual salt::Vector3f GetAnchor2(long jointID) = 0; virtual long CreateBallJoint(long world) = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -33,9 +33,9 @@ { public: - virtual void SetBoxLengths(const salt::Vector3f& extents) = 0; - virtual void GetBoxLengths(salt::Vector3f& extents) = 0; - virtual float GetPointDepth(const salt::Vector3f& pos) = 0; + virtual void SetBoxLengths(const salt::Vector3f& extents, long geomID) = 0; + virtual void GetBoxLengths(salt::Vector3f& extents, long geomID) = 0; + virtual float GetPointDepth(const salt::Vector3f& pos, long geomID) = 0; virtual long CreateBox() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -32,13 +32,13 @@ class OXYGEN_API CapsuleColliderInt { public: - virtual void SetParams(float radius, float length) = 0; - virtual void SetRadius(float radius) = 0; - virtual void SetLength(float length) = 0; - virtual void GetParams(float& radius, float& length) = 0; - virtual float GetRadius() = 0; - virtual float GetLength() = 0; - virtual float GetPointDepth(const salt::Vector3f& pos) = 0; + virtual void SetParams(float radius, float length, long geomID) = 0; + virtual void SetRadius(float radius, long geomID) = 0; + virtual void SetLength(float length, long geomID) = 0; + virtual void GetParams(float& radius, float& length, long geomID) = 0; + virtual float GetRadius(long geomID) = 0; + virtual float GetLength(long geomID) = 0; + virtual float GetPointDepth(const salt::Vector3f& pos, long geomID) = 0; virtual long CreateCapsule() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -28,7 +28,7 @@ public: virtual long CreateFixedJoint(long world) = 0; - virtual void SetFixed() = 0; + virtual void SetFixed(long jointID) = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -31,14 +31,15 @@ virtual long CreateHinge2Joint(long world) = 0; virtual void SetAnchor(const salt::Vector3f& anchor, const salt::Vector3f& up, - const salt::Vector3f& right) = 0; - virtual salt::Vector3f GetAnchor1() = 0; - virtual salt::Vector3f GetAnchor2() = 0; - virtual float GetAngle() = 0; - virtual float GetAngleRate1() = 0; - virtual float GetAngleRate2() = 0; - virtual void SetParameter(int parameter, float value) = 0; - virtual float GetParameter(int parameter) const = 0; + const salt::Vector3f& right, + long jointID) = 0; + virtual salt::Vector3f GetAnchor1(long jointID) = 0; + virtual salt::Vector3f GetAnchor2(long jointID) = 0; + virtual float GetAngle(long jointID) = 0; + virtual float GetAngleRate1(long jointID) = 0; + virtual float GetAngleRate2(long jointID) = 0; + virtual void SetParameter(int parameter, float value, long jointID) = 0; + virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -29,15 +29,15 @@ public: virtual long CreateHingeJoint(long world) = 0; - virtual void SetAnchor(const salt::Vector3f& anchor) = 0; - virtual salt::Vector3f GetAnchor1() = 0; - virtual salt::Vector3f GetAnchor2() = 0; - virtual void SetAxis(const salt::Vector3f& axis) = 0; - virtual salt::Vector3f GetAxis() = 0; - virtual float GetAngle() const = 0; - virtual float GetAngleRate() const = 0; - virtual void SetParameter(int parameter, float value) = 0; - virtual float GetParameter(int parameter) const = 0; + virtual void SetAnchor(const salt::Vector3f& anchor, long jointID) = 0; + virtual salt::Vector3f GetAnchor1(long jointID) = 0; + virtual salt::Vector3f GetAnchor2(long jointID) = 0; + virtual void SetAxis(const salt::Vector3f& axis, long jointID) = 0; + virtual salt::Vector3f GetAxis(long jointID) = 0; + virtual float GetAngle(long jointID) const = 0; + virtual float GetAngleRate(long jointID) const = 0; + virtual void SetParameter(int parameter, float value, long jointID) = 0; + virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -33,9 +33,9 @@ class OXYGEN_API PlaneColliderInt { public: - virtual void SetPlaneParams(float a, float b, float c, float d) = 0; - virtual void SetParams(const salt::Vector3f& pos, salt::Vector3f normal) = 0; - virtual float GetPointDepth(const salt::Vector3f& pos) = 0; + virtual void SetPlaneParams(float a, float b, float c, float d, long geomID) = 0; + virtual void SetParams(const salt::Vector3f& pos, salt::Vector3f normal, long geomID) = 0; + virtual float GetPointDepth(const salt::Vector3f& pos, long geomID) = 0; virtual long CreatePlane() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -32,7 +32,7 @@ class OXYGEN_API RayColliderInt { public: - virtual void SetParams(salt::Vector3f pos, salt::Vector3f dir, float length) = 0; + virtual void SetParams(salt::Vector3f pos, salt::Vector3f dir, float length, long geomID) = 0; virtual long CreateRay() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -42,21 +42,29 @@ virtual void SetMassParameters(const GenericMass& mass, long bodyID) = 0; virtual float GetMass(long bodyID) const = 0; virtual void SetSphere(float density, float radius, long bodyID) = 0; - virtual salt::Vector3f AddSphere(float density, float radius, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddSphere(float density, float radius, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void SetSphereTotal(float total_mass, float radius, long bodyID) = 0; - virtual salt::Vector3f AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void SetBox(float density, const salt::Vector3f& size, long bodyID) = 0; - virtual salt::Vector3f AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void SetBoxTotal(float total_mass, const salt::Vector3f& size, long bodyID) = 0; - virtual salt::Vector3f AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void SetCylinder(float density, float radius, float length, long bodyID) = 0; - virtual salt::Vector3f AddCylinder(float density, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddCylinder(float density, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void SetCylinderTotal(float total_mass, float radius, float length, long bodyID) = 0; - virtual salt::Vector3f AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void SetCapsule(float density, float radius, float length, long bodyID) = 0; - virtual salt::Vector3f AddCapsule(float density, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddCapsule(float density, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void SetCapsuleTotal(float total_mass, float radius, float length, long bodyID) = 0; - virtual salt::Vector3f AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID) = 0; + virtual salt::Vector3f AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID) = 0; virtual void TranslateMass(const salt::Vector3f& v, long bodyID) = 0; virtual salt::Vector3f GetVelocity(long bodyID) const = 0; virtual void SetVelocity(const salt::Vector3f& vel, long bodyID) = 0; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -34,11 +34,11 @@ { public: virtual long CreateSliderJoint(long world) = 0; - virtual float GetPosition() = 0; - virtual float GetPositionRate() = 0; - virtual void SetSliderAxis(salt::Vector3f& up) = 0; - virtual void SetParameter(int parameter, float value) = 0; - virtual float GetParameter(int parameter) const = 0; + virtual float GetPosition(long jointID) = 0; + virtual float GetPositionRate(long jointID) = 0; + virtual void SetSliderAxis(salt::Vector3f& up, long jointID) = 0; + virtual void SetParameter(int parameter, float value, long jointID) = 0; + virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -33,9 +33,9 @@ { public: - virtual void SetRadius(float r) = 0; - virtual float GetRadius() const = 0; - virtual float GetPointDepth(const salt::Vector3f& pos) = 0; + virtual void SetRadius(float r, long geomID) = 0; + virtual float GetRadius(long geomID) const = 0; + virtual float GetPointDepth(const salt::Vector3f& pos, long geomID) = 0; virtual long CreateSphere() = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -36,7 +36,7 @@ public: virtual long CreateTransformCollider() = 0; - virtual void SetColliderParameters(int cleanup, int info) = 0; + virtual void SetColliderParameters(int cleanup, int info, long geomID) = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -34,19 +34,19 @@ public: virtual long CreateUniversalJoint(long world) = 0; - virtual void SetAnchor(const salt::Vector3f& anchor) = 0; - virtual salt::Vector3f GetAnchor1() = 0; - virtual salt::Vector3f GetAnchor2() = 0; - virtual void SetAxis1(const salt::Vector3f& axis) = 0; - virtual void SetAxis2(const salt::Vector3f& axis) = 0; - virtual salt::Vector3f GetAxis1() const = 0; - virtual salt::Vector3f GetAxis2() const = 0; - virtual float GetAngle1() const = 0; - virtual float GetAngle2() const = 0; - virtual float GetAngleRate1() const = 0; - virtual float GetAngleRate2() const = 0; - virtual void SetParameter(int parameter, float value) = 0; - virtual float GetParameter(int parameter) const = 0; + virtual void SetAnchor(const salt::Vector3f& anchor, long jointID) = 0; + virtual salt::Vector3f GetAnchor1(long jointID) = 0; + virtual salt::Vector3f GetAnchor2(long jointID) = 0; + virtual void SetAxis1(const salt::Vector3f& axis, long jointID) = 0; + virtual void SetAxis2(const salt::Vector3f& axis, long jointID) = 0; + virtual salt::Vector3f GetAxis1(long jointID) const = 0; + virtual salt::Vector3f GetAxis2(long jointID) const = 0; + virtual float GetAngle1(long jointID) const = 0; + virtual float GetAngle2(long jointID) const = 0; + virtual float GetAngleRate1(long jointID) const = 0; + virtual float GetAngleRate2(long jointID) const = 0; + virtual void SetParameter(int parameter, float value, long jointID) = 0; + virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -31,28 +31,31 @@ long ODEBallJoint::CreateBallJoint(long world) { dWorldID ODEWorld = (dWorldID) world; - mODEJoint = dJointCreateBall(ODEWorld, 0); - return (long) mODEJoint; + dJointID ODEJoint = dJointCreateBall(ODEWorld, 0); + return (long) ODEJoint; } -void ODEBallJoint::SetAnchor(const Vector3f& gAnchor) +void ODEBallJoint::SetAnchor(const Vector3f& gAnchor, long jointID) { - dJointSetBallAnchor (mODEJoint, gAnchor[0], gAnchor[1], gAnchor[2]); + dJointID ODEJoint = (dJointID) jointID; + dJointSetBallAnchor (ODEJoint, gAnchor[0], gAnchor[1], gAnchor[2]); } -Vector3f ODEBallJoint::GetAnchor1() +Vector3f ODEBallJoint::GetAnchor1(long jointID) { + dJointID ODEJoint = (dJointID) jointID; dReal anchor[3]; - dJointGetBallAnchor (mODEJoint, anchor); + dJointGetBallAnchor (ODEJoint, anchor); Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); return pos; } -Vector3f ODEBallJoint::GetAnchor2() +Vector3f ODEBallJoint::GetAnchor2(long jointID) { + dJointID ODEJoint = (dJointID) jointID; dReal anchor[3]; - dJointGetBallAnchor2(mODEJoint, anchor); + dJointGetBallAnchor2(ODEJoint, anchor); Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); return pos; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -34,9 +34,9 @@ { public: ODEBallJoint(); - void SetAnchor(const salt::Vector3f& anchor); - salt::Vector3f GetAnchor1(); - salt::Vector3f GetAnchor2(); + void SetAnchor(const salt::Vector3f& anchor, long jointID); + salt::Vector3f GetAnchor1(long jointID); + salt::Vector3f GetAnchor2(long jointID); long CreateBallJoint(long world); }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -30,10 +30,11 @@ { } -void ODEBoxCollider::SetBoxLengths(const Vector3f& extents) +void ODEBoxCollider::SetBoxLengths(const Vector3f& extents, long geomID) { + dGeomID ODEGeom = (dGeomID) geomID; dGeomBoxSetLengths( - mODEGeom, + ODEGeom, extents[0], extents[1], extents[2] @@ -42,21 +43,23 @@ long ODEBoxCollider::CreateBox() { - mODEGeom = dCreateBox (0, 1.0f, 1.0f, 1.0f); - return (long) mODEGeom; + dGeomID ODEGeom = dCreateBox (0, 1.0f, 1.0f, 1.0f); + return (long) ODEGeom; } -void ODEBoxCollider::GetBoxLengths(Vector3f& extents) +void ODEBoxCollider::GetBoxLengths(Vector3f& extents, long geomID) { + dGeomID ODEGeom = (dGeomID) geomID; dVector3 lengths; - dGeomBoxGetLengths(mODEGeom,lengths); + dGeomBoxGetLengths(ODEGeom,lengths); extents[0] = lengths[0]; extents[1] = lengths[1]; extents[2] = lengths[2]; } -float ODEBoxCollider::GetPointDepth(const Vector3f& pos) +float ODEBoxCollider::GetPointDepth(const Vector3f& pos, long geomID) { + dGeomID ODEGeom = (dGeomID) geomID; return dGeomBoxPointDepth - (mODEGeom,pos[0],pos[1],pos[2]); + (ODEGeom,pos[0],pos[1],pos[2]); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h 2010-01-06 07:25:00 UTC (rev 137) @@ -34,9 +34,9 @@ { public: ODEBoxCollider(); - void SetBoxLengths(const salt::Vector3f& extents); - void GetBoxLengths(salt::Vector3f& extents); - float GetPointDepth(const salt::Vector3f& pos); + void SetBoxLengths(const salt::Vector3f& extents, long geomID); + void GetBoxLengths(salt::Vector3f& extents, long geomID); + float GetPointDepth(const salt::Vector3f& pos, long geomID); long CreateBox(); }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -28,53 +28,56 @@ { } -void ODECapsuleCollider::SetParams(float radius, float length) +void ODECapsuleCollider::SetParams(float radius, float length, long geomID) { - dGeomCapsuleSetParams (mODEGeom, radius, length); + dGeomID ODEGeom = (dGeomID) geomID; + dGeomCapsuleSetParams (ODEGeom, radius, length); } -void ODECapsuleCollider::SetRadius(float radius) +void ODECapsuleCollider::SetRadius(float radius, long geomID) { - SetParams(radius,GetLength()); + SetParams(radius, GetLength(geomID), geomID); } -void ODECapsuleCollider::SetLength(float length) +void ODECapsuleCollider::SetLength(float length, long geomID) { - SetParams(GetRadius(),length); + SetParams(GetRadius(geomID), length, geomID); } -void ODECapsuleCollider::GetParams(float& radius, float& length) +void ODECapsuleCollider::GetParams(float& radius, float& length, long geomID) { + dGeomID ODEGeom = (dGeomID) geomID; dReal r,l; - dGeomCapsuleGetParams(mODEGeom,&r,&l); + dGeomCapsuleGetParams(ODEGeom,&r,&l); radius = r; length = l; } -float ODECapsuleCollider::GetRadius() +float ODECapsuleCollider::GetRadius(long geomID) { float length; float radius; - GetParams(radius,length); + GetParams(radius, length, geomID); return radius; } -float ODECapsuleCollider::GetLength() +float ODECapsuleCollider::GetLength(long geomID) { float radius; float length; - GetParams(radius,length); + GetParams(radius, length, geomID); return length; } long ODECapsuleCollider::CreateCapsule() { - mODEGeom = dCreateCapsule(0, 1.0f, 1.0f); - return (long) mODEGeom; + dGeomID ODEGeom = dCreateCapsule(0, 1.0f, 1.0f); + return (long) ODEGeom; } -float ODECapsuleCollider::GetPointDepth(const Vector3f& pos) +float ODECapsuleCollider::GetPointDepth(const Vector3f& pos, long geomID) { + dGeomID ODEGeom = (dGeomID) geomID; return dGeomCapsulePointDepth - (mODEGeom,pos[0],pos[1],pos[2]); + (ODEGeom,pos[0],pos[1],pos[2]); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.h 2010-01-06 07:25:00 UTC (rev 137) @@ -35,13 +35,13 @@ public: ODECapsuleCollider(); - void SetParams(float radius, float length); - void SetRadius(float radius); - void SetLength(float length); - void GetParams(float& radius, float& length); - float GetRadius(); - float GetLength(); - float GetPointDepth(const salt::Vector3f& pos); + void SetParams(float radius, float length, long geomID); + void SetRadius(float radius, long geomID); + void SetLength(float length, long geomID); + void GetParams(float& radius, float& length, long geomID); + float GetRadius(long geomID); + float GetLength(long geomID); + float GetPointDepth(const salt::Vector3f& pos, long geomID); long CreateCapsule(); }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -35,7 +35,7 @@ using namespace boost; using namespace std; -ODECollider::ODECollider() : ODEPhysicsObject(), mODEGeom(0) +ODECollider::ODECollider() : ODEPhysicsObject() { } @@ -95,7 +95,6 @@ { dGeomID ODEGeom = (dGeomID) geomID; dGeomDestroy(ODEGeom); - mODEGeom = 0; } void ODECollider::TransformSetGeom(long parentGeomID, long geomID){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h 2010-01-06 07:25:00 UTC (rev 137) @@ -48,9 +48,6 @@ void SetSpace(long spaceID, long geomID, Collider* collider); void SetBody(long bodyID, long geomID); void RemoveFromSpace(long geomID, long spaceID); - -protected: - dGeomID mODEGeom; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -34,7 +34,8 @@ return (long) mODEJoint; } -void ODEFixedJoint::SetFixed() +void ODEFixedJoint::SetFixed(long jointID) { - dJointSetFixed(mODEJoint); + dJointID ODEJoint = (dJointID) jointID; + dJointSetFixed(ODEJoint); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -31,7 +31,7 @@ public: ODEFixedJoint(); long CreateFixedJoint(long world); - void SetFixed(); + void SetFixed(long jointID); }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -31,56 +31,65 @@ long ODEHinge2Joint::CreateHinge2Joint(long world) { dWorldID ODEWorld = (dWorldID) world; - mODEJoint = dJointCreateHinge2(ODEWorld, 0); - return (long) mODEJoint; + dJointID ODEJoint = dJointCreateHinge2(ODEWorld, 0); + return (long) ODEJoint; } void ODEHinge2Joint::SetAnchor(const Vector3f& gAnchor, const Vector3f& up, - const Vector3f& right) + const Vector3f& right, + long jointID) { - dJointSetHinge2Anchor (mODEJoint, gAnchor[0], gAnchor[1], gAnchor[2]); - dJointSetHinge2Axis1(mODEJoint,up[0],up[1],up[2]); - dJointSetHinge2Axis2(mODEJoint,right[0],right[1],right[2]); + dJointID ODEJoint = (dJointID) jointID; + dJointSetHinge2Anchor (ODEJoint, gAnchor[0], gAnchor[1], gAnchor[2]); + dJointSetHinge2Axis1(ODEJoint,up[0],up[1],up[2]); + dJointSetHinge2Axis2(ODEJoint,right[0],right[1],right[2]); } -Vector3f ODEHinge2Joint::GetAnchor1() +Vector3f ODEHinge2Joint::GetAnchor1(long jointID) { + dJointID ODEJoint = (dJointID) jointID; dReal anchor[3]; - dJointGetHinge2Anchor (mODEJoint, anchor); + dJointGetHinge2Anchor (ODEJoint, anchor); Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); return pos; } -Vector3f ODEHinge2Joint::GetAnchor2() +Vector3f ODEHinge2Joint::GetAnchor2(long jointID) { + dJointID ODEJoint = (dJointID) jointID; dReal anchor[3]; - dJointGetHinge2Anchor2(mODEJoint, anchor); + dJointGetHinge2Anchor2(ODEJoint, anchor); Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); return pos; } -float ODEHinge2Joint::GetAngle() +float ODEHinge2Joint::GetAngle(long jointID) { - return gRadToDeg(dJointGetHinge2Angle1(mODEJoint)); + dJointID ODEJoint = (dJointID) jointID; + return gRadToDeg(dJointGetHinge2Angle1(ODEJoint)); } -float ODEHinge2Joint::GetAngleRate1() +float ODEHinge2Joint::GetAngleRate1(long jointID) { - return gRadToDeg(dJointGetHinge2Angle1Rate(mODEJoint)); + dJointID ODEJoint = (dJointID) jointID; + return gRadToDeg(dJointGetHinge2Angle1Rate(ODEJoint)); } -float ODEHinge2Joint::GetAngleRate2() +float ODEHinge2Joint::GetAngleRate2(long jointID) { - return gRadToDeg(dJointGetHinge2Angle2Rate(mODEJoint)); + dJointID ODEJoint = (dJointID) jointID; + return gRadToDeg(dJointGetHinge2Angle2Rate(ODEJoint)); } -void ODEHinge2Joint::SetParameter(int parameter, float value) +void ODEHinge2Joint::SetParameter(int parameter, float value, long jointID) { - dJointSetHinge2Param(mODEJoint, parameter, value); + dJointID ODEJoint = (dJointID) jointID; + dJointSetHinge2Param(ODEJoint, parameter, value); } -float ODEHinge2Joint::GetParameter(int parameter) const +float ODEHinge2Joint::GetParameter(int parameter, long jointID) const { - return dJointGetHinge2Param(mODEJoint, parameter); + dJointID ODEJoint = (dJointID) jointID; + return dJointGetHinge2Param(ODEJoint, parameter); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -33,14 +33,15 @@ long CreateHinge2Joint(long world); void SetAnchor(const salt::Vector3f& gAnchor, const salt::Vector3f& up, - const salt::Vector3f& right); - salt::Vector3f GetAnchor1(); - salt::Vector3f GetAnchor2(); - float GetAngle(); - float GetAngleRate1(); - float GetAngleRate2(); - void SetParameter(int parameter, float value); - float GetParameter(int parameter) const; + const salt::Vector3f& right, + long jointID); + salt::Vector3f GetAnchor1(long jointID); + salt::Vector3f GetAnchor2(long jointID); + float GetAngle(long jointID); + float GetAngleRate1(long jointID); + float GetAngleRate2(long jointID); + void SetParameter(int parameter, float value, long jointID); + float GetParameter(int parameter, long jointID) const; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -30,61 +30,70 @@ long ODEHingeJoint::CreateHingeJoint(long world) { dWorldID ODEWorld = (dWorldID) world; - mODEJoint = dJointCreateHinge(ODEWorld, 0); - return (long) mODEJoint; + dJointID ODEJoint = dJointCreateHinge(ODEWorld, 0); + return (long) ODEJoint; } -void ODEHingeJoint::SetAnchor(const Vector3f& anchor) +void ODEHingeJoint::SetAnchor(const Vector3f& anchor, long jointID) { - dJointSetHingeAnchor (mODEJoint, anchor[0], anchor[1], anchor[2]); + dJointID ODEJoint = (dJointID) jointID; + dJointSetHingeAnchor (ODEJoint, anchor[0], anchor[1], anchor[2]); } -Vector3f ODEHingeJoint::GetAnchor1() +Vector3f ODEHingeJoint::GetAnchor1(long jointID) { + dJointID ODEJoint = (dJointID) jointID; dReal anchor[3]; - dJointGetHingeAnchor (mODEJoint, anchor); + dJointGetHingeAnchor (ODEJoint, anchor); Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); return pos; } -Vector3f ODEHingeJoint::GetAnchor2() +Vector3f ODEHingeJoint::GetAnchor2(long jointID) { + dJointID ODEJoint = (dJointID) jointID; dReal anchor[3]; - dJointGetHingeAnchor2(mODEJoint, anchor); + dJointGetHingeAnchor2(ODEJoint, anchor); Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); return pos; } -void ODEHingeJoint::SetAxis(const Vector3f& axis) +void ODEHingeJoint::SetAxis(const Vector3f& axis, long jointID) { - dJointSetHingeAxis(mODEJoint, axis[0], axis[1], axis[2]); + dJointID ODEJoint = (dJointID) jointID; + dJointSetHingeAxis(ODEJoint, axis[0], axis[1], axis[2]); } -Vector3f ODEHingeJoint::GetAxis() +Vector3f ODEHingeJoint::GetAxis(long jointID) { + dJointID ODEJoint = (dJointID) jointID; dReal axis[3]; - dJointGetHingeAxis(mODEJoint, axis); + dJointGetHingeAxis(ODEJoint, axis); return Vector3f (axis[0], axis[1], axis[2]); } -float ODEHingeJoint::GetAngle() const +float ODEHingeJoint::GetAngle(long jointID) const { - return gRadToDeg(dJointGetHingeAngle(mODEJoint)); + dJointID ODEJoint = (dJointID) jointID; + return gRadToDeg(dJointGetHingeAngle(ODEJoint)); } -float ODEHingeJoint::GetAngleRate() const +float ODEHingeJoint::GetAngleRate(long jointID) const { - return gRadToDeg(dJointGetHingeAngleRate(mODEJoint)); + dJointID ODEJoint = (dJointID) jointID; + return gRadToDeg(dJointGetHingeAngleRate(ODEJoint)); } -void ODEHingeJoint::SetParameter(int parameter, float value) +void ODEHingeJoint::SetParameter(int parameter, float value, long jointID) { - dJointSetHingeParam(mODEJoint, parameter, value); + dJointID ODEJoint = (dJointID) jointID; + dJointSetHingeParam(ODEJoint, parameter, value); } -float ODEHingeJoint::GetParameter(int parameter) const +float ODEHingeJoint::GetParameter(int parameter, long jointID) const { - return dJointGetHingeParam(mODEJoint, parameter); + dJointID ODEJoint = (dJointID) jointID; + return dJointGetHingeParam(ODEJoint, parameter); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -31,15 +31,15 @@ public: ODEHingeJoint(); long CreateHingeJoint(long world); - void SetAnchor(const salt::Vector3f& anchor); - salt::Vector3f GetAnchor1(); - salt::Vector3f GetAnchor2(); - void SetAxis(const salt::Vector3f& axis); - salt::Vector3f GetAxis(); - float GetAngle() const; - float GetAngleRate() const; - void SetParameter(int parameter, float value); - float GetParameter(int parameter) const; + void SetAnchor(const salt::Vector3f& anchor, long jointID); + salt::Vector3f GetAnchor1(long jointID); + salt::Vector3f GetAnchor2(long jointID); + void SetAxis(const salt::Vector3f& axis, long jointID); + salt::Vector3f GetAxis(long jointID); + float GetAngle(long jointID) const; + float GetAngleRate(long jointID) const; + void SetParameter(int parameter, float value, long jointID); + float GetParameter(int parameter, long jointID) const; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -28,27 +28,30 @@ { } -void ODEPlaneCollider::SetPlaneParams(float a, float b, float c, float d) +void ODEPlaneCollider::SetPlaneParams(float a, float b, float c, float d, long geomID) { - dGeomPlaneSetParams(mODEGeom, a, b, c, d); + dGeomID ODEGeom = (dGeomID) geomID; + dGeomPlaneSetParams(ODEGeom, a, b, c, d); } long ODEPlaneCollider::CreatePlane() { // a plane with normal pointing up, going through the origin - mODEGeom = dCreatePlane(0, 0, 1, 0, 0); - return (long) mODEGeom; + dGeomID ODEGeom = dCreatePlane(0, 0, 1, 0, 0); + return (long) ODEGeom; } -void ODEPlaneCollider::SetParams(const salt::Vector3f& pos, salt::Vector3f normal) +void ODEPlaneCollider::SetParams(const salt::Vector3f& pos, salt::Vector3f normal, long geomID) { + dGeomID ODEGeom = (dGeomID) geomID; normal.Normalize(); float d = pos.Dot(normal); - dGeomPlaneSetParams(mODEGeom, normal.x(), normal.y(), normal.z(), d); + dGeomPlaneSetParams(ODEGeom, normal.x(), normal.y(), normal.z(), d); } -float ODEPlaneCollider::GetPointDepth(const Vector3f& pos) +float ODEPlaneCollider::GetPointDepth(const Vector3f& pos, long geomID) { + dGeomID ODEGeom = (dGeomID) geomID; return dGeomPlanePointDepth - (mODEGeom,pos[0],pos[1],pos[2]); + (ODEGeom,pos[0],pos[1],pos[2]); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h 2010-01-06 07:25:00 UTC (rev 137) @@ -34,9 +34,9 @@ { public: ODEPlaneCollider(); - void SetPlaneParams(float a, float b, float c, float d); - void SetParams(const salt::Vector3f& pos, salt::Vector3f normal); - float GetPointDepth(const salt::Vector3f& pos); + void SetPlaneParams(float a, float b, float c, float d, long geomID); + void SetParams(const salt::Vector3f& pos, salt::Vector3f normal, long geomID); + float GetPointDepth(const salt::Vector3f& pos, long geomID); long CreatePlane(); }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -28,14 +28,15 @@ } void ODERayCollider::SetParams(salt::Vector3f pos, - salt::Vector3f dir, float length) + salt::Vector3f dir, float length, long geomID) { - dGeomRaySet(mODEGeom, pos[0], pos[1], pos[2], dir[0], dir[1], dir[2]); - dGeomRaySetLength(mODEGeom, length); + dGeomID ODEGeom = (dGeomID) geomID; + dGeomRaySet(ODEGeom, pos[0], pos[1], pos[2], dir[0], dir[1], dir[2]); + dGeomRaySetLength(ODEGeom, length); } long ODERayCollider::CreateRay() { - mODEGeom = dCreateRay(0, 1.0f); - return (long) mODEGeom; + dGeomID ODEGeom = dCreateRay(0, 1.0f); + return (long) ODEGeom; } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h 2010-01-06 07:25:00 UTC (rev 137) @@ -34,7 +34,7 @@ { public: ODERayCollider(); - void SetParams(salt::Vector3f pos, salt::Vector3f dir, float length); + void SetParams(salt::Vector3f pos, salt::Vector3f dir, float length, long geomID); long CreateRay(); }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h 2010-01-06 07:25:00 UTC (rev 137) @@ -43,21 +43,29 @@ void SetMassParameters(const GenericMass& mass, long bodyID); float GetMass(long bodyID) const; void SetSphere(float density, float radius, long bodyID); - salt::Vector3f AddSphere(float density, float radius, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddSphere(float density, float radius, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void SetSphereTotal(float total_mass, float radius, long bodyID); - salt::Vector3f AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void SetBox(float density, const salt::Vector3f& size, long bodyID); - salt::Vector3f AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void SetBoxTotal(float total_mass, const salt::Vector3f& size, long bodyID); - salt::Vector3f AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void SetCylinder(float density, float radius, float length, long bodyID); - salt::Vector3f AddCylinder(float density, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddCylinder(float density, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void SetCylinderTotal(float total_mass, float radius, float length, long bodyID); - salt::Vector3f AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void SetCapsule(float density, float radius, float length, long bodyID); - salt::Vector3f AddCapsule(float density, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddCapsule(float density, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void SetCapsuleTotal(float total_mass, float radius, float length, long bodyID); - salt::Vector3f AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, salt::Vector3f massTrans, long bodyID); + salt::Vector3f AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix, + salt::Vector3f massTrans, long bodyID); void TranslateMass(const salt::Vector3f& v, long bodyID); salt::Vector3f GetVelocity(long bodyID) const; void SetVelocity(const salt::Vector3f& vel, long bodyID); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp 2010-01-06 07:25:00 UTC (rev 137) @@ -30,31 +30,36 @@ long ODESliderJoint::CreateSliderJoint(long world) { dWorldID ODEWorld = (dWorldID) world; - mODEJoint = dJointCreateSlider(ODEWorld, 0); - return (long) mODEJoint; + dJointID ODEJoint = dJointCreateSlider(ODEWorld, 0); + return (long) ODEJoint; } -void ODESliderJoint::SetSliderAxis(Vector3f& up) +void ODESliderJoint::SetSliderAxis(Vector3f& up, long jointID) { - dJointSetSliderAxis(mODEJoint,up[0],up[1],up[2]); + dJointID ODEJoint = (dJointID) jointID; + dJointSetSliderAxis(ODEJoint,up[0],up[1],up[2]); } -float ODESliderJoint::GetPosition() +float ODESliderJoint::GetPosition(long jointID) { - return dJointGetSliderPosition(mODEJoint); + dJointID ODEJoint = (dJointID) jointID; + return dJointGetSliderPosition(ODEJoint); } -float ODESliderJoint::GetPositionRate() +float ODESliderJoint::GetPositionRate(long jointID) { - return dJointGetSliderPositionRate(mODEJoint); + dJointID ODEJoint = (dJointID) jointID; + return dJointGetSliderPositionRate(ODEJoint); } -void ODESliderJoint::SetParameter(int parameter, float value) +void ODESliderJoint::SetParameter(int parameter, float value, long jointID) { - dJointSetSliderParam(mODEJoint, parameter, value); + dJointID ODEJoint = (dJointID) jointID; + dJointSetSliderParam(ODEJoint, parameter, value); } -float ODESliderJoint::GetParameter(int parameter) const +float ODESliderJoint::GetParameter(int parameter, long jointID) const { - return dJointGetSliderParam(mODEJoint, parameter); + dJointID ODEJoint = (dJointID) jointID; + return dJointGetSliderParam(ODEJoint, parameter); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h 2010-01-05 07:22:17 UTC (rev 136) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h 2010-01-06 07:25:00 UTC (rev 137) @@ -35,11 +35,11 @@ public: O... [truncated message content] |