IrrNewt irrlicht\newton framework >> SVN access
-
- Posts: 58
- Joined: Thu Apr 06, 2006 11:54 pm
I considered that, but then the levels would have to be designed in such a way that there aren't any small holes in the floor. The game's more of a platformer than an FPS, so we can't have the character falling in a tiny hole because there happens to be a tiny hole right below it. One solution would be to cast multiple rays around the player, but that just makes falling in tiny holes less likely (and would involve casting a lot of rays!)
Until I become convinced that checking whether or not an object is in contact with something is impossible (or impractical), I'll keep the implementation I've already made =)
Until I become convinced that checking whether or not an object is in contact with something is impossible (or impractical), I'll keep the implementation I've already made =)
=D
Compilled dll and lib for Irrlicht 1.5:
http://nerexis.boo.pl/Other/IrrNewt15.rar
http://nerexis.boo.pl/Other/IrrNewt15.rar
Nerexis
Sorry for bad English.
Sorry for bad English.
there's a bug with Irrnewt on linux:
Code: Select all
#0 0xb80ed430 in __kernel_vsyscall ()
#1 0xb7c1a880 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7c1c248 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7c5810d in ?? () from /lib/tls/i686/cmov/libc.so.6
#4 0xb7c5e3f4 in ?? () from /lib/tls/i686/cmov/libc.so.6
#5 0xb7c60456 in free () from /lib/tls/i686/cmov/libc.so.6
#6 0xb7f3fcea in dgList<dgSortArrayEntry>::dgListNode::~dgListNode () from /usr/local/lib/libIrrNewt.so
#7 0xb7f3b44e in dgBroadPhaseCollision::Remove () from /usr/local/lib/libIrrNewt.so
#8 0xb7f3cf8c in dgBroadPhaseCollision::SetWorldSize () from /usr/local/lib/libIrrNewt.so
#9 0xb7efdaca in NewtonDestroyAllBodies () from /usr/local/lib/libIrrNewt.so
#10 0xb7ef628f in irr::newton::IWorld::~IWorld () from /usr/local/lib/libIrrNewt.so
#11 0xb7ef6347 in irr::newton::IWorld::reserved_destroy () from /usr/local/lib/libIrrNewt.so
#12 0xb7ee6ae0 in irr::newton::Hidden::DestroyAll () from /usr/local/lib/libIrrNewt.so
#13 0xb7c1dd69 in exit () from /lib/tls/i686/cmov/libc.so.6
#14 0xb7c0568d in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#15 0x0805abf1 in _start ()
-
- Posts: 58
- Joined: Thu Apr 06, 2006 11:54 pm
Hmm, I'm in a pickle. Long story short: is there anything bad I should look out for if I lower this variable (in irrtonewt.hpp) to something lower?
Or, would recompiling IrrNewt with a different NewtonToIrr value (say, 8.0f or 4.0f) be a horrible idea? I ask because I set each Irrlicht unit to 1 meter, and then Newton couldn't handle a 2m x 2m x 2m cube!
If anyone's had problems or experience with Newton's and Irrlicht's units' precision, any advice would be great! Of course it depends on my specific project though, so here are some details:
- In a nutshell, it's a first-person platformer with shooting.
- You're a human-sized character, but you're usually quite fast, and can jump very high.
- I'd prefer to have 1 Irrlicht unit = 1 meter, but having physics that actually work is the priority =p
- Environments will range from very open to somewhat cramped. I have in mind areas that are really huge, but don't have a lot of detail (trying to keep a low polygon count).
- It's pretty darn important that the player can't go through walls.
- At times the player will travel extremely fast (think "Speed Booster" from Metroid games) - I'll probably have to do some unconventional things to prevent a speed-boosting player from going through walls.
- Some weapons will need to use ray-casting for collision, others will shoot out Newton bodies at high speeds.
- Generally there won't be a whole lot of physics going on unless you're shooting... the most physics-intensive thing I can forsee is if there are lots of small enemies in one room, or a room with many destructable walls (though the destructable peices won't really interact with each other).
- Various special effects (bits of stuff flying around) might be as small as 5 cm (we'll see), but it's not important if these effects aren't really accurate.
- Although I'm coding the game to accept any reasonable framerate, I'm thinking the game will ultimately update 60 times a second (and the game will slow down if Newton can't handle it).
And for those who are bored and want to read the full story:
In Irrlicht, I was previously using 1 unit = 1 centimeter. But I'm going to be dealing with huge velocities and distances, and I read that Newton can't handle large distances very well, so I changed it to 1 unit = 1 meter. This change also made part of my code a lot easier to read!
Just today though I made a 2-meter-cubed cube and a 2-meter-diameter sphere, and applied a 9.81 m/s2 gravity force to them... holy precision errors Batman! Skip the rest of the paragraph if you don't care to read exactly what happened The cube would slide around on the ground, and instead of stopping, it would kind of roll around in slow motion for a while, and then when it finally begins to stop it would start sinking though the ground and then drop right through the floor! The sphere wasn't much better; it wouldn't roll, it would just rotate slowly, and kind of slide along the ground, with the bottom of it sticking through the floor. Unacceptable!! =p
So, I take this sphere and cube and make them 10 times bigger (20 m), and make the force of gravity 10 times stronger... and of course they work perfectly!
I noticed IrrNewt must be converting to/from Irrlicht units to Newton units here in irrtonewt.hpp:
I really want to continue using 1 unit = 1 meter... not because it would be hard to change my code, but because meters are so much nicer to work with than centimeters, or *shudder* decimeters. At the same time, I don't know the consequences of having gigantic levels in Newton. Thanks for reading =)
Code: Select all
//!Convert a position from newton to irrlicht
const irr::f32 NewtonToIrr = 32.0f;
If anyone's had problems or experience with Newton's and Irrlicht's units' precision, any advice would be great! Of course it depends on my specific project though, so here are some details:
- In a nutshell, it's a first-person platformer with shooting.
- You're a human-sized character, but you're usually quite fast, and can jump very high.
- I'd prefer to have 1 Irrlicht unit = 1 meter, but having physics that actually work is the priority =p
- Environments will range from very open to somewhat cramped. I have in mind areas that are really huge, but don't have a lot of detail (trying to keep a low polygon count).
- It's pretty darn important that the player can't go through walls.
- At times the player will travel extremely fast (think "Speed Booster" from Metroid games) - I'll probably have to do some unconventional things to prevent a speed-boosting player from going through walls.
- Some weapons will need to use ray-casting for collision, others will shoot out Newton bodies at high speeds.
- Generally there won't be a whole lot of physics going on unless you're shooting... the most physics-intensive thing I can forsee is if there are lots of small enemies in one room, or a room with many destructable walls (though the destructable peices won't really interact with each other).
- Various special effects (bits of stuff flying around) might be as small as 5 cm (we'll see), but it's not important if these effects aren't really accurate.
- Although I'm coding the game to accept any reasonable framerate, I'm thinking the game will ultimately update 60 times a second (and the game will slow down if Newton can't handle it).
And for those who are bored and want to read the full story:
In Irrlicht, I was previously using 1 unit = 1 centimeter. But I'm going to be dealing with huge velocities and distances, and I read that Newton can't handle large distances very well, so I changed it to 1 unit = 1 meter. This change also made part of my code a lot easier to read!
Just today though I made a 2-meter-cubed cube and a 2-meter-diameter sphere, and applied a 9.81 m/s2 gravity force to them... holy precision errors Batman! Skip the rest of the paragraph if you don't care to read exactly what happened The cube would slide around on the ground, and instead of stopping, it would kind of roll around in slow motion for a while, and then when it finally begins to stop it would start sinking though the ground and then drop right through the floor! The sphere wasn't much better; it wouldn't roll, it would just rotate slowly, and kind of slide along the ground, with the bottom of it sticking through the floor. Unacceptable!! =p
So, I take this sphere and cube and make them 10 times bigger (20 m), and make the force of gravity 10 times stronger... and of course they work perfectly!
I noticed IrrNewt must be converting to/from Irrlicht units to Newton units here in irrtonewt.hpp:
Code: Select all
//!Convert a position from newton to irrlicht
const irr::f32 NewtonToIrr = 32.0f;
//!Convert a position from irrlicht to newton
const irr::f32 IrrToNewton = ( 1.0f / NewtonToIrr ) ;
=D
-
- Posts: 58
- Joined: Thu Apr 06, 2006 11:54 pm
So I changed NewtonToIrr from 32.0 to 1.0 and recompiled IrrNewt. It fixed my sphere/cube problem, and even some bugs that I didn't know were caused by precision errors! I figure using 1.0 (instead of 8.0 or 4.0) will make any "giant level" issues turn up sooner... I'm using a kind of big level, but I haven't seen any slowdown or anything yet.
When I was using the default NewtonToIrr value of 32.0, this speed conversion value, theoretically, should have been 0.03125 (or, 1/32). After some experimentation though I found it to be about 0.0313152. Now that I'm using a NewtonToIrr value of 1.0, this speed conversion value should be exactly 1.0, right? After experimentation I found it to be about 1.002095. Then again, it could be that my methods of finding this value are bad =pFriendlyWarlord wrote:There's one thing I'm still perplexed about though (I might find the answer in one of the tutorials though)... Irrlicht's distances corrospond perfectly to Newton's distances, but when I convert from Irrlicht to Newton velocities or forces, I have to multiply my distance units per second values by 0.035..... so, newton's velocity units are distance units per 0.035 seconds? Nothing to worry about, I'm just curious is all. But if there's a more accurate value (say, 0.034somethingsomething), anyone know what it is?
=D
I'm getting the same errors...maroxe wrote:"error C2668: 'pow' : ambiguous call to overloaded function"
just add a cast befoire parameters of this function
"error C2259: 'MyEventReceiver' : cannot instantiate abstract class"
replace:
bool irr::IEventReceiver::OnEvent(irr::SEvent )
with:
bool irr::IEventReceiver::OnEvent(const irr::SEvent &)
Hi, I'm pretty new here, I've gotten over most problems I've had so far, but this one has me stumped.
I'm using the IrrNewt compiled for irrlicht 1.5 posted above, the current Newton, and irrlicht 1.5.
It compiles the helloworld just fine, but when I try to run it, I get an error message:
The procedure entry point
_ZN3irr6newton18createPhysicsWorldEPNS_14IrrlichtDeviceE could not be located in the dynamic link library IrrNewt.dll.
I noticed that I would get some errors on the physics related lines of code when I tried using the irrnewt.lib instead of the libIrrNewt.a and .def files. Newton only comes with a .lib. Could this be part of the problem?
I have the libs, dlls and include files in the right places (I think).
Can anyone help?
UPDATE:
Okay, well I fixed the dynamic link library problem by using the earlier 1.5 irrnewt link instead of the latest. But now I have another problem. The program compiles completely, but when i run it it gets all the way to "IrrNewt: physics world created" then crashes without an error message. I can't figure anything out at this point, I think it just hates me.
My debugger tells me:
No source available for "_libwinmm_a_iname() "
Doesn't make any sense to me, couldn't find much on google either.
I'm using the IrrNewt compiled for irrlicht 1.5 posted above, the current Newton, and irrlicht 1.5.
It compiles the helloworld just fine, but when I try to run it, I get an error message:
The procedure entry point
_ZN3irr6newton18createPhysicsWorldEPNS_14IrrlichtDeviceE could not be located in the dynamic link library IrrNewt.dll.
I noticed that I would get some errors on the physics related lines of code when I tried using the irrnewt.lib instead of the libIrrNewt.a and .def files. Newton only comes with a .lib. Could this be part of the problem?
I have the libs, dlls and include files in the right places (I think).
Can anyone help?
UPDATE:
Okay, well I fixed the dynamic link library problem by using the earlier 1.5 irrnewt link instead of the latest. But now I have another problem. The program compiles completely, but when i run it it gets all the way to "IrrNewt: physics world created" then crashes without an error message. I can't figure anything out at this point, I think it just hates me.
My debugger tells me:
No source available for "_libwinmm_a_iname() "
Doesn't make any sense to me, couldn't find much on google either.
Ok I've figured some things out. Everything works except when i create a physics world like this:
Then try to use it like this:
Or this:
The program crashes without an error message. I think the debugger is trying to tell me it's a problem with certain places in memory being unavailable.
Is there anyone who knows what the problem could be? I don't know where to even start trying.
Code: Select all
p_world = newton::createPhysicsWorld(device);
Code: Select all
sphere_body = p_world->createBody(sphereData);
Code: Select all
irr::newton::IBody* world_p_node = p_world->createBody(mapData);
Is there anyone who knows what the problem could be? I don't know where to even start trying.
Open IrrNewt project file, go to your compiler options, there you'll somewhere find flags like "sse sse2 sse3" etc. (in CodeBlocks: Project->Build options, in section "Compiler settings -> other - probably, in some of the configurations). Try to delete/unmark these settings and rebuild whole library (plus rebuild your program with the new one).
I found this issue in january, by default SSE3 is turned on, but it doesn't work on older CPUs.
I have a question for IrrNewt author - there's Newton 2.0 release very soon. Will you try to update IrrNewt to use it? It involves quite interesting new features such as multithreading etc.
I found this issue in january, by default SSE3 is turned on, but it doesn't work on older CPUs.
I have a question for IrrNewt author - there's Newton 2.0 release very soon. Will you try to update IrrNewt to use it? It involves quite interesting new features such as multithreading etc.
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
i'm waiting it for 1 year now. maybe. sorry, but i do not got much timematgaw wrote:Open IrrNewt project file, go to your compiler options, there you'll somewhere find flags like "sse sse2 sse3" etc. (in CodeBlocks: Project->Build options, in section "Compiler settings -> other - probably, in some of the configurations). Try to delete/unmark these settings and rebuild whole library (plus rebuild your program with the new one).
I found this issue in january, by default SSE3 is turned on, but it doesn't work on older CPUs.
I have a question for IrrNewt author - there's Newton 2.0 release very soon. Will you try to update IrrNewt to use it? It involves quite interesting new features such as multithreading etc.