adding AMotors works! added test to managed_objects.lua

git-svn-id: svn://anubis/misc/OdeWorld@226 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2010-01-31 02:19:39 +00:00
parent f9681f1c79
commit dd12e508d9

View File

@ -7,6 +7,10 @@
#include <string> #include <string>
#include <map> #include <map>
#include "refptr/refptr.h" #include "refptr/refptr.h"
#ifdef DEBUG_AMOTOR
#include <iostream>
using namespace std;
#endif
class OdeWorld class OdeWorld
{ {
@ -75,31 +79,53 @@ class OdeWorld
dJointID createAMotor(dBodyID b1, dBodyID b2); dJointID createAMotor(dBodyID b1, dBodyID b2);
void setAMotorNumAxes(dJointID j, int num_axes) void setAMotorNumAxes(dJointID j, int num_axes)
{ {
#ifdef DEBUG_AMOTOR
cout << "num axes: " << num_axes << endl;
#endif
dJointSetAMotorNumAxes(j, num_axes); dJointSetAMotorNumAxes(j, num_axes);
} }
void setAMotorAxis(dJointID j, int anum, int rel, void setAMotorAxis(dJointID j, int anum, int rel,
dReal x, dReal y, dReal z) dReal x, dReal y, dReal z)
{ {
#ifdef DEBUG_AMOTOR
cout << "axis: " << anum << ", " << rel
<< ", (" << x << ", " << y << ", " << z << ")" << endl;
#endif
dJointSetAMotorAxis(j, anum, rel, x, y, z); dJointSetAMotorAxis(j, anum, rel, x, y, z);
} }
void setAMotorLoStop(dJointID j, dReal val) void setAMotorLoStop(dJointID j, dReal val)
{ {
#ifdef DEBUG_AMOTOR
cout << "lo stop: " << val << endl;
#endif
dJointSetAMotorParam(j, dParamLoStop, val); dJointSetAMotorParam(j, dParamLoStop, val);
} }
void setAMotorHiStop(dJointID j, dReal val) void setAMotorHiStop(dJointID j, dReal val)
{ {
#ifdef DEBUG_AMOTOR
cout << "hi stop: " << val << endl;
#endif
dJointSetAMotorParam(j, dParamHiStop, val); dJointSetAMotorParam(j, dParamHiStop, val);
} }
void setAMotorVel(dJointID j, dReal val) void setAMotorVel(dJointID j, dReal val)
{ {
#ifdef DEBUG_AMOTOR
cout << "vel: " << val << endl;
#endif
dJointSetAMotorParam(j, dParamVel, val); dJointSetAMotorParam(j, dParamVel, val);
} }
void setAMotorFMax(dJointID j, dReal val) void setAMotorFMax(dJointID j, dReal val)
{ {
#ifdef DEBUG_AMOTOR
cout << "fmax: " << val << endl;
#endif
dJointSetAMotorParam(j, dParamFMax, val); dJointSetAMotorParam(j, dParamFMax, val);
} }
void setAMotorBounce(dJointID j, dReal val) void setAMotorBounce(dJointID j, dReal val)
{ {
#ifdef DEBUG_AMOTOR
cout << "bounce: " << val << endl;
#endif
dJointSetAMotorParam(j, dParamBounce, val); dJointSetAMotorParam(j, dParamBounce, val);
} }