IPhysics - Newton/Irrlicht framework

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
savagedp
Posts: 5
Joined: Wed Oct 18, 2006 5:38 am

Post by savagedp »

@savagedp: Looks like a Visual Studio problem - have you upgraded from an old version? If there's nothing obvious I'd go for a reinstall.


Hi... Ermm I'm using a version 2003 Visual Studio.. shouldn't be a problem... unless its a corrupted file or something.. i really dont watn to reinstall. its a pain... :(

actually I tried newton after that... and i got lost in newton... no idea how to get it to work... :( i suck at this ....

anywy, maybe i'll just reinstall to see how things go... :?
THANKS!
Nick_Japan
Posts: 98
Joined: Mon Dec 13, 2004 11:47 am
Location: Japan

Post by Nick_Japan »

@ComputerWhiz: No .NET support planned - sorry.

One thought about example 2 going really slow and freezing: try using the UM_EVERY_FRAME update mode. (Add this line somewhere: physics.setUpdateMode(UM_EVERY_FRAME) ) - let me know if that helps.
Image Image
3ddev
Posts: 169
Joined: Tue Sep 19, 2006 6:51 am
Contact:

A couple of problems...

Post by 3ddev »

I have run into two problems(:oops: ) and one question.
1. I am using the svn version of Irrlicht. When I compile the program it says I cannot store pointer (to class) IEventReceiver to variable receiver. I think there is a change in the api for the svn. What do I need to do to fix this?
2. I have included the libirrlicht.a, IPhysics.lib, and Newton.lib libraries into my project settings. I also have included IPhysics.h and made sure that Newton.h is in the same folder as IPhysics.h. However, when I compile the program in Dev-C++ I get the following linker problem:
C:\cplus\Irrlicht\Copy of helios_racer\main.o(.text+0x5b5) In function `main':
[Linker error] undefined reference to `CPhysics::CPhysics()'
[Linker error] undefined reference to `CPhysics::init(irr::ITimer*)'
[Linker error] undefined reference to `CPhysics::addCar(SPhysicsCar*)'
[Linker error] undefined reference to `CPhysics::addEntity(SPhysicsStaticMesh*)'
[Linker error] undefined reference to `CPhysics::addEntity(SPhysicsStaticMesh*)'
C:\cplus\Irrlicht\Copy of helios_racer\main.o(.text+0x155b) In function `main':
[Linker error] undefined reference to `CPhysics::update()'
[Linker error] undefined reference to `CPhysics::~CPhysics()'
[Linker error] undefined reference to `CPhysics::~CPhysics()'
51:7 C:\cplus\Irrlicht\Copy of helios_racer\main.o(.text+0x155b) ld returned 1 exit status
C:\cplus\Irrlicht\Copy of helios_racer\Makefile.win [Build Error] [Helios_Racer.exe] Error 1
How do I fix this?:?:

And finally, how do I make the car and wheels out of meshes rather than just letting IPhysics display them as spheres and rectangles? Currently there is not an example for this. If someone could post some example code for using this fuction that would be great!

Otherwise, I think IPhysics is great. Keep up the good work, Nick_Japan! I like the Irrlicht style coding a lot!:lol:

3ddev
Nick_Japan
Posts: 98
Joined: Mon Dec 13, 2004 11:47 am
Location: Japan

Post by Nick_Japan »

@3ddev: I'm not sure about the Irrlicht SVN problems as I don't use it myself. Regarding the IPhysics linking problems, when you say you've included IPhysics.h, have you set the the include directory in Dev C++ to the IPhysics include directory? It looks like it's including IPhysics.h but can't find the rest of the includes. You shouldn't need IPhysics.lib and IPhysics.a - they're both the same thing, just compiled to different formats. Also, have you got the line

Code: Select all

#pragma comment(lib, "IPhysics.lib")
in your project's header? (See global.h in the examples)

About using your own meshes for the car, that's easy. Just load the meshes you want, and add them to your SPhysicsCar struct (carBodyNode for the car body, tireNode_FL for the front left tire, etc).
Image Image
raven_coda
Posts: 89
Joined: Thu Aug 17, 2006 8:11 pm
Location: Salt Lake City, UT, USA
Contact:

Post by raven_coda »

Nice Work!!! I'm just playing around with this and I tried to give the box a little bit of a lift but I'm not vey sucessful. How would you do this say for a monster truck for example where the body sits higher then the wheels.
I've tried something like
carData.carBodyOffset = vector3df(0, 10.0f, 0);

and I think for the physics half that works but the body is still drawn in too low.

Thanks for answering a stupid question in advance.
Definition of an Upgrade: Take old bugs out, put new ones in.
Nick_Japan
Posts: 98
Joined: Mon Dec 13, 2004 11:47 am
Location: Japan

Post by Nick_Japan »

@raven_coda: Ah, that's not quite what carBodyOffset is for. Basically, you need your mesh to be built in your modeller exactly as you want it to come out in the engine. So for your monster truck, if you want it to be higher up, you need to do that in your modeller and then export it again at the right height. The reason for this is that you can then build your vehicle with the wheels in place, and then just pass in the values for axle length and width and so on based on where your wheels are in the modeller. Because currently the car's body is just modelled with a box, if your entire car mesh is above the origin, you can still use the offset to create a box that properly surrounds your car body mesh. Don't worry about all this though: soon a car will have the option to use a convex hull (which is the proper way to do it), and this will in turn use the actual positions of your vertices and all this stuff will go away.
Image Image
3ddev
Posts: 169
Joined: Tue Sep 19, 2006 6:51 am
Contact:

Irrlicht 1.1 svn needs fixes before to work with IPhysics!

Post by 3ddev »

IPhysics needs fixes to work with Irrlicht 1.1 svn! In 1.1 sdk you declare your receivers like this:

Code: Select all

bool OnEvent(SEvent event)
	{
           /*Put all your code here
          for receiving events*/
        }

In Irrlicht 1.1 SVN you declare your receiver like this:

Code: Select all

virtual bool OnEvent(const SEvent event)
	{
           /*Put all your code here
          for receiving events*/
        }

My app with the svn compiled but would not receive any imput. I then compiled in Irrlicht SDK and it worked. Oviously the problem is in the IPhysics classes. I am going to try and fix this, but maybe someone else could too? I think that there should be something like a #define IRR_SVN for declaring the use of the svn version. This way there is only one set of classes and compatibility for "older" versions of Irrlicht. In the future, all Irrlicht sdks will use the svn version of the receiver class, so I think this is important to impliment. I'll send a new version to Nick_Japan if I can get this right! :lol:
jAyTeA
Posts: 36
Joined: Wed Sep 06, 2006 7:50 am
Location: Hattorf am Harz, Germany

Post by jAyTeA »

great work Nick!

But i have the same problem as klikmaster.

My app breakes as it comes to the 2.

Code: Select all

IPhysicsEntity* BuildingEntity = m_pPhysics->addEntity(&building);
When it breaks my debugger says "game.exe has triggered a breakpoint" and shows me the following function in the irrarray.h:

Code: Select all

//! Direct access operator
	T& operator [](u32 index)
	{
		_IRR_DEBUG_BREAK_IF(index>=used) // access violation

		return data[index];
	}
So i searched for the problem in the addEntity function but can't find it.

I hope you can help me and that are enough informations.


EDIT: The modell i'm using works fine
Nick_Japan
Posts: 98
Joined: Mon Dec 13, 2004 11:47 am
Location: Japan

Post by Nick_Japan »

@jaytea, klikmaster: I really need to have a look at the meshes you're trying to load - if you could post a link to the mesh or email it to me that would be great. I have a couple of theories, but without being able to replicate the problem myself it's very difficult for me to fix it.

@3ddev: I intend to keep IPhysics current with the latest stable release of Irrlicht, but I really can't do bleeding-edge SVN versions. Of course if you can solve this then I'll be very happy to include it.
Image Image
jAyTeA
Posts: 36
Joined: Wed Sep 06, 2006 7:50 am
Location: Hattorf am Harz, Germany

Post by jAyTeA »

I have emailed you the modell.

I have tested other models ( all in the .3ds format ) but it breakes always.
Nick_Japan
Posts: 98
Joined: Mon Dec 13, 2004 11:47 am
Location: Japan

Post by Nick_Japan »

@jaytea: Fixed - there was a muddle in my meshbuffer loop. Many thanks for sending me that. The download page now hosts the updated version. For anyone else having trouble using IPhysics with a mesh with multiple mesh buffers, it should be fixed now.
Image Image
jAyTeA
Posts: 36
Joined: Wed Sep 06, 2006 7:50 am
Location: Hattorf am Harz, Germany

Post by jAyTeA »

thanks for that!

great work! Keep it going, i'm excited to see more things build in.
The Pie God
Posts: 8
Joined: Tue Oct 17, 2006 5:18 am

Post by The Pie God »

GAWD NAMMIT!!

Does IPhysics work with OSX? I am using

Xcode 2.4
irrlicht 1.0
Newton 1.53
IPhysics 1.2

Please help!! :cry:

Edit: these are the errors i am getting :oops:

Image
3ddev
Posts: 169
Joined: Tue Sep 19, 2006 6:51 am
Contact:

Please, no *!*

Post by 3ddev »

Please, no *!* swearing on the forums. It isn't good etiquette! :wink:
The Pie God
Posts: 8
Joined: Tue Oct 17, 2006 5:18 am

Post by The Pie God »

please remove this... :oops:
Last edited by The Pie God on Sat Oct 28, 2006 8:24 am, edited 1 time in total.
Post Reply