IPhysics - Newton/Irrlicht framework

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

RapchikProgrammer wrote:The IrrToNewton and NewtonToIrr constants help a lot when working with irrlicht and newton in my opinion as the irrlicht newton is the same as one newton unit multiplied by IrrToNewton! Hence a cube of 1,1,1 in irrlicht is really (1,1,1) * IrrToNewton! Its not necessary but it helps to have a sense of uniform scale between irrlicht objects and newton objects!
You've got the wrong idea about that IrrToNewton constant. It was added to the Mercior demo in order to compensate for numerical precision in a specific quake3 map. Applying it to everything is the wrong thing to do. This scaling constant(s) should be settable via an IPhysics call and should default to 1.0f. For example, if my level is already scaled down to a suitable size, when I pass it to IPhysics it will be scaled down again - not helping precision!

I found this out from the Newton forums.
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Ill try and contact mercior about this! I dont remember why i chose to include these constants in iphysic, but i think they allowed newton to be more stable! I am not very certain about much of this so i will try and contact him!
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Some questions:

1. Am I right in thinking that all vehicles are 4WD? Looks to me that torque is applied to all four wheels.

2. Can I make bikes and tricycles? Or do I have to write my own class for them? Seems like I'm forced to have four wheels.

3. I have simplified collision hulls for the visible meshes. Can I specify a mesh to render and its respective collision hull (itself just a mesh)?
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

A1:

You are not forced to have necessarly all 4wd, you can get the pointer of individual wheels and set the torque yourself to have it your way!

A2:

The newton vehicle wrapper is made for 4 wheel cars, so to make a bike or a trike or a 16 wheeler you need to have raycast vehicles! Making raycast vehicles is a bit complex, and i havent tried it yet, but making it wud be useless cause you wont get proper result with one class made for trikes and bikes and 16 wheelers, you need to make individual class! So if you want to have bikes and trikes you need to make em yourself!

I dont properly understand 3rd question!
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

RapchikProgrammer wrote:A1:

You are not forced to have necessarly all 4wd, you can get the pointer of individual wheels and set the torque yourself to have it your way!
A setting for FWD, RWD or 4WD would be useful.
RapchikProgrammer wrote:I dont properly understand 3rd question!
Looks like I'll have to write my own classes anyway, so I'll add this to my own stuff.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Looks like IrrNewt has all the stuff I need, so I'll be giving that a go.
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

3rd question: If it's not supported, I'd just ues the simplified mesh as the vehicle mesh but make it invisible. Now before rendering I'd just move the more detailed mesh to the position of the collision mesh, copy orientation etc, and then render it.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Ico wrote:3rd question: If it's not supported, I'd just ues the simplified mesh as the vehicle mesh but make it invisible. Now before rendering I'd just move the more detailed mesh to the position of the collision mesh, copy orientation etc, and then render it.
That requires editing the wrapper code. I may as well do it properly if I'm going to rewrite stuff.
olivehehe_03
Posts: 157
Joined: Tue Mar 20, 2007 8:30 am

Post by olivehehe_03 »

Any progress updates for IPhysics 1.5 for Irrlicht 1.3? I can't wait till it's done :D
Tell me what you cherish most. Give me the pleasure of taking it away.
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Iphysics.sourceforge.net

You can see it here, that exams have stopped me from doing any work done! But hopefully in a while when the xams end, youll see progress!
olivehehe_03
Posts: 157
Joined: Tue Mar 20, 2007 8:30 am

Post by olivehehe_03 »

Sounds good. Good luck with those exams :D
Tell me what you cherish most. Give me the pleasure of taking it away.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

I did a quick conversion to 1.3:
http://sio2.g0dsoft.com/IPhysics_1.5_Irr_1.3.zip

Readme:
IPhysics 1.5, Irrlicht 1.3
==========================

sio2@users.sourceforge.net

This is a version of IPhysics upgraded to Irrlicht 1.3.

Project files for building the library file with Visual Studio 2005 are included. Project file only has paths set for Release build - for Debug build simply add required paths.

Source is designed to be extracted into the Irrlicht 1.3 source. Example: "C:\Develop\irrlicht-1.3\IPhysics 1.5 Irr 1.3".

Only one example - Terrain - has a VS2005 project file. Make project files for other examples as required.

Alterations from "IPhysics 1.5 Irr 1.2":
1. Removed duplicate header files from \source folder.
2. matrices altered from ".M[0]" to ".pointer()" format (Irrlicht 1.3).
3. Header/lib paths for Newton/Irrlicht specified in project files, not in VS2005 global paths. [Newton's <stdafx.h> not exactly good practice.]
4. Added "using namespace std" to files that needed it (mainly for streams).
5. Changed stream includes from <fstream.h> format to <fstream> format as required by VS2005. Should be OK for previous compilers but VS2005 is more strict regarding compliance.
6. Changed an instance of all 16 matrix floats being multipled by IrrToNewton. Now "matrix *= IrrToNewton".
7. pure virtual getEntityType() not implemented, leading to unresolved function when linking lib. Commented out getEntityType() from IPhysics headers for now. Implement as needed.
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Well i tired compiling the character controller example on vc6 but it didnt work! Try it yourself! In my opinion character controller shud be a mess! I have already done what you have posted! Its the changes in the irr 1.3 camera that are bugging me.
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

Post by buhatkj »

just a little tip for anybody else trying out sio's 1.3 conversion on vista, you MUST recompile the static lib, otherwise all the examples will fail to link.
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Axel186
Posts: 15
Joined: Thu May 24, 2007 2:54 pm
Location: Israel

Post by Axel186 »

Have some problem... I running the examples and have many errors:

Code: Select all


IPhysics.lib(CPhysics.obj) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in libcpd.lib(ios.obj)
IPhysics.lib(CPhysics.obj) : warning LNK4078: multiple ".CRT" sections found with different attributes (40300040)
IPhysics.lib(CPhysics.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(IPhysicsBodyModifier.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsCamera.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CMaterialManager.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CLog.obj) : error LNK2005: "public: virtual __thiscall std::ios_base::~ios_base(void)" (??1ios_base@std@@UAE@XZ) already defined in libcpd.lib(ios.obj)
IPhysics.lib(CLog.obj) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in libcpd.lib(ios.obj)
IPhysics.lib(CLog.obj) : error LNK2005: "protected: void __thiscall std::ios_base::_Init(void)" (?_Init@ios_base@std@@IAEXXZ) already defined in libcpd.lib(ios.obj)
IPhysics.lib(CLog.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsHinge.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsBallSocket.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsSlider.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsCorkscrew.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsUniversal.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsUpVector.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(CPhysicsPulley.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in libcpd.lib(locale0.obj)
IPhysics.lib(IPhysicsWorld.obj) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in libcpd.lib(ios.obj)

...
So I don't know what to do =( Plz help.
Image
Post Reply