aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ode-0.9/contrib/DotNetManaged/JointFixed.cpp
blob: afe922257e3cf47d91a4f38e53d9545a2103995a (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
#include "StdAfx.h"

#include <ode/ode.h>
#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);
		}

}