IrrNewt irrlicht\newton framework >> SVN access

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
matgaw
Posts: 45
Joined: Sat Oct 06, 2007 11:33 am

Post by matgaw »

white tiger wrote:can you post your fix, a code that show the bug (with different scales) and upload the mesh you are using, please? i can't debug whitout these
Actually, I downloaded now original IrrNewt 0.4, because my fix introduced other problems (with scales)...

Original problem is, that if you create some node in irrlicht, say node A, in some position other than 0,0,0 (preferably far from 0,0,0), then create another node B, and set A to be parent of B, so the position of B is relative to the A, then create newton body for the B using IrrNewt, the newton body for the node B is created on the scene as if the relative position would be absolute (near 0,0,0) and not in the relative position to the parent.

Example:

- create node A on position 1000,1000,1000
- create node B, which is child of A, on position 100,100,100
- create Newton bodies for these nodes

Result:
- good created body for node A
- body for node B is in absolute position 100,100,100 instead of something near 1000,1000,1000 ( (100,100,100) relative to the (1000,1000,1000)).

The problem might be growing if we also scale the size of node B (especially when the scale is not the same as scale of node A), example:

B->setScale(0.4,0.4,0.4);

Do you understand now? I wasn't able to fix this... Could you post, what should I change in IrrNewt 0.4 source code to fix this?
matgaw
Posts: 45
Joined: Sat Oct 06, 2007 11:33 am

Post by matgaw »

Well I managed to fix some bugs myself in IrrNewt 0.4

Solutions:

Bug: if we have some body that is a child of another one, the Newton body is created in wrong place

Fix:
In body.cpp, in function IBody::setNodeMatrixToBody, change line:

Code: Select all

core::matrix4 irr_mat = this->node->getRelativeTransformation();
to this:

Code: Select all

core::matrix4 irr_mat = this->node->getAbsoluteTransformation();
Bug: if we have two TREE bodies, and body B is child of A, and the A has different scale than (1,1,1), the Newton body for node B is wrong-sized

Fix:
In collision.cpp, find a line starting with "case EBT_TREE:"
and under this line, change the line:

Code: Select all

nCollision = CreateCollisionTree( world, mesh_for_convex, node->getScale(),
			SkippedFace, PolyCount);
to this:

Code: Select all

nCollision = CreateCollisionTree( world, mesh_for_convex, node->getScale()*node->getParent()->getScale(),
			SkippedFace, PolyCount);
Hope this helps.

I also repaired the serialization and deserialization of tree bodies. If somebody wants solution to that, I will post it later.
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post by Steel Style »

Hi I have some trouble with my code, my characters is doing an high kick and when he his doing that he is moving.

So the meshnode absolute position is not moving but bones are. Now I decide to make it spawn at the final position if he is going to do another kick. And with the NewtonBodySetMatrix that working.

But from the position A (start of animation) to the position B (end of animation) ever if the node moved succeffuly the body did'nt move juste to be moved at B so colision during those two point are not working.

Also I decided to make the character moving because they are some move wich are not linear about position term and so that's more realistic to do this way.

Does someone have a clue to make it work (e.g. create another body for moving animation(cause I also got static animation)) ?

Thanks.
joshua1091
Posts: 23
Joined: Thu Aug 09, 2007 5:16 pm

hi how to compile

Post by joshua1091 »

i have downloaded irrnewt from https://aresfps.svn.sourceforge.net/svnroot/aresfps...
can somebody tell me how to compile it using dev cpp to generate the .a or .dll file........or whatever

by the way:im using
irrlicht 1.4.1
newton 1.5
devc++
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

use code::blocks with mingw, it's free as well. dev-c++ is no longer supported
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

white tiger wrote:use code::blocks with mingw, it's free as well. dev-c++ is no longer supported
well not really true. dev-c++ doesn't work bc the compiler version that ships with it is too old. u can use dev-c++ without any problems when u download a new mingw version.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

you have the project files for code::blocks in svn
Anton1
Posts: 14
Joined: Fri Mar 09, 2007 7:47 am

Post by Anton1 »

Hey... I've implemented this into my project... but i was wondering if ragdoll physics could be applied to bones rather than parented scene nodes... just a wonder, i really delved into skeletal animations yet...
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

no. when this version was released there was no support for skeletal animation in irrlicht, so just trought parent nodes. also a major revision of the newton SDK is on the way and it affect consistently how ragdoll are handled. in 2.0 they will be an external joint build upon the new custom joint interface
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

what's the current status of IrrNewt ? i've implemented it in my project and i'm looking forward to using it and update it when other versions are avaible

:)

and by the way:

great work mate :roll:
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post by white tiger »

well irrnewt is quite mature, it wraps all newton features and also implements its own wich is not part of the engine

however, a new newton version is on the way (don't know if it will be released this year thought.....) and it breaks the old API. irrnewt needs a major revision to be compatible, expecially the ragdoll and the joint interface.

i do not have time to do so currently. if someone wants to help, i will set up an admin account on my sourceforge space. i will update the fix by mategaw on svn if he agrees

so the current status is "stable, but look for more time or for someone to maintain it in the near future"
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

thanx for the reply and keep up the good work :)
baiqian
Posts: 43
Joined: Sun Apr 06, 2008 2:29 pm

Post by baiqian »

I've just use the Irrlicht 1.4.2 and Irrnewt 0.4 to compile the sample. As refer previous bug fixed,there are still 2 errors,
1.

Code: Select all

error C2668: "pow": ambiguous call to overloaded function
2.

Code: Select all

error C2039: "Textures": is not a member of "irr::video::SMaterial"
And if we would to recompile the DLL with Irrlicht 1.4.2, shall we need to complie according your "HOW TO COMPILE FOR 1.3 AND HIGHER" instruction ?

Thank you very much, I use
VS2008 team suite+ Irrlicht 1.4.2 + Newton 1.53
Any way to solve the problem? And with Irr 1.4.2, any revision need to do?
marsupial
Competition winner
Posts: 6
Joined: Mon Feb 26, 2007 4:07 pm
Location: Münster, Germany

Post by marsupial »

Well, if you did the bugfixes which are described on the last two pages, then this should be the only one which is still unfixed.

Here is the solution:

replace:

Code: Select all

material.Textures[0] = 0;
with

Code: Select all

material.setTexture(0, 0);

in the files hidden.cpp (should be line 74) and body.cpp (line 342).


After I fixed this, I could compile it with Irrlicht 1.4.2 without problems.

Hope that helps.


marsupial
m506
Posts: 12
Joined: Wed Jun 18, 2008 5:34 am

Post by m506 »

hey, i have a question.

Why does irrnewt need a lib and dll file to be able to be compiled if i added all the cpp source files from svn into my project?

I integrated all the cpp files with iphysics and it worked fine without the necessity of an iphysics lib and dll, but irrnewt is not letting me compile and keeps throwing unresolved functions to me.

im using the latest irrnewt svn + irrlicht 1.4.2 + newton 1.53

any ideas?
Post Reply