IPhysics - Newton/Irrlicht framework

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
newleon
Posts: 19
Joined: Mon Jan 10, 2011 7:59 am
Location: Pohang, South Korea
Contact:

Having problem with IPhysics and Irrlicht 1.7.2

Post by newleon »

Hello Jack000
This is a while I am trying to find an easy to use car physics and I found IPhysics is the best one. But the problem is it is so old and and needs re-compiling for new Irrlicht. Also it needs old Newton, I mean 1.5.3. I tried to modify the original IPhysics (1.2) to work with Irrlicht 1.7.2 and Newton 1.5.3. I had success but there is one little problem: the wheels are located a little out-place and I don't know why this happens. Then I found IPhysics_1.5_Irr_1.3 which seems is modified and recompiled for Irrlicht 1.3 and Newton 1.5.3. Again I want to use new Irrlicht (1.7.2) not that old one because it doesn't support Joystick. My first try to recompile it was unsuccessful and it seems there is alot different between IPhysics 1.2 and 1.5. Actually I don't like the 1.5 version I prefer to renew the original version. Now I found that you made another version compatible with Irrlicht 1.6. I am really interested to take a look at it and please let me know how that is possible. Also any comment on this is really appreciated.
Kordman916
Posts: 23
Joined: Sat Apr 03, 2010 3:44 am

Iphy

Post by Kordman916 »

I'm using Irrlicht 1.7.2 and Newton 2.32 and every time I try to compile in Code::Blocks using the Gcc compiler on Windows 7 I get this error:

Code: Select all

C:\Users\washkord\Desktop\SDK\IPhysics-1.2\examples\examples_source\example3.h||In function 'void runExample3()':|
C:\Users\washkord\Desktop\SDK\IPhysics-1.2\examples\examples_source\example3.h|156|error: cannot declare variable 'receiver' to be of abstract type 'CEventReceiver_eg3'|
C:\Users\washkord\Desktop\SDK\IPhysics-1.2\examples\examples_source\example3.h|8|note:   because the following virtual functions are pure within 'CEventReceiver_eg3':|
C:\Users\washkord\Desktop\SDK\irrlicht-1.7.2\include\IEventReceiver.h|445|note: 	virtual bool irr::IEventReceiver::OnEvent(const irr::SEvent&)|
||=== Build finished: 1 errors, 0 warnings ===|
Does anyone have any solutions?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

it is old, and irrlicht has changed OnEvent function so in the event receiver it should be:

Code: Select all

MyReceiver::OnEvent(const irr::SEvent&event){///handle events here}
Working on game: Marrbles (Currently stopped).
newleon
Posts: 19
Joined: Mon Jan 10, 2011 7:59 am
Location: Pohang, South Korea
Contact:

Post by newleon »

Hi serengeor
It seems you are pro in this matter. Do you have any comment on my problem mentioned in previous post? Thanks in advance.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

newleon wrote:Hi serengeor
It seems you are pro in this matter. Do you have any comment on my problem mentioned in previous post? Thanks in advance.
I'm not, I haven't used newton much, only with simple things and I didn't really like it much.
Maybe someone needs to write a new wrapper for newton :) Though I prefer bullet physics which doesn't even need a wrapper(at least for me) :roll:
Working on game: Marrbles (Currently stopped).
icaro56
Posts: 1
Joined: Wed May 25, 2011 1:14 pm

IPhysics (Irrlicht 1.72 + Newton 1.53)

Post by icaro56 »

http://www.megaupload.com/?d=FVGVIA9M

:D

IPhysics (Irrlicht 1.72 + Newton 1.53)
newleon
Posts: 19
Joined: Mon Jan 10, 2011 7:59 am
Location: Pohang, South Korea
Contact:

Re: IPhysics - Newton/Irrlicht framework

Post by newleon »

I had this problem whether I try to fix and re-compile the original IPhysics or use the one given by "icaro56". The wheels are positioned in wrong place related to the chassis.

Image

The car data I used is as follows:

Code: Select all

        carData.carBodyOffset = vector3df(0.0f, 0.0f, 0.0f);
        carData.carBodySize = vector3df(4.794f, 2.024f, 1.343f);
        carData.carMass = 5000.0f;       
        carData.frontAxleOffset = 1.579f;
        carData.rearAxleOffset = 1.179f; 
        carData.axleWidth = 0.9f*2.024f;
 
        carData.tireMass = 100.0f;
        carData.tireRadius = 0.98f; //0.98
        carData.tireWidth = 1.0f; //1.0
        carData.maxSteerAngle = 0.6f;
        carData.maxTorque = 5000.0f;
        carData.maxBrakes = 50.0f;
 
        carData.tireSuspensionLength = 0.20f;
        carData.tireSuspensionSpring = (carData.tireMass * 1.0f * 9.8f) / carData.tireSuspensionLength; 
        carData.tireSuspensionShock = sqrt(carData.tireSuspensionSpring) * 1.0f;
Has anyone any suggestion how to fix this?
Wiggles
Posts: 1
Joined: Mon Oct 17, 2011 5:04 am

Re: IPhysics - Newton/Irrlicht framework

Post by Wiggles »

One slight issue with the version icaro56 posted.

When running the Example3 demo, the car seems to stutter a bit after every few seconds.

No idea why. The source is the same as the old version.
--Edit: Seems to be an issue with getAbsolutePosition when aiming the camera at it. If I use getPosition instead, it doesn't stutter.
eejin
Posts: 97
Joined: Sun Jul 24, 2011 11:50 am

Re: IPhysics - Newton/Irrlicht framework

Post by eejin »

I like this physics becouse it's simple but I get alot of errors:

C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\PhysicsGlobal.h|12|error: Newton.h: No such file or directory|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsBaseEntity.h|25|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsBaseEntity.h|25|error: 'NewtonBody' declared as a 'virtual' field|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsBaseEntity.h|25|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsEntity.h|25|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsEntity.h|25|error: 'NewtonBody' declared as a 'virtual' field|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsEntity.h|25|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsEntity.h|16|error: 'NewtonBody' has not been declared|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsEntity.h|21|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsEntity.h|21|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsEntity.h|25|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsEntity.h|25|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|7|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|7|error: expected ',' or '...' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|9|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|9|error: expected ',' or '...' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCarWheel.h|9|error: ISO C++ forbids declaration of 'NewtonJoint' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCarWheel.h|9|error: expected ',' or '...' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCarWheel.h|18|error: 'NewtonJoint' has not been declared|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCarWheel.h|19|error: ISO C++ forbids declaration of 'NewtonJoint' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCarWheel.h|19|error: expected ',' or '...' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|7|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|7|error: expected ',' or '...' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|9|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\MPhysicsCallbacks.h|9|error: expected ',' or '...' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsCar.h|26|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsCar.h|26|error: 'NewtonBody' declared as a 'virtual' field|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\IPhysicsCar.h|26|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|30|error: 'NewtonWorld' has not been declared|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|45|error: ISO C++ forbids declaration of 'NewtonJoint' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|45|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|54|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|54|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|61|error: ISO C++ forbids declaration of 'NewtonBody' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|61|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|62|error: ISO C++ forbids declaration of 'NewtonJoint' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysicsCar.h|62|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|33|error: ISO C++ forbids declaration of 'NewtonWorld' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|33|error: expected ';' before '*' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|47|error: expected ';' before '(' token|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|48|error: 'NewtonCollision' has not been declared|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|49|error: 'NewtonCollision' has not been declared|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|50|error: 'NewtonCollision' has not been declared|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|51|error: ISO C++ forbids declaration of 'NewtonWorld' with no type|
C:\Users\Stijn\Documents\Irrlicht\IPhysics-1.2\include\CPhysics.h|51|error: expected ';' before '*' token|
||=== Build finished: 45 errors, 0 warnings ===|

I downloaded icaro56 his version included the Iphysics.lib and let in search in \include and put this at the start of my program:
#include <IPhysics.h>
#pragma comment(lib, "IPhysics.lib")

Thing is I don't have a newton.h file and neither was is in the original or icario his
Post Reply