blob: beab21a4c59f6226d48bdca36b01c122b7536946 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#include "StdAfx.h"
#include <ode/ode.h>
#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);
}
}
|