diff options
author | dan miller | 2007-10-19 05:20:48 +0000 |
---|---|---|
committer | dan miller | 2007-10-19 05:20:48 +0000 |
commit | d48ea5bb797037069d641da41da0f195f0124491 (patch) | |
tree | 40ff433d94859d629aac933d5ec73b382f62ba1a /libraries/ode-0.9/contrib/DotNetManaged | |
parent | dont ask (diff) | |
download | opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.zip opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.tar.gz opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.tar.bz2 opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.tar.xz |
one more for the gipper
Diffstat (limited to 'libraries/ode-0.9/contrib/DotNetManaged')
32 files changed, 2798 insertions, 0 deletions
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 @@ | |||
1 | #include "stdafx.h" | ||
2 | |||
3 | using namespace System::Reflection; | ||
4 | using namespace System::Runtime::CompilerServices; | ||
5 | |||
6 | // | ||
7 | // General Information about an assembly is controlled through the following | ||
8 | // set of attributes. Change these attribute values to modify the information | ||
9 | // associated with an assembly. | ||
10 | // | ||
11 | [assembly:AssemblyTitleAttribute("")]; | ||
12 | [assembly:AssemblyDescriptionAttribute("")]; | ||
13 | [assembly:AssemblyConfigurationAttribute("")]; | ||
14 | [assembly:AssemblyCompanyAttribute("")]; | ||
15 | [assembly:AssemblyProductAttribute("")]; | ||
16 | [assembly:AssemblyCopyrightAttribute("")]; | ||
17 | [assembly:AssemblyTrademarkAttribute("")]; | ||
18 | [assembly:AssemblyCultureAttribute("")]; | ||
19 | |||
20 | // | ||
21 | // Version information for an assembly consists of the following four values: | ||
22 | // | ||
23 | // Major Version | ||
24 | // Minor Version | ||
25 | // Build Number | ||
26 | // Revision | ||
27 | // | ||
28 | // You can specify all the value or you can default the Revision and Build Numbers | ||
29 | // by using the '*' as shown below: | ||
30 | |||
31 | [assembly:AssemblyVersionAttribute("1.0.*")]; | ||
32 | |||
33 | // | ||
34 | // In order to sign your assembly you must specify a key to use. Refer to the | ||
35 | // Microsoft .NET Framework documentation for more information on assembly signing. | ||
36 | // | ||
37 | // Use the attributes below to control which key is used for signing. | ||
38 | // | ||
39 | // Notes: | ||
40 | // (*) If no key is specified, the assembly is not signed. | ||
41 | // (*) KeyName refers to a key that has been installed in the Crypto Service | ||
42 | // Provider (CSP) on your machine. KeyFile refers to a file which contains | ||
43 | // a key. | ||
44 | // (*) If the KeyFile and the KeyName values are both specified, the | ||
45 | // following processing occurs: | ||
46 | // (1) If the KeyName can be found in the CSP, that key is used. | ||
47 | // (2) If the KeyName does not exist and the KeyFile does exist, the key | ||
48 | // in the KeyFile is installed into the CSP and used. | ||
49 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. | ||
50 | // When specifying the KeyFile, the location of the KeyFile should be | ||
51 | // relative to the project directory. | ||
52 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework | ||
53 | // documentation for more information on this. | ||
54 | // | ||
55 | [assembly:AssemblyDelaySignAttribute(false)]; | ||
56 | [assembly:AssemblyKeyFileAttribute("")]; | ||
57 | [assembly:AssemblyKeyNameAttribute("")]; | ||
58 | |||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "Body.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | Body::Body(void) | ||
12 | { | ||
13 | _id = 0; | ||
14 | } | ||
15 | |||
16 | Body::Body(World &world) | ||
17 | { | ||
18 | _id = dBodyCreate(world.Id()); | ||
19 | } | ||
20 | |||
21 | |||
22 | //Destructor | ||
23 | |||
24 | Body::~Body(void) | ||
25 | { | ||
26 | dBodyDestroy(this->_id); | ||
27 | } | ||
28 | |||
29 | |||
30 | //Methods | ||
31 | |||
32 | //Id | ||
33 | dBodyID Body::Id() | ||
34 | { | ||
35 | return _id; | ||
36 | } | ||
37 | |||
38 | |||
39 | //SetData | ||
40 | void Body::SetData(void *data) | ||
41 | { | ||
42 | dBodySetData(this->_id, data); | ||
43 | } | ||
44 | |||
45 | //GetData | ||
46 | void *Body::GetData(void) | ||
47 | { | ||
48 | return dBodyGetData(this->_id); | ||
49 | } | ||
50 | |||
51 | |||
52 | //SetPosition | ||
53 | void Body::SetPosition (double x, double y, double z) | ||
54 | { | ||
55 | dBodySetPosition(this->_id, x, y, z); | ||
56 | } | ||
57 | |||
58 | |||
59 | //Overloaded GetPosition | ||
60 | Vector3 Body::GetPosition(void) | ||
61 | { | ||
62 | Vector3 retVal; | ||
63 | const dReal *temp; | ||
64 | temp = dBodyGetPosition(this->_id); | ||
65 | retVal.x = temp[0]; | ||
66 | retVal.y = temp[1]; | ||
67 | retVal.z = temp[2]; | ||
68 | return retVal; | ||
69 | }; | ||
70 | |||
71 | void Body::GetPosition(double position __gc[]) | ||
72 | { | ||
73 | const dReal *temp; | ||
74 | temp = dBodyGetPosition(this->_id); | ||
75 | position[0] = temp[0]; | ||
76 | position[1] = temp[1]; | ||
77 | position[2] = temp[2]; | ||
78 | } | ||
79 | |||
80 | |||
81 | //SetRotationIdentity | ||
82 | void Body::SetRotationIdentity(void) | ||
83 | { | ||
84 | dMatrix3 temp; | ||
85 | dRSetIdentity(temp); | ||
86 | dBodySetRotation(this->_id, temp); | ||
87 | } | ||
88 | |||
89 | |||
90 | //SetRotation (left handed system=>transpose) | ||
91 | void Body::SetRotation(Matrix3 rotation) | ||
92 | { | ||
93 | dMatrix3 temp; | ||
94 | temp[0] = rotation.m11; | ||
95 | temp[4] = rotation.m12; | ||
96 | temp[8] = rotation.m13; | ||
97 | temp[1] = rotation.m21; | ||
98 | temp[5] = rotation.m22; | ||
99 | temp[9] = rotation.m23; | ||
100 | temp[2] = rotation.m31; | ||
101 | temp[6] = rotation.m32; | ||
102 | temp[10] = rotation.m33; | ||
103 | dBodySetRotation(this->_id, temp); | ||
104 | } | ||
105 | |||
106 | //GetRotation (left handed system=>transpose) | ||
107 | Matrix3 Body::GetRotation(void) | ||
108 | { | ||
109 | Matrix3 retVal; | ||
110 | //const dMatrix3 *m; | ||
111 | const dReal *temp; | ||
112 | temp = dBodyGetRotation(this->_id); | ||
113 | retVal.m11 = temp[0]; | ||
114 | retVal.m12 = temp[4]; | ||
115 | retVal.m13 = temp[8]; | ||
116 | retVal.m21 = temp[1]; | ||
117 | retVal.m22 = temp[5]; | ||
118 | retVal.m23 = temp[9]; | ||
119 | retVal.m31 = temp[2]; | ||
120 | retVal.m32 = temp[6]; | ||
121 | retVal.m33 = temp[10]; | ||
122 | return retVal; | ||
123 | } | ||
124 | |||
125 | |||
126 | //Overloaded SetMass | ||
127 | void Body::SetMass(double mass, Vector3 centerOfGravity, Matrix3 inertia) | ||
128 | { | ||
129 | dMass *temp = new dMass(); | ||
130 | dMassSetParameters(temp, mass, | ||
131 | centerOfGravity.x, | ||
132 | centerOfGravity.y, | ||
133 | centerOfGravity.z, | ||
134 | inertia.m11, inertia.m22, | ||
135 | inertia.m33, inertia.m12, | ||
136 | inertia.m13, inertia.m23); | ||
137 | |||
138 | dBodySetMass(this->_id, temp); | ||
139 | } | ||
140 | |||
141 | |||
142 | //SetMassSphere | ||
143 | void Body::SetMassSphere(double density, double radius) | ||
144 | { | ||
145 | dMass *temp = new dMass(); | ||
146 | dMassSetSphere(temp, density, radius); | ||
147 | dBodySetMass(this->_id, temp); | ||
148 | } | ||
149 | |||
150 | |||
151 | //SetMassBox | ||
152 | void Body::SetMassBox(double density, double sideX, double sideY, double sideZ) | ||
153 | { | ||
154 | dMass *temp = new dMass(); | ||
155 | dMassSetBox(temp, density, sideX, sideY, sideZ); | ||
156 | dBodySetMass(this->_id, temp); | ||
157 | } | ||
158 | |||
159 | |||
160 | //SetMassCappedCylinder | ||
161 | void Body::SetMassCappedCylinder(double density, int axis, double cylinderRadius, double cylinderLength) | ||
162 | { | ||
163 | dMass *temp = new dMass(); | ||
164 | dMassSetCappedCylinder(temp, density, axis, | ||
165 | cylinderRadius, | ||
166 | cylinderLength); | ||
167 | |||
168 | dBodySetMass(this->_id, temp); | ||
169 | } | ||
170 | |||
171 | |||
172 | //AddForce | ||
173 | void Body::AddForce(double fX, double fY, double fZ) | ||
174 | { | ||
175 | dBodyAddForce(this->_id, fX, fY, fZ); | ||
176 | } | ||
177 | |||
178 | |||
179 | //AddRelForce | ||
180 | void Body::AddRelForce(double fX, double fY, double fZ) | ||
181 | { | ||
182 | dBodyAddRelForce(this->_id, fX,fY,fZ); | ||
183 | } | ||
184 | |||
185 | |||
186 | //AddForceAtPos | ||
187 | void Body::AddForceAtPos(double fX, double fY, double fZ, double pX, double pY, double pZ) | ||
188 | { | ||
189 | dBodyAddForceAtPos(this->_id, fX, fY, fZ, pX, pY, pZ); | ||
190 | } | ||
191 | |||
192 | |||
193 | //AddRelForceAtPos | ||
194 | void Body::AddRelForceAtPos(double fX, double fY, double fZ, double pX, double pY, double pZ) | ||
195 | { | ||
196 | dBodyAddRelForceAtPos(this->_id, fX, fY, fZ, pX, pY, pZ); | ||
197 | } | ||
198 | |||
199 | |||
200 | //AddRelForceAtRelPos | ||
201 | void Body::AddRelForceAtRelPos(double fX, double fY, double fZ, double pX, double pY, double pZ) | ||
202 | { | ||
203 | dBodyAddRelForceAtRelPos(this->_id, fX, fY, fZ, pX, pY, pZ); | ||
204 | } | ||
205 | |||
206 | |||
207 | //ApplyLinearVelocityDrag | ||
208 | void Body::ApplyLinearVelocityDrag(double dragCoef) | ||
209 | { | ||
210 | const dReal *temp; | ||
211 | double fX; | ||
212 | double fY; | ||
213 | double fZ; | ||
214 | temp = dBodyGetLinearVel(this->_id); | ||
215 | fX = temp[0]*dragCoef*-1; | ||
216 | fY = temp[1]*dragCoef*-1; | ||
217 | fZ = temp[2]*dragCoef*-1; | ||
218 | dBodyAddForce(this->_id, fX, fY, fZ); | ||
219 | } | ||
220 | |||
221 | |||
222 | //ApplyAngularVelocityDrag | ||
223 | void Body::ApplyAngularVelocityDrag(double dragCoef) | ||
224 | { | ||
225 | const dReal *temp; | ||
226 | double fX; | ||
227 | double fY; | ||
228 | double fZ; | ||
229 | temp = dBodyGetAngularVel(this->_id); | ||
230 | fX = temp[0]*dragCoef*-1; | ||
231 | fY = temp[1]*dragCoef*-1; | ||
232 | fZ = temp[2]*dragCoef*-1; | ||
233 | dBodyAddTorque(this->_id, fX, fY, fZ); | ||
234 | } | ||
235 | |||
236 | |||
237 | //AddTorque | ||
238 | void Body::AddTorque(double fX, double fY, double fZ) | ||
239 | { | ||
240 | dBodyAddTorque(this->_id, fX, fY, fZ); | ||
241 | } | ||
242 | |||
243 | |||
244 | //AddRelTorque | ||
245 | void Body::AddRelTorque(double fX, double fY, double fZ) | ||
246 | { | ||
247 | dBodyAddRelTorque(this->_id, fX,fY,fZ); | ||
248 | } | ||
249 | |||
250 | |||
251 | //SetLinearVelocity | ||
252 | void Body::SetLinearVelocity(double x, double y, double z) | ||
253 | { | ||
254 | dBodySetLinearVel(this->_id, x, y, z); | ||
255 | } | ||
256 | |||
257 | |||
258 | //GetLinearVelocity | ||
259 | Vector3 Body::GetLinearVelocity(void) | ||
260 | { | ||
261 | Vector3 retVal; | ||
262 | const dReal *temp; | ||
263 | temp = dBodyGetLinearVel(this->_id); | ||
264 | retVal.x = temp[0]; | ||
265 | retVal.y = temp[1]; | ||
266 | retVal.z = temp[2]; | ||
267 | return retVal; | ||
268 | } | ||
269 | |||
270 | |||
271 | //SetAngularVelocity | ||
272 | void Body::SetAngularVelocity(double x, double y, double z) | ||
273 | { | ||
274 | dBodySetAngularVel(this->_id, x, y, z); | ||
275 | } | ||
276 | |||
277 | //GetAngularVelocity | ||
278 | Vector3 Body::GetAngularVelocity(void) | ||
279 | { | ||
280 | Vector3 retVal; | ||
281 | const dReal *temp; | ||
282 | temp = dBodyGetAngularVel(this->_id); | ||
283 | retVal.x = temp[0]; | ||
284 | retVal.y = temp[1]; | ||
285 | retVal.z = temp[2]; | ||
286 | return retVal; | ||
287 | } | ||
288 | |||
289 | |||
290 | //GetRelPointPos | ||
291 | Vector3 Body::GetRelPointPos(double pX, double pY, double pZ) | ||
292 | { | ||
293 | Vector3 retVal; | ||
294 | dVector3 temp; | ||
295 | dBodyGetRelPointPos(this->_id, pX, pY, pZ, temp); | ||
296 | retVal.x = temp[0]; | ||
297 | retVal.y = temp[1]; | ||
298 | retVal.z = temp[2]; | ||
299 | return retVal; | ||
300 | } | ||
301 | |||
302 | |||
303 | //GetRelPointVel | ||
304 | Vector3 Body::GetRelPointVel(double pX, double pY, double pZ) | ||
305 | { | ||
306 | Vector3 retVal; | ||
307 | dVector3 temp; | ||
308 | dBodyGetRelPointVel(this->_id, pX, pY, pZ, temp); | ||
309 | retVal.x = temp[0]; | ||
310 | retVal.y = temp[1]; | ||
311 | retVal.z = temp[2]; | ||
312 | return retVal; | ||
313 | } | ||
314 | |||
315 | |||
316 | //ConnectedTo | ||
317 | int Body::ConnectedTo(const Body &b) | ||
318 | { | ||
319 | return dAreConnected(this->_id, b._id); | ||
320 | } | ||
321 | |||
322 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "World.h" | ||
4 | #include "CommonMgd.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | __gc public class Body | ||
9 | { | ||
10 | public: | ||
11 | |||
12 | //Constructors and Destructors | ||
13 | |||
14 | Body(void); | ||
15 | Body(World &world); | ||
16 | |||
17 | ~Body(void); | ||
18 | |||
19 | |||
20 | //Public Methods | ||
21 | |||
22 | dBodyID Id(); | ||
23 | void SetData (void *data); | ||
24 | void *GetData (void); | ||
25 | |||
26 | //POSITION | ||
27 | void SetPosition(double x, double y, double z); | ||
28 | Vector3 GetPosition(void); | ||
29 | void GetPosition(double position __gc[]); | ||
30 | |||
31 | //ROTATION | ||
32 | void SetRotationIdentity(void); | ||
33 | void SetRotation(Matrix3 rotation); | ||
34 | Matrix3 GetRotation(void); | ||
35 | |||
36 | //MASS | ||
37 | void SetMass(double mass, Vector3 centerOfGravity, Matrix3 inertia); | ||
38 | void SetMassSphere(double density, double radius); | ||
39 | void SetMassBox(double density, double sideX, double sideY, double sideZ); | ||
40 | void SetMassCappedCylinder(double density, int axis, double cylinderRadius, double cylinderLength); | ||
41 | |||
42 | //FORCE AND TORQUE | ||
43 | void AddForce(double fX, double fY, double fZ); | ||
44 | void AddRelForce(double fX, double fY, double fZ); | ||
45 | void AddForceAtPos(double fX, double fY, double fZ,double pX, double pY, double pZ); | ||
46 | void AddRelForceAtPos(double fX, double fY, double fZ,double pX, double pY, double pZ); | ||
47 | void AddRelForceAtRelPos(double fX, double fY, double fZ,double pX, double pY, double pZ); | ||
48 | void ApplyLinearVelocityDrag(double dragCoef); | ||
49 | void ApplyAngularVelocityDrag(double dragCoef); | ||
50 | |||
51 | |||
52 | void AddTorque(double fX, double fY, double fZ); | ||
53 | void AddRelTorque(double fX, double fY, double fZ); | ||
54 | |||
55 | //LINEAR VELOCITY | ||
56 | void SetLinearVelocity (double x, double y, double z); | ||
57 | Vector3 GetLinearVelocity(void); | ||
58 | |||
59 | //ANGULAR VELOCITY | ||
60 | void SetAngularVelocity (double x, double y, double z); | ||
61 | Vector3 GetAngularVelocity(void); | ||
62 | |||
63 | //POINT | ||
64 | Vector3 GetRelPointPos(double pX, double pY, double pZ); | ||
65 | Vector3 GetRelPointVel(double pX, double pY, double pZ); | ||
66 | |||
67 | //CONNECTED TO | ||
68 | int ConnectedTo (const Body &b); | ||
69 | |||
70 | private: | ||
71 | |||
72 | dBodyID _id; | ||
73 | |||
74 | }; | ||
75 | } | ||
76 | |||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | namespace ODEManaged | ||
4 | { | ||
5 | |||
6 | __value public struct Vector3 | ||
7 | { | ||
8 | double x; | ||
9 | double y; | ||
10 | double z; | ||
11 | }; | ||
12 | |||
13 | |||
14 | __value public struct Vector4 | ||
15 | { | ||
16 | double W; | ||
17 | double x; | ||
18 | double y; | ||
19 | double z; | ||
20 | }; | ||
21 | |||
22 | |||
23 | __value public struct Matrix3 | ||
24 | { | ||
25 | double m11; | ||
26 | double m12; | ||
27 | double m13; | ||
28 | double m21; | ||
29 | double m22; | ||
30 | double m23; | ||
31 | double m31; | ||
32 | double m32; | ||
33 | double m33; | ||
34 | }; | ||
35 | |||
36 | //__value public struct NearCallback | ||
37 | //{ | ||
38 | // void *data; | ||
39 | // dGeomID o1; | ||
40 | // dGeomID o2; | ||
41 | //}; | ||
42 | |||
43 | } \ 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 @@ | |||
1 | Microsoft Visual Studio Solution File, Format Version 7.00 | ||
2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DotNetManaged", "DotNetManaged.vcproj", "{4B75AC19-971A-4CC6-A4F5-0695C9F8562F}" | ||
3 | EndProject | ||
4 | Global | ||
5 | GlobalSection(SolutionConfiguration) = preSolution | ||
6 | ConfigName.0 = Debug | ||
7 | ConfigName.1 = Release | ||
8 | EndGlobalSection | ||
9 | GlobalSection(ProjectDependencies) = postSolution | ||
10 | EndGlobalSection | ||
11 | GlobalSection(ProjectConfiguration) = postSolution | ||
12 | {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Debug.ActiveCfg = Debug|Win32 | ||
13 | {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Debug.Build.0 = Debug|Win32 | ||
14 | {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Release.ActiveCfg = Release|Win32 | ||
15 | {4B75AC19-971A-4CC6-A4F5-0695C9F8562F}.Release.Build.0 = Release|Win32 | ||
16 | EndGlobalSection | ||
17 | GlobalSection(ExtensibilityGlobals) = postSolution | ||
18 | EndGlobalSection | ||
19 | GlobalSection(ExtensibilityAddIns) = postSolution | ||
20 | EndGlobalSection | ||
21 | 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 @@ | |||
1 | <?xml version="1.0" encoding = "Windows-1252"?> | ||
2 | <VisualStudioProject | ||
3 | ProjectType="Visual C++" | ||
4 | Version="7.00" | ||
5 | Name="DotNetManaged" | ||
6 | ProjectGUID="{4B75AC19-971A-4CC6-A4F5-0695C9F8562F}" | ||
7 | Keyword="ManagedCProj"> | ||
8 | <Platforms> | ||
9 | <Platform | ||
10 | Name="Win32"/> | ||
11 | </Platforms> | ||
12 | <Configurations> | ||
13 | <Configuration | ||
14 | Name="Debug|Win32" | ||
15 | OutputDirectory="Debug" | ||
16 | IntermediateDirectory="Debug" | ||
17 | ConfigurationType="2" | ||
18 | CharacterSet="2" | ||
19 | ManagedExtensions="TRUE"> | ||
20 | <Tool | ||
21 | Name="VCCLCompilerTool" | ||
22 | Optimization="2" | ||
23 | AdditionalIncludeDirectories=""F:\Documents and Settings\Visual Studio Projects\ODE\Contrib\tri-collider";"F:\Documents and Settings\Visual Studio Projects\ODE\ODE\Src";"F:\Documents and Settings\Visual Studio Projects\ODE\ODE";"F:\Documents and Settings\Visual Studio Projects\ODE\Include"" | ||
24 | PreprocessorDefinitions="WIN32;_DEBUG" | ||
25 | MinimalRebuild="FALSE" | ||
26 | BasicRuntimeChecks="0" | ||
27 | RuntimeLibrary="1" | ||
28 | WarningLevel="3" | ||
29 | DebugInformationFormat="3"/> | ||
30 | <Tool | ||
31 | Name="VCCustomBuildTool"/> | ||
32 | <Tool | ||
33 | Name="VCLinkerTool" | ||
34 | OutputFile="$(OutDir)/DotNetManaged.exe" | ||
35 | LinkIncremental="2" | ||
36 | GenerateDebugInformation="TRUE"/> | ||
37 | <Tool | ||
38 | Name="VCMIDLTool"/> | ||
39 | <Tool | ||
40 | Name="VCPostBuildEventTool"/> | ||
41 | <Tool | ||
42 | Name="VCPreBuildEventTool"/> | ||
43 | <Tool | ||
44 | Name="VCPreLinkEventTool"/> | ||
45 | <Tool | ||
46 | Name="VCResourceCompilerTool"/> | ||
47 | <Tool | ||
48 | Name="VCWebServiceProxyGeneratorTool"/> | ||
49 | <Tool | ||
50 | Name="VCWebDeploymentTool"/> | ||
51 | </Configuration> | ||
52 | <Configuration | ||
53 | Name="Release|Win32" | ||
54 | OutputDirectory="Release" | ||
55 | IntermediateDirectory="Release" | ||
56 | ConfigurationType="2" | ||
57 | CharacterSet="2" | ||
58 | ManagedExtensions="TRUE" | ||
59 | WholeProgramOptimization="FALSE"> | ||
60 | <Tool | ||
61 | Name="VCCLCompilerTool" | ||
62 | Optimization="2" | ||
63 | InlineFunctionExpansion="0" | ||
64 | OmitFramePointers="TRUE" | ||
65 | AdditionalIncludeDirectories=""F:\Documents and Settings\Visual Studio Projects\ODE";"F:\Documents and Settings\Visual Studio Projects\ODE\Contrib\DotNetManaged\odeOLd";"F:\Documents and Settings\Visual Studio Projects\ODE\Include";"F:\Documents and Settings\Visual Studio Projects\ODE\Include\ODE";"F:\Documents and Settings\Visual Studio Projects\ODE\ODE\Src";"F:\Documents and Settings\Visual Studio Projects\ODE\Contrib\tri-collider"" | ||
66 | PreprocessorDefinitions="WIN32;NDEBUG" | ||
67 | MinimalRebuild="FALSE" | ||
68 | WarningLevel="3" | ||
69 | DebugInformationFormat="3"/> | ||
70 | <Tool | ||
71 | Name="VCCustomBuildTool"/> | ||
72 | <Tool | ||
73 | Name="VCLinkerTool" | ||
74 | OutputFile="$(OutDir)/ode.dll" | ||
75 | SuppressStartupBanner="TRUE" | ||
76 | GenerateDebugInformation="FALSE"/> | ||
77 | <Tool | ||
78 | Name="VCMIDLTool"/> | ||
79 | <Tool | ||
80 | Name="VCPostBuildEventTool"/> | ||
81 | <Tool | ||
82 | Name="VCPreBuildEventTool"/> | ||
83 | <Tool | ||
84 | Name="VCPreLinkEventTool"/> | ||
85 | <Tool | ||
86 | Name="VCResourceCompilerTool"/> | ||
87 | <Tool | ||
88 | Name="VCWebServiceProxyGeneratorTool"/> | ||
89 | <Tool | ||
90 | Name="VCWebDeploymentTool"/> | ||
91 | </Configuration> | ||
92 | </Configurations> | ||
93 | <Files> | ||
94 | <Filter | ||
95 | Name="Source Files" | ||
96 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> | ||
97 | <File | ||
98 | RelativePath="..\..\ODE\Src\array.cpp"> | ||
99 | </File> | ||
100 | <File | ||
101 | RelativePath="..\..\ODE\Src\error.cpp"> | ||
102 | </File> | ||
103 | <File | ||
104 | RelativePath="..\..\ODE\Src\fastdot.c"> | ||
105 | </File> | ||
106 | <File | ||
107 | RelativePath="..\..\ODE\Src\fastldlt.c"> | ||
108 | </File> | ||
109 | <File | ||
110 | RelativePath="..\..\ODE\Src\fastlsolve.c"> | ||
111 | </File> | ||
112 | <File | ||
113 | RelativePath="..\..\ODE\Src\fastltsolve.c"> | ||
114 | </File> | ||
115 | <File | ||
116 | RelativePath="..\..\ODE\Src\geom.cpp"> | ||
117 | </File> | ||
118 | <File | ||
119 | RelativePath="..\..\ODE\Src\joint.cpp"> | ||
120 | </File> | ||
121 | <File | ||
122 | RelativePath="..\..\ODE\Src\lcp.cpp"> | ||
123 | </File> | ||
124 | <File | ||
125 | RelativePath="..\..\ODE\Src\mass.cpp"> | ||
126 | </File> | ||
127 | <File | ||
128 | RelativePath="..\..\ODE\Src\mat.cpp"> | ||
129 | </File> | ||
130 | <File | ||
131 | RelativePath="..\..\ODE\Src\matrix.cpp"> | ||
132 | </File> | ||
133 | <File | ||
134 | RelativePath="..\..\ODE\Src\memory.cpp"> | ||
135 | </File> | ||
136 | <File | ||
137 | RelativePath="..\..\ODE\Src\misc.cpp"> | ||
138 | </File> | ||
139 | <File | ||
140 | RelativePath="..\..\ODE\Src\objects.h"> | ||
141 | </File> | ||
142 | <File | ||
143 | RelativePath="..\..\ODE\Src\obstack.cpp"> | ||
144 | </File> | ||
145 | <File | ||
146 | RelativePath="..\..\ODE\Src\ode.cpp"> | ||
147 | </File> | ||
148 | <File | ||
149 | RelativePath="..\..\ODE\Src\odemath.cpp"> | ||
150 | </File> | ||
151 | <File | ||
152 | RelativePath="..\..\ODE\Src\rotation.cpp"> | ||
153 | </File> | ||
154 | <File | ||
155 | RelativePath="..\..\ODE\Src\space.cpp"> | ||
156 | </File> | ||
157 | <File | ||
158 | RelativePath="..\..\ODE\Src\step.cpp"> | ||
159 | </File> | ||
160 | <File | ||
161 | RelativePath="..\..\ODE\Src\testing.cpp"> | ||
162 | </File> | ||
163 | <File | ||
164 | RelativePath="..\..\ODE\Src\timer.cpp"> | ||
165 | </File> | ||
166 | </Filter> | ||
167 | <Filter | ||
168 | Name="Header Files" | ||
169 | Filter="h;hpp;hxx;hm;inl;inc"> | ||
170 | <File | ||
171 | RelativePath="..\..\ODE\Src\array.h"> | ||
172 | </File> | ||
173 | <File | ||
174 | RelativePath="..\..\Include\ODE\common.h"> | ||
175 | </File> | ||
176 | <File | ||
177 | RelativePath="..\..\Include\ODE\config.h"> | ||
178 | </File> | ||
179 | <File | ||
180 | RelativePath="..\..\Include\ODE\contact.h"> | ||
181 | </File> | ||
182 | <File | ||
183 | RelativePath="..\..\Include\ODE\error.h"> | ||
184 | </File> | ||
185 | <File | ||
186 | RelativePath="..\..\Include\ODE\geom.h"> | ||
187 | </File> | ||
188 | <File | ||
189 | RelativePath="..\..\ODE\Src\geom_internal.h"> | ||
190 | </File> | ||
191 | <File | ||
192 | RelativePath="..\..\ODE\Src\joint.h"> | ||
193 | </File> | ||
194 | <File | ||
195 | RelativePath="..\..\ODE\Src\lcp.h"> | ||
196 | </File> | ||
197 | <File | ||
198 | RelativePath="..\..\Include\ODE\mass.h"> | ||
199 | </File> | ||
200 | <File | ||
201 | RelativePath="..\..\ODE\Src\mat.h"> | ||
202 | </File> | ||
203 | <File | ||
204 | RelativePath="..\..\Include\ODE\matrix.h"> | ||
205 | </File> | ||
206 | <File | ||
207 | RelativePath="..\..\Include\ODE\memory.h"> | ||
208 | </File> | ||
209 | <File | ||
210 | RelativePath="..\..\Include\ODE\misc.h"> | ||
211 | </File> | ||
212 | <File | ||
213 | RelativePath="..\..\Include\ODE\objects.h"> | ||
214 | </File> | ||
215 | <File | ||
216 | RelativePath="..\..\ODE\Src\obstack.h"> | ||
217 | </File> | ||
218 | <File | ||
219 | RelativePath="..\..\Include\ODE\ode.h"> | ||
220 | </File> | ||
221 | <File | ||
222 | RelativePath="..\..\Include\ODE\odecpp.h"> | ||
223 | </File> | ||
224 | <File | ||
225 | RelativePath="..\..\Include\ODE\odemath.h"> | ||
226 | </File> | ||
227 | <File | ||
228 | RelativePath="..\..\Include\ODE\rotation.h"> | ||
229 | </File> | ||
230 | <File | ||
231 | RelativePath="..\..\Include\ODE\space.h"> | ||
232 | </File> | ||
233 | <File | ||
234 | RelativePath="..\..\ODE\Src\step.h"> | ||
235 | </File> | ||
236 | <File | ||
237 | RelativePath="..\..\ODE\Src\testing.h"> | ||
238 | </File> | ||
239 | <File | ||
240 | RelativePath="..\..\Include\ODE\timer.h"> | ||
241 | </File> | ||
242 | </Filter> | ||
243 | <Filter | ||
244 | Name="Resource Files" | ||
245 | Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;r"> | ||
246 | </Filter> | ||
247 | <Filter | ||
248 | Name="Wrapper" | ||
249 | Filter=""> | ||
250 | <Filter | ||
251 | Name="Header Files" | ||
252 | Filter=""> | ||
253 | <File | ||
254 | RelativePath="Body.h"> | ||
255 | </File> | ||
256 | <File | ||
257 | RelativePath="CommonMgd.h"> | ||
258 | </File> | ||
259 | <File | ||
260 | RelativePath="Geom.h"> | ||
261 | </File> | ||
262 | <File | ||
263 | RelativePath="Joint.h"> | ||
264 | </File> | ||
265 | <File | ||
266 | RelativePath="JointAMotor.h"> | ||
267 | </File> | ||
268 | <File | ||
269 | RelativePath="JointBall.h"> | ||
270 | </File> | ||
271 | <File | ||
272 | RelativePath="JointFixed.h"> | ||
273 | </File> | ||
274 | <File | ||
275 | RelativePath="JointGroup.h"> | ||
276 | </File> | ||
277 | <File | ||
278 | RelativePath="JointHinge.h"> | ||
279 | </File> | ||
280 | <File | ||
281 | RelativePath="JointHinge2.h"> | ||
282 | </File> | ||
283 | <File | ||
284 | RelativePath="JointSlider.h"> | ||
285 | </File> | ||
286 | <File | ||
287 | RelativePath="Space.h"> | ||
288 | </File> | ||
289 | <File | ||
290 | RelativePath="Stdafx.h"> | ||
291 | </File> | ||
292 | <File | ||
293 | RelativePath="World.h"> | ||
294 | </File> | ||
295 | </Filter> | ||
296 | <Filter | ||
297 | Name="Source Files" | ||
298 | Filter=""> | ||
299 | <File | ||
300 | RelativePath="Body.cpp"> | ||
301 | </File> | ||
302 | <File | ||
303 | RelativePath="Geom.cpp"> | ||
304 | <FileConfiguration | ||
305 | Name="Debug|Win32"> | ||
306 | <Tool | ||
307 | Name="VCCLCompilerTool" | ||
308 | ObjectFile="$(IntDir)/$(InputName)1.obj"/> | ||
309 | </FileConfiguration> | ||
310 | <FileConfiguration | ||
311 | Name="Release|Win32"> | ||
312 | <Tool | ||
313 | Name="VCCLCompilerTool" | ||
314 | ObjectFile="$(IntDir)/$(InputName)1.obj"/> | ||
315 | </FileConfiguration> | ||
316 | </File> | ||
317 | <File | ||
318 | RelativePath="Joint.cpp"> | ||
319 | <FileConfiguration | ||
320 | Name="Debug|Win32"> | ||
321 | <Tool | ||
322 | Name="VCCLCompilerTool" | ||
323 | ObjectFile="$(IntDir)/$(InputName)1.obj"/> | ||
324 | </FileConfiguration> | ||
325 | <FileConfiguration | ||
326 | Name="Release|Win32"> | ||
327 | <Tool | ||
328 | Name="VCCLCompilerTool" | ||
329 | ObjectFile="$(IntDir)/$(InputName)1.obj"/> | ||
330 | </FileConfiguration> | ||
331 | </File> | ||
332 | <File | ||
333 | RelativePath="JointAMotor.cpp"> | ||
334 | </File> | ||
335 | <File | ||
336 | RelativePath="JointBall.cpp"> | ||
337 | </File> | ||
338 | <File | ||
339 | RelativePath="JointFixed.cpp"> | ||
340 | </File> | ||
341 | <File | ||
342 | RelativePath="JointGroup.cpp"> | ||
343 | </File> | ||
344 | <File | ||
345 | RelativePath="JointHinge.cpp"> | ||
346 | </File> | ||
347 | <File | ||
348 | RelativePath="JointHinge2.cpp"> | ||
349 | </File> | ||
350 | <File | ||
351 | RelativePath="JointSlider.cpp"> | ||
352 | </File> | ||
353 | <File | ||
354 | RelativePath="Space.cpp"> | ||
355 | <FileConfiguration | ||
356 | Name="Debug|Win32"> | ||
357 | <Tool | ||
358 | Name="VCCLCompilerTool" | ||
359 | ObjectFile="$(IntDir)/$(InputName)1.obj"/> | ||
360 | </FileConfiguration> | ||
361 | <FileConfiguration | ||
362 | Name="Release|Win32"> | ||
363 | <Tool | ||
364 | Name="VCCLCompilerTool" | ||
365 | ObjectFile="$(IntDir)/$(InputName)1.obj"/> | ||
366 | </FileConfiguration> | ||
367 | </File> | ||
368 | <File | ||
369 | RelativePath="Stdafx.cpp"> | ||
370 | </File> | ||
371 | <File | ||
372 | RelativePath="World.cpp"> | ||
373 | </File> | ||
374 | </Filter> | ||
375 | </Filter> | ||
376 | </Files> | ||
377 | <Globals> | ||
378 | </Globals> | ||
379 | </VisualStudioProject> | ||
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 @@ | |||
1 | |||
2 | #include "StdAfx.h" | ||
3 | |||
4 | #include <ode/ode.h> | ||
5 | #include "Geom.h" | ||
6 | |||
7 | |||
8 | namespace ODEManaged | ||
9 | { | ||
10 | |||
11 | //Constructors | ||
12 | |||
13 | Geom::Geom(void) | ||
14 | { | ||
15 | _id = 0; | ||
16 | } | ||
17 | |||
18 | |||
19 | //Destructor | ||
20 | |||
21 | Geom::~Geom(void) | ||
22 | { | ||
23 | dGeomDestroy(this->_id); | ||
24 | } | ||
25 | |||
26 | |||
27 | //Methods | ||
28 | |||
29 | //Id | ||
30 | dGeomID Geom::Id(void) | ||
31 | { | ||
32 | return _id; | ||
33 | } | ||
34 | |||
35 | |||
36 | //GetBody | ||
37 | dBodyID Geom::GetBody(void) | ||
38 | { | ||
39 | return dGeomGetBody(this->_id); | ||
40 | } | ||
41 | |||
42 | |||
43 | //Overloaded SetBody | ||
44 | void Geom::SetBody(Body &body) | ||
45 | { | ||
46 | dGeomSetBody(this->_id, body.Id()); | ||
47 | } | ||
48 | |||
49 | //void Geom::SetBody(dBodyID b) | ||
50 | //{ | ||
51 | // dGeomSetBody(this->_id, b); | ||
52 | //} | ||
53 | |||
54 | |||
55 | //SetPosition | ||
56 | void Geom::SetPosition(double x, double y, double z) | ||
57 | { | ||
58 | dGeomSetPosition(this->_id, x, y, z); | ||
59 | } | ||
60 | |||
61 | |||
62 | //SetRotation | ||
63 | void Geom::SetRotation(Matrix3 rotation) | ||
64 | { | ||
65 | dMatrix3 temp; | ||
66 | temp[0] = rotation.m11; | ||
67 | temp[4] = rotation.m12; | ||
68 | temp[8] = rotation.m13; | ||
69 | temp[1] = rotation.m21; | ||
70 | temp[5] = rotation.m22; | ||
71 | temp[9] = rotation.m23; | ||
72 | temp[2] = rotation.m31; | ||
73 | temp[6] = rotation.m32; | ||
74 | temp[10] = rotation.m33; | ||
75 | dGeomSetRotation(_id, temp); | ||
76 | } | ||
77 | |||
78 | |||
79 | //Destroy | ||
80 | void Geom::Destroy() | ||
81 | { | ||
82 | if(this->_id) dGeomDestroy(this->_id); | ||
83 | _id = 0; | ||
84 | } | ||
85 | |||
86 | |||
87 | //SetData | ||
88 | void Geom::SetData(void *data) | ||
89 | { | ||
90 | dGeomSetData(this->_id, data); | ||
91 | } | ||
92 | |||
93 | |||
94 | //GetData | ||
95 | void *Geom::GetData(void) | ||
96 | { | ||
97 | return dGeomGetData(this->_id); | ||
98 | } | ||
99 | |||
100 | |||
101 | //GetPosition | ||
102 | Vector3 Geom::GetPosition(void) | ||
103 | { | ||
104 | Vector3 retVal; | ||
105 | const dReal *temp; | ||
106 | temp = dGeomGetPosition(this->_id); | ||
107 | retVal.x = temp[0]; | ||
108 | retVal.y = temp[1]; | ||
109 | retVal.z = temp[2]; | ||
110 | return retVal; | ||
111 | } | ||
112 | |||
113 | |||
114 | //GetRotation (left handed system=>transpose) | ||
115 | Matrix3 Geom::GetRotation(void) | ||
116 | { | ||
117 | Matrix3 retVal; | ||
118 | const dReal *temp; | ||
119 | temp = dGeomGetRotation(this->_id); | ||
120 | retVal.m11 = temp[0]; | ||
121 | retVal.m12 = temp[4]; | ||
122 | retVal.m13 = temp[8]; | ||
123 | retVal.m21 = temp[1]; | ||
124 | retVal.m22 = temp[5]; | ||
125 | retVal.m23 = temp[9]; | ||
126 | retVal.m31 = temp[2]; | ||
127 | retVal.m32 = temp[6]; | ||
128 | retVal.m33 = temp[10]; | ||
129 | return retVal; | ||
130 | } | ||
131 | |||
132 | |||
133 | //CreateSphere | ||
134 | void Geom::CreateSphere(Space &space, double radius) | ||
135 | { | ||
136 | if(this->_id) dGeomDestroy(this->_id); | ||
137 | _id = dCreateSphere(space.Id(), radius); | ||
138 | } | ||
139 | |||
140 | |||
141 | //CreateBox | ||
142 | void Geom::CreateBox(Space &space, double lx, double ly, double lz) | ||
143 | { | ||
144 | if(this->_id) dGeomDestroy(this->_id); | ||
145 | _id = dCreateBox(space.Id(), lx, ly, lz); | ||
146 | } | ||
147 | |||
148 | |||
149 | //CreatePlane | ||
150 | void Geom::CreatePlane(Space &space, double a, double b, double c, double d) | ||
151 | { | ||
152 | if(this->_id) dGeomDestroy(this->_id); | ||
153 | _id = dCreatePlane(space.Id(), a, b, c, d); | ||
154 | } | ||
155 | |||
156 | |||
157 | //CreateCCylinder | ||
158 | void Geom::CreateCCylinder(Space &space, double radius, double length) | ||
159 | { | ||
160 | if(this->_id) dGeomDestroy(this->_id); | ||
161 | _id = dCreateCCylinder(space.Id(), radius, length); | ||
162 | } | ||
163 | |||
164 | |||
165 | //SphereGetRadius | ||
166 | double Geom::SphereGetRadius(void) | ||
167 | { | ||
168 | return dGeomSphereGetRadius(this->_id); | ||
169 | } | ||
170 | |||
171 | |||
172 | //BoxGetLengths | ||
173 | Vector3 Geom::BoxGetLengths(void) | ||
174 | { | ||
175 | Vector3 retVal; | ||
176 | dVector3 temp; | ||
177 | dGeomBoxGetLengths(this->_id, temp); | ||
178 | retVal.x = temp[0]; | ||
179 | retVal.y = temp[1]; | ||
180 | retVal.z = temp[2]; | ||
181 | return retVal; | ||
182 | } | ||
183 | |||
184 | |||
185 | //PlaneGetParams | ||
186 | Vector4 Geom::PlaneGetParams(void) | ||
187 | { | ||
188 | Vector4 retVal; | ||
189 | dVector4 temp; | ||
190 | dGeomPlaneGetParams(this->_id, temp); | ||
191 | retVal.W = temp[0]; | ||
192 | retVal.x = temp[1]; | ||
193 | retVal.y = temp[2]; | ||
194 | retVal.z = temp[3]; | ||
195 | return retVal; | ||
196 | } | ||
197 | |||
198 | |||
199 | //CCylinderGetParams | ||
200 | void Geom::CCylinderGetParams(double *radius, double *length) | ||
201 | { | ||
202 | dGeomCCylinderGetParams(this->_id, radius, length); | ||
203 | } | ||
204 | |||
205 | |||
206 | //GetClass | ||
207 | int Geom::GetClass(void) | ||
208 | { | ||
209 | return dGeomGetClass(this->_id); | ||
210 | } | ||
211 | |||
212 | } | ||
213 | |||
214 | |||
215 | |||
216 | |||
217 | |||
218 | |||
219 | |||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "Body.h" | ||
4 | #include "Space.h" | ||
5 | #include "CommonMgd.h" | ||
6 | |||
7 | namespace ODEManaged | ||
8 | { | ||
9 | __gc public class Geom | ||
10 | { | ||
11 | public: | ||
12 | |||
13 | |||
14 | //Constructor | ||
15 | |||
16 | Geom (void); | ||
17 | |||
18 | |||
19 | //Destructor | ||
20 | |||
21 | ~Geom (void); | ||
22 | |||
23 | |||
24 | //Methods | ||
25 | |||
26 | //Basic Stuff | ||
27 | |||
28 | dGeomID Id (void); | ||
29 | dBodyID GetBody (void); | ||
30 | |||
31 | //Overloaded SetBody | ||
32 | void SetBody (Body &body); | ||
33 | /*void SetBody (dBodyID b);*/ | ||
34 | |||
35 | Vector3 GetPosition (void); | ||
36 | void SetPosition (double x, double y, double z); | ||
37 | |||
38 | Matrix3 GetRotation (void); | ||
39 | void SetRotation (Matrix3 rotation); | ||
40 | |||
41 | void SetData (void *data); | ||
42 | void *GetData (void); | ||
43 | |||
44 | |||
45 | //Create Objects | ||
46 | |||
47 | void CreateSphere (Space &space, double radius); | ||
48 | void CreateBox (Space &space, double lx, double ly, double lz); | ||
49 | void CreatePlane (Space &space, double a, double b, double c, double d); | ||
50 | void CreateCCylinder (Space &space, double radius, double length); | ||
51 | |||
52 | |||
53 | //Destroy Objects | ||
54 | |||
55 | void Destroy (void); | ||
56 | |||
57 | |||
58 | //Get Object's Parameters | ||
59 | |||
60 | double SphereGetRadius (void); | ||
61 | Vector3 BoxGetLengths (void); | ||
62 | Vector4 PlaneGetParams (void); | ||
63 | void CCylinderGetParams (double *radius, double *length); | ||
64 | int GetClass (void); | ||
65 | |||
66 | |||
67 | //Properties | ||
68 | |||
69 | private: | ||
70 | |||
71 | dGeomID _id; | ||
72 | |||
73 | }; | ||
74 | |||
75 | } | ||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "joint.h" | ||
5 | #include "CommonMgd.h" | ||
6 | #include "world.h" | ||
7 | |||
8 | namespace ODEManaged | ||
9 | { | ||
10 | |||
11 | //Constructor | ||
12 | |||
13 | Joint::Joint(void) | ||
14 | { | ||
15 | _id=0; | ||
16 | } | ||
17 | |||
18 | |||
19 | //Destructor | ||
20 | |||
21 | Joint::~Joint(void) | ||
22 | { | ||
23 | dJointDestroy(this->_id); | ||
24 | } | ||
25 | |||
26 | |||
27 | //Methods | ||
28 | |||
29 | //Id | ||
30 | dJointID Joint::Id(void) | ||
31 | { | ||
32 | return _id; | ||
33 | } | ||
34 | |||
35 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "JointGroup.h" | ||
4 | #include "World.h" | ||
5 | #include "Body.h" | ||
6 | |||
7 | namespace ODEManaged | ||
8 | { | ||
9 | __gc public class Joint | ||
10 | { | ||
11 | protected: | ||
12 | //Constructor and Destructor Defenition | ||
13 | Joint(void); | ||
14 | ~Joint(void); | ||
15 | |||
16 | //Public Methods | ||
17 | dJointID Id(void); | ||
18 | |||
19 | dJointID _id; | ||
20 | }; | ||
21 | } | ||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "JointAMotor.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | JointAMotor::JointAMotor(void) : Joint(){} | ||
12 | |||
13 | |||
14 | JointAMotor::JointAMotor(World &world) | ||
15 | { | ||
16 | if(this->_id) dJointDestroy(this->_id); | ||
17 | _id = dJointCreateAMotor(world.Id(), 0); | ||
18 | } | ||
19 | |||
20 | |||
21 | JointAMotor::JointAMotor(World &world, JointGroup &jointGroup) | ||
22 | { | ||
23 | if(this->_id) dJointDestroy(this->_id); | ||
24 | _id = dJointCreateAMotor(world.Id(), jointGroup.Id()); | ||
25 | } | ||
26 | |||
27 | |||
28 | //Destructor | ||
29 | |||
30 | JointAMotor::~JointAMotor(void){} | ||
31 | |||
32 | |||
33 | //Methods | ||
34 | |||
35 | //Overloaded Create | ||
36 | void JointAMotor::Create(World &world, JointGroup &jointGroup) | ||
37 | { | ||
38 | if(this->_id) dJointDestroy(this->_id); | ||
39 | _id = dJointCreateAMotor(world.Id(), jointGroup.Id()); | ||
40 | } | ||
41 | |||
42 | void JointAMotor::Create(World &world) | ||
43 | { | ||
44 | if(this->_id) dJointDestroy(this->_id); | ||
45 | _id = dJointCreateAMotor(world.Id(), 0); | ||
46 | } | ||
47 | |||
48 | |||
49 | //Overloaded Attach | ||
50 | void JointAMotor::Attach(Body &body1, Body &body2) | ||
51 | { | ||
52 | dJointAttach(this->_id, body1.Id(), body2.Id()); | ||
53 | } | ||
54 | |||
55 | void JointAMotor::Attach(Body &body1) | ||
56 | { | ||
57 | dJointAttach(this->_id, body1.Id(), 0); | ||
58 | } | ||
59 | |||
60 | |||
61 | //SetNumAxes | ||
62 | |||
63 | void JointAMotor::SetNumAxes(int num) | ||
64 | { | ||
65 | dJointSetAMotorNumAxes(this->_id, num); | ||
66 | } | ||
67 | |||
68 | |||
69 | //GetNumAxes | ||
70 | |||
71 | int JointAMotor::GetNumAxes(void) | ||
72 | { | ||
73 | return dJointGetAMotorNumAxes(this->_id); | ||
74 | } | ||
75 | |||
76 | |||
77 | //SetAxis | ||
78 | |||
79 | void JointAMotor::SetAxis(int anum, int rel, double x, double y ,double z) | ||
80 | { | ||
81 | dJointSetAMotorAxis(this->_id, anum, rel, x, y, z); | ||
82 | } | ||
83 | |||
84 | |||
85 | //GetAxis | ||
86 | |||
87 | Vector3 JointAMotor::GetAxis(int anum) | ||
88 | { | ||
89 | Vector3 retVal; | ||
90 | dVector3 temp; | ||
91 | dJointGetAMotorAxis(this->_id, anum, temp); | ||
92 | retVal.x = temp[0]; | ||
93 | retVal.y = temp[1]; | ||
94 | retVal.z = temp[2]; | ||
95 | return retVal; | ||
96 | } | ||
97 | |||
98 | |||
99 | //SetAngle | ||
100 | |||
101 | void JointAMotor::SetAngle(int anum, double angle) | ||
102 | { | ||
103 | dJointSetAMotorAngle(this->_id, anum, angle); | ||
104 | } | ||
105 | |||
106 | |||
107 | //GetAngle | ||
108 | |||
109 | double JointAMotor::GetAngle(int anum) | ||
110 | { | ||
111 | return dJointGetAMotorAngle(this->_id, anum); | ||
112 | } | ||
113 | |||
114 | |||
115 | //SetParam | ||
116 | |||
117 | void JointAMotor::SetParam(int parameter, double value) | ||
118 | { | ||
119 | dJointSetAMotorParam(this->_id, parameter, value); | ||
120 | } | ||
121 | |||
122 | |||
123 | //GetParam | ||
124 | |||
125 | double JointAMotor::GetParam(int parameter) | ||
126 | { | ||
127 | return dJointGetAMotorParam(this->_id, parameter); | ||
128 | } | ||
129 | |||
130 | |||
131 | //SetMode | ||
132 | |||
133 | void JointAMotor::SetMode(int mode) | ||
134 | { | ||
135 | dJointSetAMotorMode(this->_id, mode); | ||
136 | } | ||
137 | |||
138 | |||
139 | //GetMode | ||
140 | |||
141 | int JointAMotor::GetMode(void) | ||
142 | { | ||
143 | return dJointGetAMotorMode(this->_id); | ||
144 | } | ||
145 | |||
146 | |||
147 | //GetAxisRel | ||
148 | |||
149 | int JointAMotor::GetAxisRel(int anum) | ||
150 | { | ||
151 | return dJointGetAMotorAxisRel(this->_id, anum); | ||
152 | } | ||
153 | |||
154 | |||
155 | //GetAngleRate | ||
156 | |||
157 | double JointAMotor::GetAngleRate(int anum) | ||
158 | { | ||
159 | return dJointGetAMotorAngleRate(this->_id, anum); | ||
160 | } | ||
161 | |||
162 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "Joint.h" | ||
4 | |||
5 | namespace ODEManaged | ||
6 | { | ||
7 | __gc public class JointAMotor : public Joint | ||
8 | { | ||
9 | public: | ||
10 | |||
11 | |||
12 | //Constructors | ||
13 | |||
14 | JointAMotor (void); | ||
15 | JointAMotor (World &world); | ||
16 | JointAMotor (World &world, JointGroup &jointGroup); | ||
17 | |||
18 | |||
19 | //Destructor | ||
20 | |||
21 | virtual ~JointAMotor (void); | ||
22 | |||
23 | |||
24 | //Methods | ||
25 | |||
26 | //Basic Stuff | ||
27 | |||
28 | //Overloaded Create | ||
29 | void Create (World &world, JointGroup &jointGroup); | ||
30 | void Create (World &world); | ||
31 | |||
32 | void SetNumAxes (int num); | ||
33 | int GetNumAxes (void); | ||
34 | |||
35 | void SetAxis (int anum, int rel, double x, double y, double z); | ||
36 | Vector3 GetAxis (int anum); | ||
37 | |||
38 | void SetAngle (int anum, double angle); | ||
39 | double GetAngle (int anum); | ||
40 | |||
41 | void SetMode (int mode); | ||
42 | int GetMode (void); | ||
43 | |||
44 | int GetAxisRel (int anum); | ||
45 | double GetAngleRate (int anum); | ||
46 | |||
47 | //Overloaded Attach | ||
48 | void Attach (Body &body1, Body &body2); | ||
49 | void Attach (Body &body1); | ||
50 | |||
51 | |||
52 | //Movement Parameters | ||
53 | |||
54 | void SetParam (int parameter, double value); | ||
55 | double GetParam (int parameter); | ||
56 | |||
57 | |||
58 | |||
59 | |||
60 | |||
61 | }; | ||
62 | } | ||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "jointball.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | JointBall::JointBall(void) : Joint(){} | ||
12 | |||
13 | |||
14 | JointBall::JointBall(World &world) | ||
15 | { | ||
16 | if(this->_id) dJointDestroy(this->_id); | ||
17 | _id = dJointCreateBall(world.Id(), 0); | ||
18 | } | ||
19 | |||
20 | |||
21 | JointBall::JointBall(World &world, JointGroup &jointGroup) | ||
22 | { | ||
23 | if(this->_id) dJointDestroy(this->_id); | ||
24 | _id = dJointCreateBall(world.Id(), jointGroup.Id()); | ||
25 | } | ||
26 | |||
27 | |||
28 | //Destructor | ||
29 | |||
30 | JointBall::~JointBall(void){} | ||
31 | |||
32 | |||
33 | //Methods | ||
34 | |||
35 | //Overloaded Create | ||
36 | void JointBall::Create(World &world, JointGroup &jointGroup) | ||
37 | { | ||
38 | if(this->_id) dJointDestroy(this->_id); | ||
39 | _id = dJointCreateBall(world.Id(), jointGroup.Id()); | ||
40 | } | ||
41 | |||
42 | void JointBall::Create(World &world) | ||
43 | { | ||
44 | if(this->_id) dJointDestroy(this->_id); | ||
45 | _id = dJointCreateBall(world.Id(), 0); | ||
46 | } | ||
47 | |||
48 | |||
49 | //Overloaded Attach | ||
50 | void JointBall::Attach(Body &body1, Body &body2) | ||
51 | { | ||
52 | dJointAttach(this->_id, body1.Id(), body2.Id()); | ||
53 | } | ||
54 | |||
55 | void JointBall::Attach(Body &body1) | ||
56 | { | ||
57 | dJointAttach(this->_id, body1.Id(), 0); | ||
58 | } | ||
59 | |||
60 | |||
61 | //SetAnchor | ||
62 | void JointBall::SetAnchor(double x, double y ,double z) | ||
63 | { | ||
64 | dJointSetBallAnchor(this->_id, x, y, z); | ||
65 | } | ||
66 | |||
67 | //GetAnchor | ||
68 | Vector3 JointBall::GetAnchor(void) | ||
69 | { | ||
70 | Vector3 retVal; | ||
71 | dVector3 temp; | ||
72 | dJointGetBallAnchor(this->_id,temp); | ||
73 | retVal.x = temp[0]; | ||
74 | retVal.y = temp[1]; | ||
75 | retVal.z = temp[2]; | ||
76 | return retVal; | ||
77 | } | ||
78 | |||
79 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "Joint.h" | ||
4 | |||
5 | namespace ODEManaged | ||
6 | { | ||
7 | __gc public class JointBall : public Joint | ||
8 | { | ||
9 | public: | ||
10 | |||
11 | //Constructors | ||
12 | |||
13 | JointBall(void); | ||
14 | JointBall(World &world); | ||
15 | JointBall(World &world, JointGroup &jointGroup); | ||
16 | |||
17 | |||
18 | //Destructors | ||
19 | |||
20 | virtual ~JointBall(void); | ||
21 | |||
22 | |||
23 | //Methods | ||
24 | |||
25 | //Overloaded Create | ||
26 | void Create(World &world, JointGroup &jointGroup); | ||
27 | void Create(World &world); | ||
28 | |||
29 | //Overloaded Attach | ||
30 | void Attach(Body &body1, Body &body2); | ||
31 | void Attach(Body &body1); | ||
32 | |||
33 | void SetAnchor(double x, double y, double z); | ||
34 | Vector3 GetAnchor(void); | ||
35 | |||
36 | }; | ||
37 | |||
38 | } | ||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "jointfixed.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | JointFixed::JointFixed(void) : Joint(){} | ||
12 | |||
13 | |||
14 | JointFixed::JointFixed(World &world) | ||
15 | { | ||
16 | if(this->_id) dJointDestroy(this->_id); | ||
17 | _id = dJointCreateFixed(world.Id(),0); | ||
18 | } | ||
19 | |||
20 | |||
21 | JointFixed::JointFixed(World &world, JointGroup &jointGroup) | ||
22 | { | ||
23 | if(this->_id) dJointDestroy(this->_id); | ||
24 | _id = dJointCreateFixed(world.Id(), jointGroup.Id()); | ||
25 | } | ||
26 | |||
27 | |||
28 | //Destructor | ||
29 | |||
30 | JointFixed::~JointFixed(void){} | ||
31 | |||
32 | |||
33 | //Methods | ||
34 | |||
35 | //Overloaded Create | ||
36 | void JointFixed::Create(World &world, JointGroup &jointGroup) | ||
37 | { | ||
38 | if(this->_id) dJointDestroy(this->_id); | ||
39 | _id = dJointCreateFixed(world.Id(), jointGroup.Id()); | ||
40 | } | ||
41 | |||
42 | void JointFixed::Create(World &world) | ||
43 | { | ||
44 | if(this->_id) dJointDestroy(this->_id); | ||
45 | _id = dJointCreateFixed(world.Id(), 0); | ||
46 | } | ||
47 | |||
48 | |||
49 | //Overloaded Attach | ||
50 | void JointFixed::Attach(Body &body1, Body &body2) | ||
51 | { | ||
52 | dJointAttach(this->_id, body1.Id(), body2.Id()); | ||
53 | } | ||
54 | |||
55 | void JointFixed::Attach(Body &body1) | ||
56 | { | ||
57 | dJointAttach(this->_id, body1.Id(), 0); | ||
58 | } | ||
59 | |||
60 | |||
61 | //Fixed | ||
62 | void JointFixed::SetFixed(void) | ||
63 | { | ||
64 | dJointSetFixed(this->_id); | ||
65 | } | ||
66 | |||
67 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "Joint.h" | ||
4 | |||
5 | namespace ODEManaged | ||
6 | { | ||
7 | __gc public class JointFixed : public Joint | ||
8 | { | ||
9 | public: | ||
10 | |||
11 | //Constructors | ||
12 | |||
13 | JointFixed(void); | ||
14 | JointFixed(World &world); | ||
15 | JointFixed(World &world, JointGroup &jointGroup); | ||
16 | |||
17 | |||
18 | //Destructor | ||
19 | |||
20 | virtual ~JointFixed(void); | ||
21 | |||
22 | |||
23 | //Methods | ||
24 | |||
25 | //Overloaded Create | ||
26 | void Create(World &world, JointGroup &jointGroup); | ||
27 | void Create(World &world); | ||
28 | |||
29 | //Overloaded Attach | ||
30 | void Attach(Body &body1, Body &body2); | ||
31 | void Attach(Body &body1); | ||
32 | |||
33 | void SetFixed(void); | ||
34 | |||
35 | }; | ||
36 | |||
37 | } | ||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "jointgroup.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | JointGroup::JointGroup(void) | ||
12 | { | ||
13 | _id=0; | ||
14 | } | ||
15 | |||
16 | JointGroup::JointGroup (int maxSize) | ||
17 | { | ||
18 | _id = dJointGroupCreate(maxSize); | ||
19 | } | ||
20 | |||
21 | |||
22 | //Destructor | ||
23 | |||
24 | JointGroup::~JointGroup(void) | ||
25 | { | ||
26 | dJointGroupDestroy(this->_id); | ||
27 | } | ||
28 | |||
29 | |||
30 | //Methods | ||
31 | |||
32 | //ID | ||
33 | dJointGroupID JointGroup::Id() | ||
34 | { | ||
35 | return _id; | ||
36 | } | ||
37 | |||
38 | |||
39 | //Create | ||
40 | void JointGroup::Create (int maxSize) | ||
41 | { | ||
42 | if(_id) dJointGroupDestroy(_id); | ||
43 | _id = dJointGroupCreate(maxSize); | ||
44 | } | ||
45 | |||
46 | |||
47 | //Empty | ||
48 | void JointGroup::Empty (void) | ||
49 | { | ||
50 | dJointGroupEmpty(this->_id); | ||
51 | } | ||
52 | |||
53 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | namespace ODEManaged | ||
4 | { | ||
5 | __gc public class JointGroup | ||
6 | { | ||
7 | public: | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | JointGroup(void); | ||
12 | JointGroup(int maxSize); | ||
13 | |||
14 | |||
15 | //Destructor | ||
16 | |||
17 | ~JointGroup(void); | ||
18 | |||
19 | |||
20 | //Methods | ||
21 | |||
22 | dJointGroupID Id(void); | ||
23 | void Create(int maxSize); | ||
24 | void Empty(void); | ||
25 | |||
26 | |||
27 | private: | ||
28 | |||
29 | dJointGroupID _id; | ||
30 | |||
31 | }; | ||
32 | |||
33 | } | ||
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 @@ | |||
1 | #include "stdafx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "jointhinge.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | JointHinge::JointHinge(void) : Joint(){} | ||
12 | |||
13 | |||
14 | JointHinge::JointHinge(World &world) | ||
15 | { | ||
16 | if(this->_id) dJointDestroy(this->_id); | ||
17 | _id = dJointCreateHinge(world.Id(), 0); | ||
18 | } | ||
19 | |||
20 | |||
21 | JointHinge::JointHinge(World &world, JointGroup &jointGroup) | ||
22 | { | ||
23 | if(this->_id) dJointDestroy(this->_id); | ||
24 | _id = dJointCreateHinge(world.Id(), jointGroup.Id()); | ||
25 | } | ||
26 | |||
27 | |||
28 | //Destructor | ||
29 | |||
30 | JointHinge::~JointHinge(void){} | ||
31 | |||
32 | |||
33 | //Methods | ||
34 | |||
35 | //Overloaded Create | ||
36 | void JointHinge::Create(World &world, JointGroup &jointGroup) | ||
37 | { | ||
38 | if(this->_id) dJointDestroy(this->_id); | ||
39 | _id = dJointCreateHinge(world.Id(), jointGroup.Id()); | ||
40 | } | ||
41 | |||
42 | void JointHinge::Create(World &world) | ||
43 | { | ||
44 | if(this->_id) dJointDestroy(this->_id); | ||
45 | _id = dJointCreateHinge(world.Id(), 0); | ||
46 | } | ||
47 | |||
48 | |||
49 | //Overloaded Attach | ||
50 | void JointHinge::Attach(Body &body1, Body &body2) | ||
51 | { | ||
52 | dJointAttach(this->_id, body1.Id(), body2.Id()); | ||
53 | } | ||
54 | |||
55 | void JointHinge::Attach(Body &body1) | ||
56 | { | ||
57 | dJointAttach(this->_id, body1.Id(), 0); | ||
58 | } | ||
59 | |||
60 | |||
61 | //SetAxis | ||
62 | void JointHinge::SetAxis(double x, double y, double z) | ||
63 | { | ||
64 | dJointSetHingeAxis(this->_id, x, y, z); | ||
65 | } | ||
66 | |||
67 | //GetAxis | ||
68 | Vector3 JointHinge::GetAxis(void) | ||
69 | { | ||
70 | Vector3 retVal; | ||
71 | dVector3 temp; | ||
72 | dJointGetHingeAxis(this->_id, temp); | ||
73 | retVal.x = temp[0]; | ||
74 | retVal.y = temp[1]; | ||
75 | retVal.z = temp[2]; | ||
76 | return retVal; | ||
77 | } | ||
78 | |||
79 | |||
80 | //SetAnchor | ||
81 | void JointHinge::SetAnchor(double x, double y, double z) | ||
82 | { | ||
83 | dJointSetHingeAnchor(this->_id, x, y, z); | ||
84 | } | ||
85 | |||
86 | //GetAnchor | ||
87 | Vector3 JointHinge::GetAnchor(void) | ||
88 | { | ||
89 | Vector3 retVal; | ||
90 | dVector3 temp; | ||
91 | dJointGetHingeAnchor(this->_id, temp); | ||
92 | retVal.x = temp[0]; | ||
93 | retVal.y = temp[1]; | ||
94 | retVal.z = temp[2]; | ||
95 | return retVal; | ||
96 | } | ||
97 | |||
98 | |||
99 | //Movement Parameters | ||
100 | |||
101 | //SetAllMovParams | ||
102 | void JointHinge::SetAllMovParams(double LoStop, double HiStop, | ||
103 | double Velocity, double MaxForce, | ||
104 | double FudgeFactor, double Bounce, | ||
105 | double StopERP, double StopCFM) | ||
106 | { | ||
107 | if (LoStop > -3.141592653 && LoStop <= 0) | ||
108 | dJointSetHingeParam(this->_id, dParamLoStop, LoStop); | ||
109 | |||
110 | if (HiStop < 3.141592653 && HiStop >= 0) | ||
111 | dJointSetHingeParam(this->_id, dParamHiStop, HiStop); | ||
112 | |||
113 | dJointSetHingeParam(this->_id, dParamVel, Velocity); | ||
114 | dJointSetHingeParam(this->_id, dParamFMax, MaxForce); | ||
115 | dJointSetHingeParam(this->_id, dParamFudgeFactor, FudgeFactor); | ||
116 | dJointSetHingeParam(this->_id, dParamBounce, Bounce); | ||
117 | dJointSetHingeParam(this->_id, dParamStopERP, StopERP); | ||
118 | dJointSetHingeParam(this->_id, dParamStopCFM, StopCFM); | ||
119 | } | ||
120 | |||
121 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "Joint.h" | ||
4 | #include "CommonMgd.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | __gc public class JointHinge : public Joint | ||
9 | { | ||
10 | public: | ||
11 | |||
12 | //Constructors | ||
13 | |||
14 | JointHinge(void); | ||
15 | JointHinge(World &world); | ||
16 | JointHinge(World &world, JointGroup &jointGroup); | ||
17 | |||
18 | |||
19 | //Destructor | ||
20 | |||
21 | virtual~JointHinge(void); | ||
22 | |||
23 | |||
24 | //Methods | ||
25 | |||
26 | //Overloaded Create | ||
27 | void Create(World &world, JointGroup &jointGroup); | ||
28 | void Create(World &world); | ||
29 | |||
30 | //Overloaded Attach | ||
31 | void Attach(Body &body1, Body &body2); | ||
32 | void Attach(Body &body1); | ||
33 | |||
34 | void SetAnchor(double x, double y, double z); | ||
35 | Vector3 GetAnchor(void); | ||
36 | |||
37 | void SetAxis(double x, double y, double z); | ||
38 | Vector3 GetAxis(void); | ||
39 | |||
40 | void SetAllMovParams(double LoStop, double HiStop, | ||
41 | double Velocity, double MaxForce, | ||
42 | double FudgeFactor, double Bounce, | ||
43 | double StopERP, double StopCFM); | ||
44 | |||
45 | |||
46 | //Properties | ||
47 | |||
48 | //LoStop | ||
49 | __property double get_LoStop(void) | ||
50 | { | ||
51 | return dJointGetHingeParam(this->_id, dParamLoStop); | ||
52 | } | ||
53 | |||
54 | __property void set_LoStop(double value) | ||
55 | { | ||
56 | if (value > -3.141592653 && value <= 0) | ||
57 | dJointSetHingeParam(this->_id, dParamLoStop, value); | ||
58 | } | ||
59 | |||
60 | |||
61 | //HiStop | ||
62 | __property double get_HiStop(void) | ||
63 | { | ||
64 | return dJointGetHingeParam(this->_id, dParamHiStop); | ||
65 | } | ||
66 | |||
67 | __property void set_HiStop(double value) | ||
68 | { | ||
69 | if (value < 3.141592653 && value >= 0) | ||
70 | dJointSetHingeParam(this->_id, dParamHiStop, value); | ||
71 | } | ||
72 | |||
73 | |||
74 | //Velocity | ||
75 | __property double get_Velocity(void) | ||
76 | { | ||
77 | return dJointGetHingeParam(this->_id, dParamVel); | ||
78 | } | ||
79 | |||
80 | __property void set_Velocity(double value) | ||
81 | { | ||
82 | dJointSetHingeParam(this->_id, dParamVel, value); | ||
83 | } | ||
84 | |||
85 | |||
86 | //MaxForce | ||
87 | __property double get_MaxForce(void) | ||
88 | { | ||
89 | return dJointGetHingeParam(this->_id, dParamFMax); | ||
90 | } | ||
91 | |||
92 | __property void set_MaxForce(double value) | ||
93 | { | ||
94 | dJointSetHingeParam(this->_id, dParamFMax, value); | ||
95 | } | ||
96 | |||
97 | |||
98 | //FudgeFactor | ||
99 | __property double get_FudgeFactor(void) | ||
100 | { | ||
101 | return dJointGetHingeParam(this->_id, dParamFudgeFactor); | ||
102 | } | ||
103 | |||
104 | __property void set_FudgeFactor(double value) | ||
105 | { | ||
106 | dJointSetHingeParam(this->_id, dParamFudgeFactor, value); | ||
107 | } | ||
108 | |||
109 | |||
110 | //Bounce | ||
111 | __property double get_Bounce(void) | ||
112 | { | ||
113 | return dJointGetHingeParam(this->_id, dParamBounce); | ||
114 | } | ||
115 | |||
116 | __property void set_Bounce(double value) | ||
117 | { | ||
118 | dJointSetHingeParam(this->_id, dParamBounce, value); | ||
119 | } | ||
120 | |||
121 | |||
122 | //StopERP | ||
123 | __property double get_StopERP(void) | ||
124 | { | ||
125 | return dJointGetHingeParam(this->_id, dParamStopERP); | ||
126 | } | ||
127 | |||
128 | __property void set_StopERP(double value) | ||
129 | { | ||
130 | dJointSetHingeParam(this->_id, dParamStopERP, value); | ||
131 | } | ||
132 | |||
133 | |||
134 | //StopCFM | ||
135 | __property double get_StopCFM(void) | ||
136 | { | ||
137 | return dJointGetHingeParam(this->_id, dParamStopCFM); | ||
138 | } | ||
139 | |||
140 | __property void set_StopCFM(double value) | ||
141 | { | ||
142 | dJointSetHingeParam(this->_id, dParamStopCFM, value); | ||
143 | } | ||
144 | |||
145 | |||
146 | //GetAngle | ||
147 | __property double get_Angle(void) | ||
148 | { | ||
149 | return dJointGetHingeAngle(this->_id); | ||
150 | } | ||
151 | |||
152 | |||
153 | //GetAngleRate | ||
154 | __property double get_AngleRate(void) | ||
155 | { | ||
156 | return dJointGetHingeAngleRate(this->_id); | ||
157 | } | ||
158 | |||
159 | }; | ||
160 | |||
161 | } | ||
162 | |||
163 | // void SetSuspensionERP(double value); | ||
164 | // double GetSuspensionERP(void); | ||
165 | |||
166 | // void SetSuspensionCFM(double value); | ||
167 | // double GetSuspensionCFM(void); | ||
168 | |||
169 | /* | ||
170 | //SetSuspensionERP | ||
171 | void JointHinge::SetSuspensionERP(double value) | ||
172 | { | ||
173 | dJointSetHingeParam(this->_id, dParamSuspensionERP, value); | ||
174 | } | ||
175 | |||
176 | //GetSuspensionERP | ||
177 | double JointHinge::GetSuspensionERP(void) | ||
178 | { | ||
179 | return dJointGetHingeParam(this->_id, dParamSuspensionERP); | ||
180 | } | ||
181 | |||
182 | |||
183 | //SetSuspensionCFM | ||
184 | void JointHinge::SetSuspensionCFM(double value) | ||
185 | { | ||
186 | dJointSetHingeParam(this->_id, dParamSuspensionCFM, value); | ||
187 | } | ||
188 | |||
189 | //GetSuspensionCFM | ||
190 | double JointHinge::GetSuspensionCFM(void) | ||
191 | { | ||
192 | return dJointGetHingeParam(this->_id, dParamSuspensionCFM); | ||
193 | } | ||
194 | |||
195 | */ | ||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "jointhinge2.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | //Constructors | ||
9 | JointHinge2::JointHinge2(void) : Joint(){} | ||
10 | |||
11 | JointHinge2::JointHinge2(World &world) | ||
12 | { | ||
13 | if(this->_id) dJointDestroy(this->_id); | ||
14 | _id = dJointCreateHinge2(world.Id(),0); | ||
15 | } | ||
16 | |||
17 | JointHinge2::JointHinge2(World &world, JointGroup &jointGroup) | ||
18 | { | ||
19 | if(this->_id) dJointDestroy(this->_id); | ||
20 | _id = dJointCreateHinge2(world.Id(), jointGroup.Id()); | ||
21 | } | ||
22 | |||
23 | //Destructor | ||
24 | JointHinge2::~JointHinge2(void){} | ||
25 | |||
26 | //CreateHinge2 (overload 1) | ||
27 | void JointHinge2::Create(World &world, JointGroup &jointGroup) | ||
28 | { | ||
29 | if(this->_id) dJointDestroy(this->_id); | ||
30 | _id = dJointCreateHinge2(world.Id(), jointGroup.Id()); | ||
31 | } | ||
32 | |||
33 | //CreateHinge2 (overload 2) | ||
34 | void JointHinge2::Create(World &world) | ||
35 | { | ||
36 | if(this->_id) dJointDestroy(this->_id); | ||
37 | _id = dJointCreateHinge2(world.Id(),0); | ||
38 | } | ||
39 | |||
40 | //SetAnchor1 | ||
41 | void JointHinge2::SetAnchor (double x, double y ,double z) | ||
42 | { | ||
43 | dJointSetHinge2Anchor(_id, x,y,z); | ||
44 | } | ||
45 | |||
46 | //GetAnchor1 | ||
47 | Vector3 JointHinge2::GetAnchor() | ||
48 | { | ||
49 | Vector3 retVal; | ||
50 | dVector3 temp; | ||
51 | dJointGetHinge2Anchor(_id,temp); | ||
52 | retVal.x = temp[0]; | ||
53 | retVal.y = temp[1]; | ||
54 | retVal.z = temp[2]; | ||
55 | return retVal; | ||
56 | } | ||
57 | |||
58 | //SetAxis1 | ||
59 | void JointHinge2::SetAxis1 (double x, double y ,double z) | ||
60 | { | ||
61 | dJointSetHinge2Axis1(_id, x,y,z); | ||
62 | } | ||
63 | |||
64 | //GetAxis1 | ||
65 | Vector3 JointHinge2::GetAxis1() | ||
66 | { | ||
67 | Vector3 retVal; | ||
68 | dVector3 temp; | ||
69 | dJointGetHinge2Axis1(_id,temp); | ||
70 | retVal.x = temp[0]; | ||
71 | retVal.y = temp[1]; | ||
72 | retVal.z = temp[2]; | ||
73 | return retVal; | ||
74 | } | ||
75 | |||
76 | //SetAxis2 | ||
77 | void JointHinge2::SetAxis2 (double x, double y ,double z) | ||
78 | { | ||
79 | dJointSetHinge2Axis2(_id, x,y,z); | ||
80 | } | ||
81 | |||
82 | //GetAxis2 | ||
83 | Vector3 JointHinge2::GetAxis2() | ||
84 | { | ||
85 | Vector3 retVal; | ||
86 | dVector3 temp; | ||
87 | dJointGetHinge2Axis2(_id,temp); | ||
88 | retVal.x = temp[0]; | ||
89 | retVal.y = temp[1]; | ||
90 | retVal.z = temp[2]; | ||
91 | return retVal; | ||
92 | } | ||
93 | |||
94 | //GetAngle1 | ||
95 | double JointHinge2::GetAngle1 () | ||
96 | { | ||
97 | return dJointGetHinge2Angle1(this->_id); | ||
98 | } | ||
99 | |||
100 | //GetAngle1Rate | ||
101 | double JointHinge2::GetAngle1Rate () | ||
102 | { | ||
103 | return dJointGetHinge2Angle1Rate(this->_id); | ||
104 | } | ||
105 | |||
106 | ////GetAngle hmm, this doesn't exist | ||
107 | //double JointHinge2::GetAngle2 () | ||
108 | //{ | ||
109 | // return dJointGetHinge2Angle2(this->_id); | ||
110 | //} | ||
111 | |||
112 | //GetAngle2Rate | ||
113 | double JointHinge2::GetAngle2Rate () | ||
114 | { | ||
115 | return dJointGetHinge2Angle2Rate(this->_id); | ||
116 | } | ||
117 | |||
118 | |||
119 | //Attach (overload 1) | ||
120 | void JointHinge2::Attach (Body &body1, Body &body2) | ||
121 | { | ||
122 | dJointAttach(_id, body1.Id(),body2.Id()); | ||
123 | } | ||
124 | |||
125 | //Attach (overload 2) | ||
126 | //TODO: possibly add an overload that takes anchor as a param also. | ||
127 | void JointHinge2::Attach (Body &body1) | ||
128 | { | ||
129 | dJointAttach(_id, body1.Id(),0); | ||
130 | } | ||
131 | |||
132 | |||
133 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "Joint.h" | ||
4 | #include "CommonMgd.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | __gc public class JointHinge2 : public Joint | ||
9 | { | ||
10 | public: | ||
11 | |||
12 | |||
13 | //Constructors | ||
14 | |||
15 | JointHinge2 (void); | ||
16 | JointHinge2 (World &world); | ||
17 | JointHinge2 (World &world, JointGroup &jointGroup); | ||
18 | |||
19 | //Destructors | ||
20 | |||
21 | virtual ~JointHinge2 (void); | ||
22 | |||
23 | |||
24 | //Methods | ||
25 | |||
26 | //Overloaded Hinge.Create | ||
27 | void Create (World &world, JointGroup &jointGroup); | ||
28 | void Create (World &world); | ||
29 | |||
30 | void SetAnchor (double x, double y, double z); | ||
31 | Vector3 GetAnchor (void); | ||
32 | |||
33 | void SetAxis1 (double x, double y, double z); | ||
34 | Vector3 GetAxis1 (void); | ||
35 | |||
36 | void SetAxis2 (double x, double y, double z); | ||
37 | Vector3 GetAxis2 (void); | ||
38 | |||
39 | double GetAngle1 (void); | ||
40 | double GetAngle1Rate (void); | ||
41 | |||
42 | //double GetAngle2 (void); | ||
43 | double GetAngle2Rate (void); | ||
44 | |||
45 | void Attach (Body &body1, Body &body2); | ||
46 | void Attach( Body &body1); | ||
47 | }; | ||
48 | } | ||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "jointslider.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructors | ||
10 | |||
11 | JointSlider::JointSlider(void) : Joint(){} | ||
12 | |||
13 | |||
14 | JointSlider::JointSlider(World &world) | ||
15 | { | ||
16 | if(this->_id) dJointDestroy(this->_id); | ||
17 | _id = dJointCreateSlider(world.Id(), 0); | ||
18 | } | ||
19 | |||
20 | |||
21 | JointSlider::JointSlider(World &world, JointGroup &jointGroup) | ||
22 | { | ||
23 | if(this->_id) dJointDestroy(this->_id); | ||
24 | _id = dJointCreateSlider(world.Id(), jointGroup.Id()); | ||
25 | } | ||
26 | |||
27 | |||
28 | //Destructor | ||
29 | |||
30 | JointSlider::~JointSlider(void){} | ||
31 | |||
32 | |||
33 | //Methods | ||
34 | |||
35 | //Overloaded Create | ||
36 | void JointSlider::Create(World &world, JointGroup &jointGroup) | ||
37 | { | ||
38 | if(this->_id) dJointDestroy(this->_id); | ||
39 | _id = dJointCreateSlider(world.Id(), jointGroup.Id()); | ||
40 | } | ||
41 | |||
42 | void JointSlider::Create(World &world) | ||
43 | { | ||
44 | if(this->_id) dJointDestroy(this->_id); | ||
45 | _id = dJointCreateSlider(world.Id(), 0); | ||
46 | } | ||
47 | |||
48 | |||
49 | //Overloaded Attach | ||
50 | void JointSlider::Attach(Body &body1, Body &body2) | ||
51 | { | ||
52 | dJointAttach(this->_id, body1.Id(), body2.Id()); | ||
53 | } | ||
54 | |||
55 | void JointSlider::Attach(Body &body1) | ||
56 | { | ||
57 | dJointAttach(this->_id, body1.Id(), 0); | ||
58 | } | ||
59 | |||
60 | |||
61 | //SetAxis | ||
62 | void JointSlider::SetAxis(double x, double y, double z) | ||
63 | { | ||
64 | dJointSetSliderAxis(this->_id, x, y, z); | ||
65 | } | ||
66 | |||
67 | //GetAxis | ||
68 | Vector3 JointSlider::GetAxis(void) | ||
69 | { | ||
70 | Vector3 retVal; | ||
71 | dVector3 temp; | ||
72 | dJointGetSliderAxis(this->_id, temp); | ||
73 | retVal.x = temp[0]; | ||
74 | retVal.y = temp[1]; | ||
75 | retVal.z = temp[2]; | ||
76 | return retVal; | ||
77 | } | ||
78 | |||
79 | |||
80 | //Movement Parameters | ||
81 | |||
82 | //SetAllMovParams | ||
83 | void JointSlider::SetAllMovParams(double LoStop, double HiStop, | ||
84 | double Velocity, double MaxForce, | ||
85 | double FudgeFactor, double Bounce, | ||
86 | double StopERP, double StopCFM) | ||
87 | { | ||
88 | if (LoStop <= 0) | ||
89 | dJointSetHingeParam(this->_id, dParamLoStop, LoStop); | ||
90 | |||
91 | if (HiStop >= 0) | ||
92 | dJointSetHingeParam(this->_id, dParamHiStop, HiStop); | ||
93 | |||
94 | dJointSetSliderParam(this->_id, dParamVel, Velocity); | ||
95 | dJointSetSliderParam(this->_id, dParamFMax, MaxForce); | ||
96 | dJointSetSliderParam(this->_id, dParamFudgeFactor, FudgeFactor); | ||
97 | dJointSetSliderParam(this->_id, dParamBounce, Bounce); | ||
98 | dJointSetSliderParam(this->_id, dParamStopERP, StopERP); | ||
99 | dJointSetSliderParam(this->_id, dParamStopCFM, StopCFM); | ||
100 | } | ||
101 | |||
102 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "Joint.h" | ||
4 | #include "CommonMgd.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | __gc public class JointSlider : public Joint | ||
9 | { | ||
10 | public: | ||
11 | |||
12 | |||
13 | //Constructors | ||
14 | |||
15 | JointSlider(void); | ||
16 | JointSlider(World &world); | ||
17 | JointSlider(World &world, JointGroup &jointGroup); | ||
18 | |||
19 | |||
20 | //Destructors | ||
21 | |||
22 | virtual ~JointSlider(void); | ||
23 | |||
24 | |||
25 | //Methods | ||
26 | |||
27 | //Overloaded Create | ||
28 | void Create(World &world, JointGroup &jointGroup); | ||
29 | void Create(World &world); | ||
30 | |||
31 | //Overloaded Attach | ||
32 | void Attach(Body &body1, Body &body2); | ||
33 | void Attach(Body &body1); | ||
34 | |||
35 | void SetAxis(double x, double y, double z); | ||
36 | Vector3 GetAxis(void); | ||
37 | |||
38 | void SetAllMovParams(double LoStop, double HiStop, | ||
39 | double Velocity, double MaxForce, | ||
40 | double FudgeFactor, double Bounce, | ||
41 | double StopERP, double StopCFM); | ||
42 | |||
43 | |||
44 | //Properties | ||
45 | |||
46 | //LoStop | ||
47 | __property double get_LoStop(void) | ||
48 | { | ||
49 | return dJointGetSliderParam(this->_id, dParamLoStop); | ||
50 | } | ||
51 | |||
52 | __property void set_LoStop(double value) | ||
53 | { | ||
54 | if (value <=0) | ||
55 | dJointSetSliderParam(this->_id, dParamLoStop, value); | ||
56 | } | ||
57 | |||
58 | |||
59 | //HiStop | ||
60 | __property double get_HiStop(void) | ||
61 | { | ||
62 | return dJointGetSliderParam(this->_id, dParamHiStop); | ||
63 | } | ||
64 | |||
65 | __property void set_HiStop(double value) | ||
66 | { | ||
67 | if (value >= 0) | ||
68 | dJointSetSliderParam(this->_id, dParamHiStop, value); | ||
69 | } | ||
70 | |||
71 | |||
72 | //Velocity | ||
73 | __property double get_Velocity(void) | ||
74 | { | ||
75 | return dJointGetSliderParam(this->_id, dParamVel); | ||
76 | } | ||
77 | |||
78 | __property void set_Velocity(double value) | ||
79 | { | ||
80 | dJointSetSliderParam(this->_id, dParamVel, value); | ||
81 | } | ||
82 | |||
83 | |||
84 | //MaxForce | ||
85 | __property double get_MaxForce(void) | ||
86 | { | ||
87 | return dJointGetSliderParam(this->_id, dParamFMax); | ||
88 | } | ||
89 | |||
90 | __property void set_MaxForce(double value) | ||
91 | { | ||
92 | dJointSetSliderParam(this->_id, dParamFMax, value); | ||
93 | } | ||
94 | |||
95 | |||
96 | //FudgeFactor | ||
97 | __property double get_FudgeFactor(void) | ||
98 | { | ||
99 | return dJointGetSliderParam(this->_id, dParamFudgeFactor); | ||
100 | } | ||
101 | |||
102 | __property void set_FudgeFactor(double value) | ||
103 | { | ||
104 | dJointSetSliderParam(this->_id, dParamFudgeFactor, value); | ||
105 | } | ||
106 | |||
107 | |||
108 | //Bounce | ||
109 | __property double get_Bounce(void) | ||
110 | { | ||
111 | return dJointGetSliderParam(this->_id, dParamBounce); | ||
112 | } | ||
113 | |||
114 | __property void set_Bounce(double value) | ||
115 | { | ||
116 | dJointSetSliderParam(this->_id, dParamBounce, value); | ||
117 | } | ||
118 | |||
119 | |||
120 | //StopERP | ||
121 | __property double get_StopERP(void) | ||
122 | { | ||
123 | return dJointGetSliderParam(this->_id, dParamStopERP); | ||
124 | } | ||
125 | |||
126 | __property void set_StopERP(double value) | ||
127 | { | ||
128 | dJointSetSliderParam(this->_id, dParamStopERP, value); | ||
129 | } | ||
130 | |||
131 | |||
132 | //StopCFM | ||
133 | __property double get_StopCFM(void) | ||
134 | { | ||
135 | return dJointGetSliderParam(this->_id, dParamStopCFM); | ||
136 | } | ||
137 | |||
138 | __property void set_StopCFM(double value) | ||
139 | { | ||
140 | dJointSetSliderParam(this->_id, dParamStopCFM, value); | ||
141 | } | ||
142 | |||
143 | |||
144 | //GetAngle | ||
145 | __property double get_Position(void) | ||
146 | { | ||
147 | return dJointGetSliderPosition(this->_id); | ||
148 | } | ||
149 | |||
150 | |||
151 | //GetAngleRate | ||
152 | __property double get_PositionRate(void) | ||
153 | { | ||
154 | return dJointGetSliderPositionRate(this->_id); | ||
155 | } | ||
156 | |||
157 | }; | ||
158 | } | ||
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 --- /dev/null +++ b/libraries/ode-0.9/contrib/DotNetManaged/Release/ode.dll | |||
Binary files 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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "Space.h" | ||
5 | #include "TEST.h" | ||
6 | |||
7 | namespace ODEManaged | ||
8 | { | ||
9 | |||
10 | //Constructor | ||
11 | |||
12 | Space::Space(void) | ||
13 | { | ||
14 | _id = dSimpleSpaceCreate(); | ||
15 | } | ||
16 | |||
17 | Space::Space(int minlevel, int maxlevel) | ||
18 | { | ||
19 | _id = dHashSpaceCreate(); | ||
20 | dHashSpaceSetLevels(this->_id, minlevel, maxlevel); | ||
21 | } | ||
22 | |||
23 | |||
24 | //Destructor | ||
25 | |||
26 | Space::~Space(void) | ||
27 | { | ||
28 | dSpaceDestroy(this->_id); | ||
29 | } | ||
30 | |||
31 | |||
32 | //Methods | ||
33 | |||
34 | //Id | ||
35 | dSpaceID Space::Id() | ||
36 | { | ||
37 | return _id; | ||
38 | } | ||
39 | |||
40 | |||
41 | //Collide | ||
42 | void Space::Collide(void *data, dNearCallback *callback) | ||
43 | { | ||
44 | dSpaceCollide(this->_id, data, callback); | ||
45 | } | ||
46 | |||
47 | |||
48 | |||
49 | |||
50 | |||
51 | |||
52 | |||
53 | } | ||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "CommonMgd.h" | ||
4 | |||
5 | namespace ODEManaged | ||
6 | { | ||
7 | __gc public class Space | ||
8 | { | ||
9 | public: | ||
10 | |||
11 | //Constructor | ||
12 | |||
13 | Space(void); | ||
14 | Space(int minlevel, int maxlevel); | ||
15 | |||
16 | //Destructor | ||
17 | |||
18 | ~Space(void); | ||
19 | |||
20 | |||
21 | //Methods | ||
22 | |||
23 | dSpaceID Id(void); | ||
24 | void Collide(void *data, dNearCallback *callback); | ||
25 | |||
26 | |||
27 | private: | ||
28 | |||
29 | dSpaceID _id; | ||
30 | |||
31 | }; | ||
32 | |||
33 | } | ||
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 @@ | |||
1 | // stdafx.cpp : source file that includes just the standard includes | ||
2 | // ODEManaged.pch will be the pre-compiled header | ||
3 | // stdafx.obj will contain the pre-compiled type information | ||
4 | |||
5 | #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 @@ | |||
1 | // stdafx.h : include file for standard system include files, | ||
2 | // or project specific include files that are used frequently, | ||
3 | // but are changed infrequently | ||
4 | |||
5 | #pragma once | ||
6 | |||
7 | #using <mscorlib.dll> | ||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
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 @@ | |||
1 | |||
2 | #pragma once | ||
3 | |||
4 | #include "CommonMgd.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | void RnearCallback(void *data, dGeomID o1, dGeomID o2) | ||
10 | { | ||
11 | } | ||
12 | |||
13 | } | ||
14 | |||
15 | |||
16 | |||
17 | |||
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 @@ | |||
1 | #include "StdAfx.h" | ||
2 | |||
3 | #include <ode/ode.h> | ||
4 | #include "World.h" | ||
5 | |||
6 | namespace ODEManaged | ||
7 | { | ||
8 | |||
9 | //Constructor | ||
10 | |||
11 | World::World(void) | ||
12 | { | ||
13 | /*dWorldID _temp = dWorldCreate(); | ||
14 | _id = _temp;*/ | ||
15 | _id = dWorldCreate(); | ||
16 | } | ||
17 | |||
18 | |||
19 | //Destructor | ||
20 | |||
21 | World::~World(void) | ||
22 | { | ||
23 | dWorldDestroy(this->_id); | ||
24 | } | ||
25 | |||
26 | |||
27 | //Methods | ||
28 | |||
29 | //Id | ||
30 | dWorldID World::Id() | ||
31 | { | ||
32 | return _id; | ||
33 | } | ||
34 | |||
35 | |||
36 | //SetGravity | ||
37 | void World::SetGravity(double x, double y, double z) | ||
38 | { | ||
39 | dWorldSetGravity(this->_id, x, y, z); | ||
40 | } | ||
41 | |||
42 | |||
43 | //Overloaded GetGravity | ||
44 | Vector3 World::GetGravity(void) | ||
45 | { | ||
46 | Vector3 retVal; | ||
47 | dVector3 temp; | ||
48 | dWorldGetGravity(this->_id, temp); | ||
49 | retVal.x = temp[0]; | ||
50 | retVal.y = temp[1]; | ||
51 | retVal.z = temp[2]; | ||
52 | return retVal; | ||
53 | } | ||
54 | |||
55 | void World::GetGravity(double gravity __gc[]) | ||
56 | { | ||
57 | dVector3 temp; | ||
58 | dWorldGetGravity(this->_id, temp); | ||
59 | gravity[0] = temp[0]; | ||
60 | gravity[1] = temp[1]; | ||
61 | gravity[2] = temp[2]; | ||
62 | } | ||
63 | |||
64 | |||
65 | //Step | ||
66 | void World::Step(double stepSize) | ||
67 | { | ||
68 | dWorldStep(this->_id, stepSize); | ||
69 | } | ||
70 | |||
71 | } | ||
72 | |||
73 | |||
74 | |||
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 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "CommonMgd.h" | ||
4 | |||
5 | namespace ODEManaged | ||
6 | { | ||
7 | __gc public class World | ||
8 | { | ||
9 | public: | ||
10 | |||
11 | //Constructor | ||
12 | |||
13 | World(void); | ||
14 | |||
15 | |||
16 | //Destructor | ||
17 | |||
18 | ~World(void); | ||
19 | |||
20 | |||
21 | // Methods | ||
22 | |||
23 | dWorldID Id(void); | ||
24 | |||
25 | void SetGravity(double x, double y, double z); | ||
26 | |||
27 | //Overloaded GetGravity | ||
28 | Vector3 GetGravity(void); | ||
29 | void GetGravity(double gravity __gc[]); | ||
30 | |||
31 | void Step(double stepSize); | ||
32 | |||
33 | |||
34 | //Properties | ||
35 | |||
36 | //Constraint Force Mixing | ||
37 | __property void set_CFM(double cfm) | ||
38 | { | ||
39 | dWorldSetCFM(this->_id,cfm); | ||
40 | } | ||
41 | |||
42 | __property double get_CFM(void) | ||
43 | { | ||
44 | return dWorldGetCFM(this->_id); | ||
45 | } | ||
46 | |||
47 | |||
48 | //Error Reduction Parameter | ||
49 | __property void set_ERP(double erp) | ||
50 | { | ||
51 | dWorldSetERP(this->_id,erp); | ||
52 | } | ||
53 | |||
54 | __property double get_ERP(void) | ||
55 | { | ||
56 | return dWorldGetERP(this->_id); | ||
57 | } | ||
58 | |||
59 | |||
60 | private: | ||
61 | |||
62 | dWorldID _id; | ||
63 | |||
64 | }; | ||
65 | |||
66 | } | ||
67 | |||