I want to implement a CustomMultiBodyVehicle in Ogre, and when I compiled my class, I get an error.
What can be missed??
This is my code:
SkaterPlayer.h
- Code: Select all
#include "OgreNewt_Body.h"
#include "OgreNewt_Joint.h"
#include <Ogre.h>
class SkaterPlayer: public OgreNewt::Joint {
public:
SkaterPlayer(OgreNewt::Body* playerBody);
virtual ~SkaterPlayer();
void addTire(void *userData, const Ogre::Vector3& localPosition, float mass, float radio, float width, float susLength, float spring, float damper);
void addSlipDifferential(int leftTireIndex, int rightToreIndex, float friction);
void applyTireTorque(int index, float torque);
void applyTireSteering(int index, float angle);
void applyTireBreak(int index, float brake);
void applyRollingDrag(int index, float drag);
void submitConstraints(float timestep, int threadIndex);
} //End class
And Implementation SkaterPlayer.cpp
- Code: Select all
#include "SkaterPlayer.h"
#include "CustomMultiBodyVehicle.h"
//Constructor
SkaterPlayer::SkaterPlayer(OgreNewt::Body *playerBody) : OgreNewt::Joint() {
CustomMultiBodyVehicle* controller;
dMatrix globalFrame (GetIdentityMatrix());
globalFrame.m_front = dVector(0.0f, 0.0f, -1.0f, 0.0f);
globalFrame.m_up = dVector(0.0f, 1.0f, 0.0f, 0.0f);
globalFrame.m_right = globalFrame.m_front * globalFrame.m_up;
globalFrame.m_posit = dVector(0.0f, 0.0f, 0.0f, 1.0f);
controller = new CustomMultiBodyVehicle(globalFrame.m_front, globalFrame.m_up, playerBody->getNewtonBody());
SetSupportJoint(controller);
} //End constructor
SkaterPlayer::~SkaterPlayer(void) {}
.....
This is the error. The compile process fail only with de include CustomMultiBodyVehicle, and all code hidden:
- Code: Select all
1>SkaterPlayer.cpp
1>c:\ogreaddons\physics\newton\sdk\dmath\dmathdefines.h(50) : error C2628: 'SkaterPlayer' followed by 'void' is illegal did you forget a ';'?)
1>c:\ogreaddons\physics\newton\sdk\dcustomjoints\newtoncustomjoint.h(31) : error C2556: 'void dExpandTraceMessage(const char *,...)' : overloaded functions only differ by return type 'SkaterPlayer dExpandTraceMessage(const char *,...)'
1> c:\ogreaddons\physics\newton\sdk\dmath\dmathdefines.h(50) : see declaration of the function 'dExpandTraceMessage'
1>c:\ogreaddons\physics\newton\sdk\dcustomjoints\newtoncustomjoint.h(31) : error C2371: 'dExpandTraceMessage' : redefinition basic types
1> c:\ogreaddons\physics\newton\sdk\dmath\dmathdefines.h(50) : see declaration of the function 'dExpandTraceMessage'
Im using, Ogre 1.7, Last OgreNewton and Newton 2.24, Visual C++ 2008. I have all libraries of OgreNewt and Newton correct. I used SimpleVehicle, but I will try to try with CustomMultiBodyVehicle to solve it.
Thanks!!
Greetings.