CustomMultiBodyVehicle and Ogre Start

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

CustomMultiBodyVehicle and Ogre Start

Postby mvelazquezmm » Fri Dec 10, 2010 2:23 pm

Hi,

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.
mvelazquezmm
 
Posts: 3
Joined: Thu Nov 18, 2010 4:48 am

Re: CustomMultiBodyVehicle and Ogre Start

Postby PJani » Fri Dec 10, 2010 3:09 pm

every class you make in header or where ever must be ended with ;(semi colon)


this is yours
} //End class
this is the case
}; //End class
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: CustomMultiBodyVehicle and Ogre Start

Postby mvelazquezmm » Sat Dec 11, 2010 6:36 am

pppfffff Im absent-minded, if I would Google a little bit, I met the response.

Thanks you!!!

Working along 8 hours for day with Java isn´t good for my student proyect in Cpp :)
mvelazquezmm
 
Posts: 3
Joined: Thu Nov 18, 2010 4:48 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron