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/JointFixed.cpp | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 libraries/ode-0.9/contrib/DotNetManaged/JointFixed.cpp (limited to 'libraries/ode-0.9/contrib/DotNetManaged/JointFixed.cpp') 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); + } + +} -- cgit v1.1