From 79eca25c945a535a7a0325999034bae17da92412 Mon Sep 17 00:00:00 2001 From: dan miller Date: Fri, 19 Oct 2007 05:15:33 +0000 Subject: resubmitting ode --- .../ode-0.9/contrib/DotNetManaged/AssemblyInfo.cpp | 58 ++++ libraries/ode-0.9/contrib/DotNetManaged/Body.cpp | 322 +++++++++++++++++ libraries/ode-0.9/contrib/DotNetManaged/Body.h | 76 +++++ .../ode-0.9/contrib/DotNetManaged/CommonMgd.h | 43 +++ .../contrib/DotNetManaged/DotNetManaged.sln | 21 ++ .../contrib/DotNetManaged/DotNetManaged.vcproj | 379 +++++++++++++++++++++ libraries/ode-0.9/contrib/DotNetManaged/Geom.cpp | 219 ++++++++++++ libraries/ode-0.9/contrib/DotNetManaged/Geom.h | 75 ++++ libraries/ode-0.9/contrib/DotNetManaged/Joint.cpp | 35 ++ libraries/ode-0.9/contrib/DotNetManaged/Joint.h | 21 ++ .../ode-0.9/contrib/DotNetManaged/JointAMotor.cpp | 162 +++++++++ .../ode-0.9/contrib/DotNetManaged/JointAMotor.h | 62 ++++ .../ode-0.9/contrib/DotNetManaged/JointBall.cpp | 79 +++++ .../ode-0.9/contrib/DotNetManaged/JointBall.h | 38 +++ .../ode-0.9/contrib/DotNetManaged/JointFixed.cpp | 67 ++++ .../ode-0.9/contrib/DotNetManaged/JointFixed.h | 37 ++ .../ode-0.9/contrib/DotNetManaged/JointGroup.cpp | 53 +++ .../ode-0.9/contrib/DotNetManaged/JointGroup.h | 33 ++ .../ode-0.9/contrib/DotNetManaged/JointHinge.cpp | 121 +++++++ .../ode-0.9/contrib/DotNetManaged/JointHinge.h | 195 +++++++++++ .../ode-0.9/contrib/DotNetManaged/JointHinge2.cpp | 133 ++++++++ .../ode-0.9/contrib/DotNetManaged/JointHinge2.h | 48 +++ .../ode-0.9/contrib/DotNetManaged/JointSlider.cpp | 102 ++++++ .../ode-0.9/contrib/DotNetManaged/JointSlider.h | 158 +++++++++ .../ode-0.9/contrib/DotNetManaged/Release/ode.dll | Bin 0 -> 196608 bytes libraries/ode-0.9/contrib/DotNetManaged/Space.cpp | 53 +++ libraries/ode-0.9/contrib/DotNetManaged/Space.h | 33 ++ libraries/ode-0.9/contrib/DotNetManaged/Stdafx.cpp | 5 + libraries/ode-0.9/contrib/DotNetManaged/Stdafx.h | 12 + libraries/ode-0.9/contrib/DotNetManaged/TEST.h | 17 + libraries/ode-0.9/contrib/DotNetManaged/World.cpp | 74 ++++ libraries/ode-0.9/contrib/DotNetManaged/World.h | 67 ++++ 32 files changed, 2798 insertions(+) create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/AssemblyInfo.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Body.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Body.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/CommonMgd.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.sln create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.vcproj create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Geom.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Geom.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Joint.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Joint.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointBall.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointBall.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointFixed.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointFixed.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointGroup.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointGroup.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointHinge.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointHinge.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointSlider.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointSlider.h create mode 100755 libraries/ode-0.9/contrib/DotNetManaged/Release/ode.dll create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Space.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Space.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Stdafx.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/Stdafx.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/TEST.h create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/World.cpp create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/World.h (limited to 'libraries/ode-0.9/contrib/DotNetManaged') diff --git a/libraries/ode-0.9/contrib/DotNetManaged/AssemblyInfo.cpp b/libraries/ode-0.9/contrib/DotNetManaged/AssemblyInfo.cpp new file mode 100644 index 0000000..e550a32 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/AssemblyInfo.cpp @@ -0,0 +1,58 @@ +#include "stdafx.h" + +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly:AssemblyTitleAttribute("")]; +[assembly:AssemblyDescriptionAttribute("")]; +[assembly:AssemblyConfigurationAttribute("")]; +[assembly:AssemblyCompanyAttribute("")]; +[assembly:AssemblyProductAttribute("")]; +[assembly:AssemblyCopyrightAttribute("")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the value or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly:AssemblyVersionAttribute("1.0.*")]; + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project directory. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly:AssemblyDelaySignAttribute(false)]; +[assembly:AssemblyKeyFileAttribute("")]; +[assembly:AssemblyKeyNameAttribute("")]; + diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Body.cpp b/libraries/ode-0.9/contrib/DotNetManaged/Body.cpp new file mode 100644 index 0000000..c95ae57 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Body.cpp @@ -0,0 +1,322 @@ +#include "StdAfx.h" + +#include +#include "Body.h" + +namespace ODEManaged +{ + + //Constructors + + Body::Body(void) + { + _id = 0; + } + + Body::Body(World &world) + { + _id = dBodyCreate(world.Id()); + } + + + //Destructor + + Body::~Body(void) + { + dBodyDestroy(this->_id); + } + + + //Methods + + //Id + dBodyID Body::Id() + { + return _id; + } + + + //SetData + void Body::SetData(void *data) + { + dBodySetData(this->_id, data); + } + + //GetData + void *Body::GetData(void) + { + return dBodyGetData(this->_id); + } + + + //SetPosition + void Body::SetPosition (double x, double y, double z) + { + dBodySetPosition(this->_id, x, y, z); + } + + + //Overloaded GetPosition + Vector3 Body::GetPosition(void) + { + Vector3 retVal; + const dReal *temp; + temp = dBodyGetPosition(this->_id); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + }; + + void Body::GetPosition(double position __gc[]) + { + const dReal *temp; + temp = dBodyGetPosition(this->_id); + position[0] = temp[0]; + position[1] = temp[1]; + position[2] = temp[2]; + } + + + //SetRotationIdentity + void Body::SetRotationIdentity(void) + { + dMatrix3 temp; + dRSetIdentity(temp); + dBodySetRotation(this->_id, temp); + } + + + //SetRotation (left handed system=>transpose) + void Body::SetRotation(Matrix3 rotation) + { + dMatrix3 temp; + temp[0] = rotation.m11; + temp[4] = rotation.m12; + temp[8] = rotation.m13; + temp[1] = rotation.m21; + temp[5] = rotation.m22; + temp[9] = rotation.m23; + temp[2] = rotation.m31; + temp[6] = rotation.m32; + temp[10] = rotation.m33; + dBodySetRotation(this->_id, temp); + } + + //GetRotation (left handed system=>transpose) + Matrix3 Body::GetRotation(void) + { + Matrix3 retVal; + //const dMatrix3 *m; + const dReal *temp; + temp = dBodyGetRotation(this->_id); + retVal.m11 = temp[0]; + retVal.m12 = temp[4]; + retVal.m13 = temp[8]; + retVal.m21 = temp[1]; + retVal.m22 = temp[5]; + retVal.m23 = temp[9]; + retVal.m31 = temp[2]; + retVal.m32 = temp[6]; + retVal.m33 = temp[10]; + return retVal; + } + + + //Overloaded SetMass + void Body::SetMass(double mass, Vector3 centerOfGravity, Matrix3 inertia) + { + dMass *temp = new dMass(); + dMassSetParameters(temp, mass, + centerOfGravity.x, + centerOfGravity.y, + centerOfGravity.z, + inertia.m11, inertia.m22, + inertia.m33, inertia.m12, + inertia.m13, inertia.m23); + + dBodySetMass(this->_id, temp); + } + + + //SetMassSphere + void Body::SetMassSphere(double density, double radius) + { + dMass *temp = new dMass(); + dMassSetSphere(temp, density, radius); + dBodySetMass(this->_id, temp); + } + + + //SetMassBox + void Body::SetMassBox(double density, double sideX, double sideY, double sideZ) + { + dMass *temp = new dMass(); + dMassSetBox(temp, density, sideX, sideY, sideZ); + dBodySetMass(this->_id, temp); + } + + + //SetMassCappedCylinder + void Body::SetMassCappedCylinder(double density, int axis, double cylinderRadius, double cylinderLength) + { + dMass *temp = new dMass(); + dMassSetCappedCylinder(temp, density, axis, + cylinderRadius, + cylinderLength); + + dBodySetMass(this->_id, temp); + } + + + //AddForce + void Body::AddForce(double fX, double fY, double fZ) + { + dBodyAddForce(this->_id, fX, fY, fZ); + } + + + //AddRelForce + void Body::AddRelForce(double fX, double fY, double fZ) + { + dBodyAddRelForce(this->_id, fX,fY,fZ); + } + + + //AddForceAtPos + void Body::AddForceAtPos(double fX, double fY, double fZ, double pX, double pY, double pZ) + { + dBodyAddForceAtPos(this->_id, fX, fY, fZ, pX, pY, pZ); + } + + + //AddRelForceAtPos + void Body::AddRelForceAtPos(double fX, double fY, double fZ, double pX, double pY, double pZ) + { + dBodyAddRelForceAtPos(this->_id, fX, fY, fZ, pX, pY, pZ); + } + + + //AddRelForceAtRelPos + void Body::AddRelForceAtRelPos(double fX, double fY, double fZ, double pX, double pY, double pZ) + { + dBodyAddRelForceAtRelPos(this->_id, fX, fY, fZ, pX, pY, pZ); + } + + + //ApplyLinearVelocityDrag + void Body::ApplyLinearVelocityDrag(double dragCoef) + { + const dReal *temp; + double fX; + double fY; + double fZ; + temp = dBodyGetLinearVel(this->_id); + fX = temp[0]*dragCoef*-1; + fY = temp[1]*dragCoef*-1; + fZ = temp[2]*dragCoef*-1; + dBodyAddForce(this->_id, fX, fY, fZ); + } + + + //ApplyAngularVelocityDrag + void Body::ApplyAngularVelocityDrag(double dragCoef) + { + const dReal *temp; + double fX; + double fY; + double fZ; + temp = dBodyGetAngularVel(this->_id); + fX = temp[0]*dragCoef*-1; + fY = temp[1]*dragCoef*-1; + fZ = temp[2]*dragCoef*-1; + dBodyAddTorque(this->_id, fX, fY, fZ); + } + + + //AddTorque + void Body::AddTorque(double fX, double fY, double fZ) + { + dBodyAddTorque(this->_id, fX, fY, fZ); + } + + + //AddRelTorque + void Body::AddRelTorque(double fX, double fY, double fZ) + { + dBodyAddRelTorque(this->_id, fX,fY,fZ); + } + + + //SetLinearVelocity + void Body::SetLinearVelocity(double x, double y, double z) + { + dBodySetLinearVel(this->_id, x, y, z); + } + + + //GetLinearVelocity + Vector3 Body::GetLinearVelocity(void) + { + Vector3 retVal; + const dReal *temp; + temp = dBodyGetLinearVel(this->_id); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //SetAngularVelocity + void Body::SetAngularVelocity(double x, double y, double z) + { + dBodySetAngularVel(this->_id, x, y, z); + } + + //GetAngularVelocity + Vector3 Body::GetAngularVelocity(void) + { + Vector3 retVal; + const dReal *temp; + temp = dBodyGetAngularVel(this->_id); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //GetRelPointPos + Vector3 Body::GetRelPointPos(double pX, double pY, double pZ) + { + Vector3 retVal; + dVector3 temp; + dBodyGetRelPointPos(this->_id, pX, pY, pZ, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //GetRelPointVel + Vector3 Body::GetRelPointVel(double pX, double pY, double pZ) + { + Vector3 retVal; + dVector3 temp; + dBodyGetRelPointVel(this->_id, pX, pY, pZ, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //ConnectedTo + int Body::ConnectedTo(const Body &b) + { + return dAreConnected(this->_id, b._id); + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Body.h b/libraries/ode-0.9/contrib/DotNetManaged/Body.h new file mode 100644 index 0000000..9347c17 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Body.h @@ -0,0 +1,76 @@ +#pragma once + +#include "World.h" +#include "CommonMgd.h" + +namespace ODEManaged +{ + __gc public class Body + { + public: + + //Constructors and Destructors + + Body(void); + Body(World &world); + + ~Body(void); + + + //Public Methods + + dBodyID Id(); + void SetData (void *data); + void *GetData (void); + + //POSITION + void SetPosition(double x, double y, double z); + Vector3 GetPosition(void); + void GetPosition(double position __gc[]); + + //ROTATION + void SetRotationIdentity(void); + void SetRotation(Matrix3 rotation); + Matrix3 GetRotation(void); + + //MASS + void SetMass(double mass, Vector3 centerOfGravity, Matrix3 inertia); + void SetMassSphere(double density, double radius); + void SetMassBox(double density, double sideX, double sideY, double sideZ); + void SetMassCappedCylinder(double density, int axis, double cylinderRadius, double cylinderLength); + + //FORCE AND TORQUE + void AddForce(double fX, double fY, double fZ); + void AddRelForce(double fX, double fY, double fZ); + void AddForceAtPos(double fX, double fY, double fZ,double pX, double pY, double pZ); + void AddRelForceAtPos(double fX, double fY, double fZ,double pX, double pY, double pZ); + void AddRelForceAtRelPos(double fX, double fY, double fZ,double pX, double pY, double pZ); + void ApplyLinearVelocityDrag(double dragCoef); + void ApplyAngularVelocityDrag(double dragCoef); + + + void AddTorque(double fX, double fY, double fZ); + void AddRelTorque(double fX, double fY, double fZ); + + //LINEAR VELOCITY + void SetLinearVelocity (double x, double y, double z); + Vector3 GetLinearVelocity(void); + + //ANGULAR VELOCITY + void SetAngularVelocity (double x, double y, double z); + Vector3 GetAngularVelocity(void); + + //POINT + Vector3 GetRelPointPos(double pX, double pY, double pZ); + Vector3 GetRelPointVel(double pX, double pY, double pZ); + + //CONNECTED TO + int ConnectedTo (const Body &b); + + private: + + dBodyID _id; + + }; +} + diff --git a/libraries/ode-0.9/contrib/DotNetManaged/CommonMgd.h b/libraries/ode-0.9/contrib/DotNetManaged/CommonMgd.h new file mode 100644 index 0000000..143397d --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/CommonMgd.h @@ -0,0 +1,43 @@ +#pragma once + +namespace ODEManaged +{ + + __value public struct Vector3 + { + double x; + double y; + double z; + }; + + + __value public struct Vector4 + { + double W; + double x; + double y; + double z; + }; + + + __value public struct Matrix3 + { + double m11; + double m12; + double m13; + double m21; + double m22; + double m23; + double m31; + double m32; + double m33; + }; + + //__value public struct NearCallback + //{ + // void *data; + // dGeomID o1; + // dGeomID o2; + //}; + +} \ No newline at end of file diff --git a/libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.sln b/libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.sln new file mode 100644 index 0000000..2694a26 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DotNetManaged", "DotNetManaged.vcproj", "{4B75AC19-971A-4CC6-A4F5-0695C9F8562F}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Debug.ActiveCfg = Debug|Win32 + {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Debug.Build.0 = Debug|Win32 + {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Release.ActiveCfg = Release|Win32 + {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.vcproj b/libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.vcproj new file mode 100644 index 0000000..2f5bb6c --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/DotNetManaged.vcproj @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Geom.cpp b/libraries/ode-0.9/contrib/DotNetManaged/Geom.cpp new file mode 100644 index 0000000..3655466 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Geom.cpp @@ -0,0 +1,219 @@ + +#include "StdAfx.h" + +#include +#include "Geom.h" + + +namespace ODEManaged +{ + + //Constructors + + Geom::Geom(void) + { + _id = 0; + } + + + //Destructor + + Geom::~Geom(void) + { + dGeomDestroy(this->_id); + } + + + //Methods + + //Id + dGeomID Geom::Id(void) + { + return _id; + } + + + //GetBody + dBodyID Geom::GetBody(void) + { + return dGeomGetBody(this->_id); + } + + + //Overloaded SetBody + void Geom::SetBody(Body &body) + { + dGeomSetBody(this->_id, body.Id()); + } + + //void Geom::SetBody(dBodyID b) + //{ + // dGeomSetBody(this->_id, b); + //} + + + //SetPosition + void Geom::SetPosition(double x, double y, double z) + { + dGeomSetPosition(this->_id, x, y, z); + } + + + //SetRotation + void Geom::SetRotation(Matrix3 rotation) + { + dMatrix3 temp; + temp[0] = rotation.m11; + temp[4] = rotation.m12; + temp[8] = rotation.m13; + temp[1] = rotation.m21; + temp[5] = rotation.m22; + temp[9] = rotation.m23; + temp[2] = rotation.m31; + temp[6] = rotation.m32; + temp[10] = rotation.m33; + dGeomSetRotation(_id, temp); + } + + + //Destroy + void Geom::Destroy() + { + if(this->_id) dGeomDestroy(this->_id); + _id = 0; + } + + + //SetData + void Geom::SetData(void *data) + { + dGeomSetData(this->_id, data); + } + + + //GetData + void *Geom::GetData(void) + { + return dGeomGetData(this->_id); + } + + + //GetPosition + Vector3 Geom::GetPosition(void) + { + Vector3 retVal; + const dReal *temp; + temp = dGeomGetPosition(this->_id); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //GetRotation (left handed system=>transpose) + Matrix3 Geom::GetRotation(void) + { + Matrix3 retVal; + const dReal *temp; + temp = dGeomGetRotation(this->_id); + retVal.m11 = temp[0]; + retVal.m12 = temp[4]; + retVal.m13 = temp[8]; + retVal.m21 = temp[1]; + retVal.m22 = temp[5]; + retVal.m23 = temp[9]; + retVal.m31 = temp[2]; + retVal.m32 = temp[6]; + retVal.m33 = temp[10]; + return retVal; + } + + + //CreateSphere + void Geom::CreateSphere(Space &space, double radius) + { + if(this->_id) dGeomDestroy(this->_id); + _id = dCreateSphere(space.Id(), radius); + } + + + //CreateBox + void Geom::CreateBox(Space &space, double lx, double ly, double lz) + { + if(this->_id) dGeomDestroy(this->_id); + _id = dCreateBox(space.Id(), lx, ly, lz); + } + + + //CreatePlane + void Geom::CreatePlane(Space &space, double a, double b, double c, double d) + { + if(this->_id) dGeomDestroy(this->_id); + _id = dCreatePlane(space.Id(), a, b, c, d); + } + + + //CreateCCylinder + void Geom::CreateCCylinder(Space &space, double radius, double length) + { + if(this->_id) dGeomDestroy(this->_id); + _id = dCreateCCylinder(space.Id(), radius, length); + } + + + //SphereGetRadius + double Geom::SphereGetRadius(void) + { + return dGeomSphereGetRadius(this->_id); + } + + + //BoxGetLengths + Vector3 Geom::BoxGetLengths(void) + { + Vector3 retVal; + dVector3 temp; + dGeomBoxGetLengths(this->_id, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //PlaneGetParams + Vector4 Geom::PlaneGetParams(void) + { + Vector4 retVal; + dVector4 temp; + dGeomPlaneGetParams(this->_id, temp); + retVal.W = temp[0]; + retVal.x = temp[1]; + retVal.y = temp[2]; + retVal.z = temp[3]; + return retVal; + } + + + //CCylinderGetParams + void Geom::CCylinderGetParams(double *radius, double *length) + { + dGeomCCylinderGetParams(this->_id, radius, length); + } + + + //GetClass + int Geom::GetClass(void) + { + return dGeomGetClass(this->_id); + } + +} + + + + + + + diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Geom.h b/libraries/ode-0.9/contrib/DotNetManaged/Geom.h new file mode 100644 index 0000000..83a6faf --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Geom.h @@ -0,0 +1,75 @@ +#pragma once + +#include "Body.h" +#include "Space.h" +#include "CommonMgd.h" + +namespace ODEManaged +{ + __gc public class Geom + { + public: + + + //Constructor + + Geom (void); + + + //Destructor + + ~Geom (void); + + + //Methods + + //Basic Stuff + + dGeomID Id (void); + dBodyID GetBody (void); + + //Overloaded SetBody + void SetBody (Body &body); + /*void SetBody (dBodyID b);*/ + + Vector3 GetPosition (void); + void SetPosition (double x, double y, double z); + + Matrix3 GetRotation (void); + void SetRotation (Matrix3 rotation); + + void SetData (void *data); + void *GetData (void); + + + //Create Objects + + void CreateSphere (Space &space, double radius); + void CreateBox (Space &space, double lx, double ly, double lz); + void CreatePlane (Space &space, double a, double b, double c, double d); + void CreateCCylinder (Space &space, double radius, double length); + + + //Destroy Objects + + void Destroy (void); + + + //Get Object's Parameters + + double SphereGetRadius (void); + Vector3 BoxGetLengths (void); + Vector4 PlaneGetParams (void); + void CCylinderGetParams (double *radius, double *length); + int GetClass (void); + + + //Properties + + private: + + dGeomID _id; + + }; + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Joint.cpp b/libraries/ode-0.9/contrib/DotNetManaged/Joint.cpp new file mode 100644 index 0000000..e2d8de6 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Joint.cpp @@ -0,0 +1,35 @@ +#include "StdAfx.h" + +#include +#include "joint.h" +#include "CommonMgd.h" +#include "world.h" + +namespace ODEManaged +{ + + //Constructor + + Joint::Joint(void) + { + _id=0; + } + + + //Destructor + + Joint::~Joint(void) + { + dJointDestroy(this->_id); + } + + + //Methods + + //Id + dJointID Joint::Id(void) + { + return _id; + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Joint.h b/libraries/ode-0.9/contrib/DotNetManaged/Joint.h new file mode 100644 index 0000000..d9ab254 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Joint.h @@ -0,0 +1,21 @@ +#pragma once + +#include "JointGroup.h" +#include "World.h" +#include "Body.h" + +namespace ODEManaged +{ + __gc public class Joint + { + protected: + //Constructor and Destructor Defenition + Joint(void); + ~Joint(void); + + //Public Methods + dJointID Id(void); + + dJointID _id; + }; +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.cpp b/libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.cpp new file mode 100644 index 0000000..c5a4543 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.cpp @@ -0,0 +1,162 @@ +#include "StdAfx.h" + +#include +#include "JointAMotor.h" + +namespace ODEManaged +{ + + //Constructors + + JointAMotor::JointAMotor(void) : Joint(){} + + + JointAMotor::JointAMotor(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateAMotor(world.Id(), 0); + } + + + JointAMotor::JointAMotor(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateAMotor(world.Id(), jointGroup.Id()); + } + + + //Destructor + + JointAMotor::~JointAMotor(void){} + + + //Methods + + //Overloaded Create + void JointAMotor::Create(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateAMotor(world.Id(), jointGroup.Id()); + } + + void JointAMotor::Create(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateAMotor(world.Id(), 0); + } + + + //Overloaded Attach + void JointAMotor::Attach(Body &body1, Body &body2) + { + dJointAttach(this->_id, body1.Id(), body2.Id()); + } + + void JointAMotor::Attach(Body &body1) + { + dJointAttach(this->_id, body1.Id(), 0); + } + + + //SetNumAxes + + void JointAMotor::SetNumAxes(int num) + { + dJointSetAMotorNumAxes(this->_id, num); + } + + + //GetNumAxes + + int JointAMotor::GetNumAxes(void) + { + return dJointGetAMotorNumAxes(this->_id); + } + + + //SetAxis + + void JointAMotor::SetAxis(int anum, int rel, double x, double y ,double z) + { + dJointSetAMotorAxis(this->_id, anum, rel, x, y, z); + } + + + //GetAxis + + Vector3 JointAMotor::GetAxis(int anum) + { + Vector3 retVal; + dVector3 temp; + dJointGetAMotorAxis(this->_id, anum, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //SetAngle + + void JointAMotor::SetAngle(int anum, double angle) + { + dJointSetAMotorAngle(this->_id, anum, angle); + } + + + //GetAngle + + double JointAMotor::GetAngle(int anum) + { + return dJointGetAMotorAngle(this->_id, anum); + } + + + //SetParam + + void JointAMotor::SetParam(int parameter, double value) + { + dJointSetAMotorParam(this->_id, parameter, value); + } + + + //GetParam + + double JointAMotor::GetParam(int parameter) + { + return dJointGetAMotorParam(this->_id, parameter); + } + + + //SetMode + + void JointAMotor::SetMode(int mode) + { + dJointSetAMotorMode(this->_id, mode); + } + + + //GetMode + + int JointAMotor::GetMode(void) + { + return dJointGetAMotorMode(this->_id); + } + + + //GetAxisRel + + int JointAMotor::GetAxisRel(int anum) + { + return dJointGetAMotorAxisRel(this->_id, anum); + } + + + //GetAngleRate + + double JointAMotor::GetAngleRate(int anum) + { + return dJointGetAMotorAngleRate(this->_id, anum); + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.h b/libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.h new file mode 100644 index 0000000..aa3ca4b --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointAMotor.h @@ -0,0 +1,62 @@ +#pragma once + +#include "Joint.h" + +namespace ODEManaged +{ + __gc public class JointAMotor : public Joint + { + public: + + + //Constructors + + JointAMotor (void); + JointAMotor (World &world); + JointAMotor (World &world, JointGroup &jointGroup); + + + //Destructor + + virtual ~JointAMotor (void); + + + //Methods + + //Basic Stuff + + //Overloaded Create + void Create (World &world, JointGroup &jointGroup); + void Create (World &world); + + void SetNumAxes (int num); + int GetNumAxes (void); + + void SetAxis (int anum, int rel, double x, double y, double z); + Vector3 GetAxis (int anum); + + void SetAngle (int anum, double angle); + double GetAngle (int anum); + + void SetMode (int mode); + int GetMode (void); + + int GetAxisRel (int anum); + double GetAngleRate (int anum); + + //Overloaded Attach + void Attach (Body &body1, Body &body2); + void Attach (Body &body1); + + + //Movement Parameters + + void SetParam (int parameter, double value); + double GetParam (int parameter); + + + + + + }; +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointBall.cpp b/libraries/ode-0.9/contrib/DotNetManaged/JointBall.cpp new file mode 100644 index 0000000..d9336c9 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointBall.cpp @@ -0,0 +1,79 @@ +#include "StdAfx.h" + +#include +#include "jointball.h" + +namespace ODEManaged +{ + + //Constructors + + JointBall::JointBall(void) : Joint(){} + + + JointBall::JointBall(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateBall(world.Id(), 0); + } + + + JointBall::JointBall(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateBall(world.Id(), jointGroup.Id()); + } + + + //Destructor + + JointBall::~JointBall(void){} + + + //Methods + + //Overloaded Create + void JointBall::Create(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateBall(world.Id(), jointGroup.Id()); + } + + void JointBall::Create(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateBall(world.Id(), 0); + } + + + //Overloaded Attach + void JointBall::Attach(Body &body1, Body &body2) + { + dJointAttach(this->_id, body1.Id(), body2.Id()); + } + + void JointBall::Attach(Body &body1) + { + dJointAttach(this->_id, body1.Id(), 0); + } + + + //SetAnchor + void JointBall::SetAnchor(double x, double y ,double z) + { + dJointSetBallAnchor(this->_id, x, y, z); + } + + //GetAnchor + Vector3 JointBall::GetAnchor(void) + { + Vector3 retVal; + dVector3 temp; + dJointGetBallAnchor(this->_id,temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointBall.h b/libraries/ode-0.9/contrib/DotNetManaged/JointBall.h new file mode 100644 index 0000000..2355bdd --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointBall.h @@ -0,0 +1,38 @@ +#pragma once + +#include "Joint.h" + +namespace ODEManaged +{ + __gc public class JointBall : public Joint + { + public: + + //Constructors + + JointBall(void); + JointBall(World &world); + JointBall(World &world, JointGroup &jointGroup); + + + //Destructors + + virtual ~JointBall(void); + + + //Methods + + //Overloaded Create + void Create(World &world, JointGroup &jointGroup); + void Create(World &world); + + //Overloaded Attach + void Attach(Body &body1, Body &body2); + void Attach(Body &body1); + + void SetAnchor(double x, double y, double z); + Vector3 GetAnchor(void); + + }; + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointFixed.cpp b/libraries/ode-0.9/contrib/DotNetManaged/JointFixed.cpp new file mode 100644 index 0000000..afe9222 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointFixed.cpp @@ -0,0 +1,67 @@ +#include "StdAfx.h" + +#include +#include "jointfixed.h" + +namespace ODEManaged +{ + + //Constructors + + JointFixed::JointFixed(void) : Joint(){} + + + JointFixed::JointFixed(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateFixed(world.Id(),0); + } + + + JointFixed::JointFixed(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateFixed(world.Id(), jointGroup.Id()); + } + + + //Destructor + + JointFixed::~JointFixed(void){} + + + //Methods + + //Overloaded Create + void JointFixed::Create(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateFixed(world.Id(), jointGroup.Id()); + } + + void JointFixed::Create(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateFixed(world.Id(), 0); + } + + + //Overloaded Attach + void JointFixed::Attach(Body &body1, Body &body2) + { + dJointAttach(this->_id, body1.Id(), body2.Id()); + } + + void JointFixed::Attach(Body &body1) + { + dJointAttach(this->_id, body1.Id(), 0); + } + + + //Fixed + void JointFixed::SetFixed(void) + { + dJointSetFixed(this->_id); + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointFixed.h b/libraries/ode-0.9/contrib/DotNetManaged/JointFixed.h new file mode 100644 index 0000000..5ca50dc --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointFixed.h @@ -0,0 +1,37 @@ +#pragma once + +#include "Joint.h" + +namespace ODEManaged +{ + __gc public class JointFixed : public Joint + { + public: + + //Constructors + + JointFixed(void); + JointFixed(World &world); + JointFixed(World &world, JointGroup &jointGroup); + + + //Destructor + + virtual ~JointFixed(void); + + + //Methods + + //Overloaded Create + void Create(World &world, JointGroup &jointGroup); + void Create(World &world); + + //Overloaded Attach + void Attach(Body &body1, Body &body2); + void Attach(Body &body1); + + void SetFixed(void); + + }; + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointGroup.cpp b/libraries/ode-0.9/contrib/DotNetManaged/JointGroup.cpp new file mode 100644 index 0000000..925751f --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointGroup.cpp @@ -0,0 +1,53 @@ +#include "StdAfx.h" + +#include +#include "jointgroup.h" + +namespace ODEManaged +{ + + //Constructors + + JointGroup::JointGroup(void) + { + _id=0; + } + + JointGroup::JointGroup (int maxSize) + { + _id = dJointGroupCreate(maxSize); + } + + + //Destructor + + JointGroup::~JointGroup(void) + { + dJointGroupDestroy(this->_id); + } + + + //Methods + + //ID + dJointGroupID JointGroup::Id() + { + return _id; + } + + + //Create + void JointGroup::Create (int maxSize) + { + if(_id) dJointGroupDestroy(_id); + _id = dJointGroupCreate(maxSize); + } + + + //Empty + void JointGroup::Empty (void) + { + dJointGroupEmpty(this->_id); + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointGroup.h b/libraries/ode-0.9/contrib/DotNetManaged/JointGroup.h new file mode 100644 index 0000000..b62ced0 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointGroup.h @@ -0,0 +1,33 @@ +#pragma once + +namespace ODEManaged +{ + __gc public class JointGroup + { + public: + + //Constructors + + JointGroup(void); + JointGroup(int maxSize); + + + //Destructor + + ~JointGroup(void); + + + //Methods + + dJointGroupID Id(void); + void Create(int maxSize); + void Empty(void); + + + private: + + dJointGroupID _id; + + }; + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointHinge.cpp b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge.cpp new file mode 100644 index 0000000..85d420b --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge.cpp @@ -0,0 +1,121 @@ +#include "stdafx.h" + +#include +#include "jointhinge.h" + +namespace ODEManaged +{ + + //Constructors + + JointHinge::JointHinge(void) : Joint(){} + + + JointHinge::JointHinge(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge(world.Id(), 0); + } + + + JointHinge::JointHinge(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge(world.Id(), jointGroup.Id()); + } + + + //Destructor + + JointHinge::~JointHinge(void){} + + + //Methods + + //Overloaded Create + void JointHinge::Create(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge(world.Id(), jointGroup.Id()); + } + + void JointHinge::Create(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge(world.Id(), 0); + } + + + //Overloaded Attach + void JointHinge::Attach(Body &body1, Body &body2) + { + dJointAttach(this->_id, body1.Id(), body2.Id()); + } + + void JointHinge::Attach(Body &body1) + { + dJointAttach(this->_id, body1.Id(), 0); + } + + + //SetAxis + void JointHinge::SetAxis(double x, double y, double z) + { + dJointSetHingeAxis(this->_id, x, y, z); + } + + //GetAxis + Vector3 JointHinge::GetAxis(void) + { + Vector3 retVal; + dVector3 temp; + dJointGetHingeAxis(this->_id, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //SetAnchor + void JointHinge::SetAnchor(double x, double y, double z) + { + dJointSetHingeAnchor(this->_id, x, y, z); + } + + //GetAnchor + Vector3 JointHinge::GetAnchor(void) + { + Vector3 retVal; + dVector3 temp; + dJointGetHingeAnchor(this->_id, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //Movement Parameters + + //SetAllMovParams + void JointHinge::SetAllMovParams(double LoStop, double HiStop, + double Velocity, double MaxForce, + double FudgeFactor, double Bounce, + double StopERP, double StopCFM) + { + if (LoStop > -3.141592653 && LoStop <= 0) + dJointSetHingeParam(this->_id, dParamLoStop, LoStop); + + if (HiStop < 3.141592653 && HiStop >= 0) + dJointSetHingeParam(this->_id, dParamHiStop, HiStop); + + dJointSetHingeParam(this->_id, dParamVel, Velocity); + dJointSetHingeParam(this->_id, dParamFMax, MaxForce); + dJointSetHingeParam(this->_id, dParamFudgeFactor, FudgeFactor); + dJointSetHingeParam(this->_id, dParamBounce, Bounce); + dJointSetHingeParam(this->_id, dParamStopERP, StopERP); + dJointSetHingeParam(this->_id, dParamStopCFM, StopCFM); + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointHinge.h b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge.h new file mode 100644 index 0000000..3115845 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge.h @@ -0,0 +1,195 @@ +#pragma once + +#include "Joint.h" +#include "CommonMgd.h" + +namespace ODEManaged +{ + __gc public class JointHinge : public Joint + { + public: + + //Constructors + + JointHinge(void); + JointHinge(World &world); + JointHinge(World &world, JointGroup &jointGroup); + + + //Destructor + + virtual~JointHinge(void); + + + //Methods + + //Overloaded Create + void Create(World &world, JointGroup &jointGroup); + void Create(World &world); + + //Overloaded Attach + void Attach(Body &body1, Body &body2); + void Attach(Body &body1); + + void SetAnchor(double x, double y, double z); + Vector3 GetAnchor(void); + + void SetAxis(double x, double y, double z); + Vector3 GetAxis(void); + + void SetAllMovParams(double LoStop, double HiStop, + double Velocity, double MaxForce, + double FudgeFactor, double Bounce, + double StopERP, double StopCFM); + + + //Properties + + //LoStop + __property double get_LoStop(void) + { + return dJointGetHingeParam(this->_id, dParamLoStop); + } + + __property void set_LoStop(double value) + { + if (value > -3.141592653 && value <= 0) + dJointSetHingeParam(this->_id, dParamLoStop, value); + } + + + //HiStop + __property double get_HiStop(void) + { + return dJointGetHingeParam(this->_id, dParamHiStop); + } + + __property void set_HiStop(double value) + { + if (value < 3.141592653 && value >= 0) + dJointSetHingeParam(this->_id, dParamHiStop, value); + } + + + //Velocity + __property double get_Velocity(void) + { + return dJointGetHingeParam(this->_id, dParamVel); + } + + __property void set_Velocity(double value) + { + dJointSetHingeParam(this->_id, dParamVel, value); + } + + + //MaxForce + __property double get_MaxForce(void) + { + return dJointGetHingeParam(this->_id, dParamFMax); + } + + __property void set_MaxForce(double value) + { + dJointSetHingeParam(this->_id, dParamFMax, value); + } + + + //FudgeFactor + __property double get_FudgeFactor(void) + { + return dJointGetHingeParam(this->_id, dParamFudgeFactor); + } + + __property void set_FudgeFactor(double value) + { + dJointSetHingeParam(this->_id, dParamFudgeFactor, value); + } + + + //Bounce + __property double get_Bounce(void) + { + return dJointGetHingeParam(this->_id, dParamBounce); + } + + __property void set_Bounce(double value) + { + dJointSetHingeParam(this->_id, dParamBounce, value); + } + + + //StopERP + __property double get_StopERP(void) + { + return dJointGetHingeParam(this->_id, dParamStopERP); + } + + __property void set_StopERP(double value) + { + dJointSetHingeParam(this->_id, dParamStopERP, value); + } + + + //StopCFM + __property double get_StopCFM(void) + { + return dJointGetHingeParam(this->_id, dParamStopCFM); + } + + __property void set_StopCFM(double value) + { + dJointSetHingeParam(this->_id, dParamStopCFM, value); + } + + + //GetAngle + __property double get_Angle(void) + { + return dJointGetHingeAngle(this->_id); + } + + + //GetAngleRate + __property double get_AngleRate(void) + { + return dJointGetHingeAngleRate(this->_id); + } + + }; + +} + +// void SetSuspensionERP(double value); +// double GetSuspensionERP(void); + +// void SetSuspensionCFM(double value); +// double GetSuspensionCFM(void); + +/* + //SetSuspensionERP + void JointHinge::SetSuspensionERP(double value) + { + dJointSetHingeParam(this->_id, dParamSuspensionERP, value); + } + + //GetSuspensionERP + double JointHinge::GetSuspensionERP(void) + { + return dJointGetHingeParam(this->_id, dParamSuspensionERP); + } + + + //SetSuspensionCFM + void JointHinge::SetSuspensionCFM(double value) + { + dJointSetHingeParam(this->_id, dParamSuspensionCFM, value); + } + + //GetSuspensionCFM + double JointHinge::GetSuspensionCFM(void) + { + return dJointGetHingeParam(this->_id, dParamSuspensionCFM); + } + +*/ diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.cpp b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.cpp new file mode 100644 index 0000000..94fd7a7 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.cpp @@ -0,0 +1,133 @@ +#include "StdAfx.h" + +#include +#include "jointhinge2.h" + +namespace ODEManaged +{ + //Constructors + JointHinge2::JointHinge2(void) : Joint(){} + + JointHinge2::JointHinge2(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge2(world.Id(),0); + } + + JointHinge2::JointHinge2(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge2(world.Id(), jointGroup.Id()); + } + + //Destructor + JointHinge2::~JointHinge2(void){} + + //CreateHinge2 (overload 1) + void JointHinge2::Create(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge2(world.Id(), jointGroup.Id()); + } + + //CreateHinge2 (overload 2) + void JointHinge2::Create(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateHinge2(world.Id(),0); + } + + //SetAnchor1 + void JointHinge2::SetAnchor (double x, double y ,double z) + { + dJointSetHinge2Anchor(_id, x,y,z); + } + + //GetAnchor1 + Vector3 JointHinge2::GetAnchor() + { + Vector3 retVal; + dVector3 temp; + dJointGetHinge2Anchor(_id,temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + //SetAxis1 + void JointHinge2::SetAxis1 (double x, double y ,double z) + { + dJointSetHinge2Axis1(_id, x,y,z); + } + + //GetAxis1 + Vector3 JointHinge2::GetAxis1() + { + Vector3 retVal; + dVector3 temp; + dJointGetHinge2Axis1(_id,temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + //SetAxis2 + void JointHinge2::SetAxis2 (double x, double y ,double z) + { + dJointSetHinge2Axis2(_id, x,y,z); + } + + //GetAxis2 + Vector3 JointHinge2::GetAxis2() + { + Vector3 retVal; + dVector3 temp; + dJointGetHinge2Axis2(_id,temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + //GetAngle1 + double JointHinge2::GetAngle1 () + { + return dJointGetHinge2Angle1(this->_id); + } + + //GetAngle1Rate + double JointHinge2::GetAngle1Rate () + { + return dJointGetHinge2Angle1Rate(this->_id); + } + + ////GetAngle hmm, this doesn't exist + //double JointHinge2::GetAngle2 () + //{ + // return dJointGetHinge2Angle2(this->_id); + //} + + //GetAngle2Rate + double JointHinge2::GetAngle2Rate () + { + return dJointGetHinge2Angle2Rate(this->_id); + } + + + //Attach (overload 1) + void JointHinge2::Attach (Body &body1, Body &body2) + { + dJointAttach(_id, body1.Id(),body2.Id()); + } + + //Attach (overload 2) + //TODO: possibly add an overload that takes anchor as a param also. + void JointHinge2::Attach (Body &body1) + { + dJointAttach(_id, body1.Id(),0); + } + + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.h b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.h new file mode 100644 index 0000000..e883ea8 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointHinge2.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Joint.h" +#include "CommonMgd.h" + +namespace ODEManaged +{ + __gc public class JointHinge2 : public Joint + { + public: + + + //Constructors + + JointHinge2 (void); + JointHinge2 (World &world); + JointHinge2 (World &world, JointGroup &jointGroup); + + //Destructors + + virtual ~JointHinge2 (void); + + + //Methods + + //Overloaded Hinge.Create + void Create (World &world, JointGroup &jointGroup); + void Create (World &world); + + void SetAnchor (double x, double y, double z); + Vector3 GetAnchor (void); + + void SetAxis1 (double x, double y, double z); + Vector3 GetAxis1 (void); + + void SetAxis2 (double x, double y, double z); + Vector3 GetAxis2 (void); + + double GetAngle1 (void); + double GetAngle1Rate (void); + + //double GetAngle2 (void); + double GetAngle2Rate (void); + + void Attach (Body &body1, Body &body2); + void Attach( Body &body1); + }; +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointSlider.cpp b/libraries/ode-0.9/contrib/DotNetManaged/JointSlider.cpp new file mode 100644 index 0000000..ab7ebd6 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointSlider.cpp @@ -0,0 +1,102 @@ +#include "StdAfx.h" + +#include +#include "jointslider.h" + +namespace ODEManaged +{ + + //Constructors + + JointSlider::JointSlider(void) : Joint(){} + + + JointSlider::JointSlider(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateSlider(world.Id(), 0); + } + + + JointSlider::JointSlider(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateSlider(world.Id(), jointGroup.Id()); + } + + + //Destructor + + JointSlider::~JointSlider(void){} + + + //Methods + + //Overloaded Create + void JointSlider::Create(World &world, JointGroup &jointGroup) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateSlider(world.Id(), jointGroup.Id()); + } + + void JointSlider::Create(World &world) + { + if(this->_id) dJointDestroy(this->_id); + _id = dJointCreateSlider(world.Id(), 0); + } + + + //Overloaded Attach + void JointSlider::Attach(Body &body1, Body &body2) + { + dJointAttach(this->_id, body1.Id(), body2.Id()); + } + + void JointSlider::Attach(Body &body1) + { + dJointAttach(this->_id, body1.Id(), 0); + } + + + //SetAxis + void JointSlider::SetAxis(double x, double y, double z) + { + dJointSetSliderAxis(this->_id, x, y, z); + } + + //GetAxis + Vector3 JointSlider::GetAxis(void) + { + Vector3 retVal; + dVector3 temp; + dJointGetSliderAxis(this->_id, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + + //Movement Parameters + + //SetAllMovParams + void JointSlider::SetAllMovParams(double LoStop, double HiStop, + double Velocity, double MaxForce, + double FudgeFactor, double Bounce, + double StopERP, double StopCFM) + { + if (LoStop <= 0) + dJointSetHingeParam(this->_id, dParamLoStop, LoStop); + + if (HiStop >= 0) + dJointSetHingeParam(this->_id, dParamHiStop, HiStop); + + dJointSetSliderParam(this->_id, dParamVel, Velocity); + dJointSetSliderParam(this->_id, dParamFMax, MaxForce); + dJointSetSliderParam(this->_id, dParamFudgeFactor, FudgeFactor); + dJointSetSliderParam(this->_id, dParamBounce, Bounce); + dJointSetSliderParam(this->_id, dParamStopERP, StopERP); + dJointSetSliderParam(this->_id, dParamStopCFM, StopCFM); + } + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/JointSlider.h b/libraries/ode-0.9/contrib/DotNetManaged/JointSlider.h new file mode 100644 index 0000000..7e96e59 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/JointSlider.h @@ -0,0 +1,158 @@ +#pragma once + +#include "Joint.h" +#include "CommonMgd.h" + +namespace ODEManaged +{ + __gc public class JointSlider : public Joint + { + public: + + + //Constructors + + JointSlider(void); + JointSlider(World &world); + JointSlider(World &world, JointGroup &jointGroup); + + + //Destructors + + virtual ~JointSlider(void); + + + //Methods + + //Overloaded Create + void Create(World &world, JointGroup &jointGroup); + void Create(World &world); + + //Overloaded Attach + void Attach(Body &body1, Body &body2); + void Attach(Body &body1); + + void SetAxis(double x, double y, double z); + Vector3 GetAxis(void); + + void SetAllMovParams(double LoStop, double HiStop, + double Velocity, double MaxForce, + double FudgeFactor, double Bounce, + double StopERP, double StopCFM); + + + //Properties + + //LoStop + __property double get_LoStop(void) + { + return dJointGetSliderParam(this->_id, dParamLoStop); + } + + __property void set_LoStop(double value) + { + if (value <=0) + dJointSetSliderParam(this->_id, dParamLoStop, value); + } + + + //HiStop + __property double get_HiStop(void) + { + return dJointGetSliderParam(this->_id, dParamHiStop); + } + + __property void set_HiStop(double value) + { + if (value >= 0) + dJointSetSliderParam(this->_id, dParamHiStop, value); + } + + + //Velocity + __property double get_Velocity(void) + { + return dJointGetSliderParam(this->_id, dParamVel); + } + + __property void set_Velocity(double value) + { + dJointSetSliderParam(this->_id, dParamVel, value); + } + + + //MaxForce + __property double get_MaxForce(void) + { + return dJointGetSliderParam(this->_id, dParamFMax); + } + + __property void set_MaxForce(double value) + { + dJointSetSliderParam(this->_id, dParamFMax, value); + } + + + //FudgeFactor + __property double get_FudgeFactor(void) + { + return dJointGetSliderParam(this->_id, dParamFudgeFactor); + } + + __property void set_FudgeFactor(double value) + { + dJointSetSliderParam(this->_id, dParamFudgeFactor, value); + } + + + //Bounce + __property double get_Bounce(void) + { + return dJointGetSliderParam(this->_id, dParamBounce); + } + + __property void set_Bounce(double value) + { + dJointSetSliderParam(this->_id, dParamBounce, value); + } + + + //StopERP + __property double get_StopERP(void) + { + return dJointGetSliderParam(this->_id, dParamStopERP); + } + + __property void set_StopERP(double value) + { + dJointSetSliderParam(this->_id, dParamStopERP, value); + } + + + //StopCFM + __property double get_StopCFM(void) + { + return dJointGetSliderParam(this->_id, dParamStopCFM); + } + + __property void set_StopCFM(double value) + { + dJointSetSliderParam(this->_id, dParamStopCFM, value); + } + + + //GetAngle + __property double get_Position(void) + { + return dJointGetSliderPosition(this->_id); + } + + + //GetAngleRate + __property double get_PositionRate(void) + { + return dJointGetSliderPositionRate(this->_id); + } + + }; +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Release/ode.dll b/libraries/ode-0.9/contrib/DotNetManaged/Release/ode.dll new file mode 100755 index 0000000..ccf2a41 Binary files /dev/null and b/libraries/ode-0.9/contrib/DotNetManaged/Release/ode.dll differ diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Space.cpp b/libraries/ode-0.9/contrib/DotNetManaged/Space.cpp new file mode 100644 index 0000000..c9a7e19 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Space.cpp @@ -0,0 +1,53 @@ +#include "StdAfx.h" + +#include +#include "Space.h" +#include "TEST.h" + +namespace ODEManaged +{ + + //Constructor + + Space::Space(void) + { + _id = dSimpleSpaceCreate(); + } + + Space::Space(int minlevel, int maxlevel) + { + _id = dHashSpaceCreate(); + dHashSpaceSetLevels(this->_id, minlevel, maxlevel); + } + + + //Destructor + + Space::~Space(void) + { + dSpaceDestroy(this->_id); + } + + + //Methods + + //Id + dSpaceID Space::Id() + { + return _id; + } + + + //Collide + void Space::Collide(void *data, dNearCallback *callback) + { + dSpaceCollide(this->_id, data, callback); + } + + + + + + + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Space.h b/libraries/ode-0.9/contrib/DotNetManaged/Space.h new file mode 100644 index 0000000..78e81ad --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Space.h @@ -0,0 +1,33 @@ +#pragma once + +#include "CommonMgd.h" + +namespace ODEManaged +{ + __gc public class Space + { + public: + + //Constructor + + Space(void); + Space(int minlevel, int maxlevel); + + //Destructor + + ~Space(void); + + + //Methods + + dSpaceID Id(void); + void Collide(void *data, dNearCallback *callback); + + + private: + + dSpaceID _id; + + }; + +} diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Stdafx.cpp b/libraries/ode-0.9/contrib/DotNetManaged/Stdafx.cpp new file mode 100644 index 0000000..b6c9d98 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Stdafx.cpp @@ -0,0 +1,5 @@ +// stdafx.cpp : source file that includes just the standard includes +// ODEManaged.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" diff --git a/libraries/ode-0.9/contrib/DotNetManaged/Stdafx.h b/libraries/ode-0.9/contrib/DotNetManaged/Stdafx.h new file mode 100644 index 0000000..2222759 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Stdafx.h @@ -0,0 +1,12 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once + +#using + + + + + diff --git a/libraries/ode-0.9/contrib/DotNetManaged/TEST.h b/libraries/ode-0.9/contrib/DotNetManaged/TEST.h new file mode 100644 index 0000000..e2cdbc3 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/TEST.h @@ -0,0 +1,17 @@ + +#pragma once + +#include "CommonMgd.h" + +namespace ODEManaged +{ + +void RnearCallback(void *data, dGeomID o1, dGeomID o2) + { + } + +} + + + + diff --git a/libraries/ode-0.9/contrib/DotNetManaged/World.cpp b/libraries/ode-0.9/contrib/DotNetManaged/World.cpp new file mode 100644 index 0000000..beab21a --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/World.cpp @@ -0,0 +1,74 @@ +#include "StdAfx.h" + +#include +#include "World.h" + +namespace ODEManaged +{ + + //Constructor + + World::World(void) + { + /*dWorldID _temp = dWorldCreate(); + _id = _temp;*/ + _id = dWorldCreate(); + } + + + //Destructor + + World::~World(void) + { + dWorldDestroy(this->_id); + } + + + //Methods + + //Id + dWorldID World::Id() + { + return _id; + } + + + //SetGravity + void World::SetGravity(double x, double y, double z) + { + dWorldSetGravity(this->_id, x, y, z); + } + + + //Overloaded GetGravity + Vector3 World::GetGravity(void) + { + Vector3 retVal; + dVector3 temp; + dWorldGetGravity(this->_id, temp); + retVal.x = temp[0]; + retVal.y = temp[1]; + retVal.z = temp[2]; + return retVal; + } + + void World::GetGravity(double gravity __gc[]) + { + dVector3 temp; + dWorldGetGravity(this->_id, temp); + gravity[0] = temp[0]; + gravity[1] = temp[1]; + gravity[2] = temp[2]; + } + + + //Step + void World::Step(double stepSize) + { + dWorldStep(this->_id, stepSize); + } + +} + + + diff --git a/libraries/ode-0.9/contrib/DotNetManaged/World.h b/libraries/ode-0.9/contrib/DotNetManaged/World.h new file mode 100644 index 0000000..c4c60e5 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/World.h @@ -0,0 +1,67 @@ +#pragma once + +#include "CommonMgd.h" + +namespace ODEManaged +{ + __gc public class World + { + public: + + //Constructor + + World(void); + + + //Destructor + + ~World(void); + + + // Methods + + dWorldID Id(void); + + void SetGravity(double x, double y, double z); + + //Overloaded GetGravity + Vector3 GetGravity(void); + void GetGravity(double gravity __gc[]); + + void Step(double stepSize); + + + //Properties + + //Constraint Force Mixing + __property void set_CFM(double cfm) + { + dWorldSetCFM(this->_id,cfm); + } + + __property double get_CFM(void) + { + return dWorldGetCFM(this->_id); + } + + + //Error Reduction Parameter + __property void set_ERP(double erp) + { + dWorldSetERP(this->_id,erp); + } + + __property double get_ERP(void) + { + return dWorldGetERP(this->_id); + } + + + private: + + dWorldID _id; + + }; + +} + -- cgit v1.1