Page 21 of 29

Posted: Wed Jul 23, 2008 2:48 pm
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?

Posted: Thu Aug 07, 2008 1:18 pm
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.

Posted: Sun Aug 24, 2008 6:11 pm
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.

hi how to compile

Posted: Sat Sep 20, 2008 9:39 am
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++

Posted: Tue Sep 23, 2008 9:46 am
by white tiger
use code::blocks with mingw, it's free as well. dev-c++ is no longer supported

Posted: Tue Sep 23, 2008 2:18 pm
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.

Posted: Thu Sep 25, 2008 12:23 pm
by white tiger
you have the project files for code::blocks in svn

Posted: Thu Oct 02, 2008 9:55 pm
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...

Posted: Wed Oct 08, 2008 3:34 pm
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

reply

Posted: Sun Oct 12, 2008 1:25 pm
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:

Posted: Sun Oct 12, 2008 3:12 pm
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"

reply

Posted: Sun Oct 12, 2008 6:49 pm
by m3ltd0wn
thanx for the reply and keep up the good work :)

Posted: Tue Oct 21, 2008 2:16 pm
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?

Posted: Wed Nov 12, 2008 5:10 am
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

Posted: Sun Dec 14, 2008 4:29 am
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?