Compound of convex diff between 2.30 and 2.31

Moderators: Sascha Willems, Thomas

Compound of convex diff between 2.30 and 2.31

Postby ledahut » Thu Feb 17, 2011 6:44 am

I think the problem come from my app (or my 3d model) but:

I create a compound with 4 convex hull (c0,c1,c2,c3);
Debug display work fine (I see correct collision for my body with correct tolerance)
The shape c2 and c3 are not collidable (with others bodies) in my body since 2.31 where in 2.30 every thing worked fine.
(I only tested with one model, so maybe the problem is the vertexclouds).

I resolved the bug by adding convex hull in my compound in another order (c3,c2,c1,c0). <--- Then it work again like wanted.
I tried with 2.31.zip and 2.31 svn (core200).

Did something changed about convex or compound between 2.30 and 2.31?
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France

Re: Compound of convex diff between 2.30 and 2.31

Postby Julio Jerez » Thu Feb 17, 2011 8:17 am

Are you sayind that compound collision is not working in 2.31

I did made some changes but those are related to 3.00 and they were on the collsion scene, basically I tried to unified the two.
basically the compound was an AABB tree of not leave nodes because the compound was designed to be static.
by this I mean you can remove nodes but you can not add new nodes.

for 3.00 I want to make the compund dynamics where people can add and remove shapes, for that the compound need to be an all poporse tree.
if you look at the class you will see an function name dgCompound::add with the body comented out
before there were not leave nodes, instead each node had a bool to indicate if the node was a leave node or not.
now they leave node have two children which are set to null.
basically the coumpound was more like a collision tree for convex and now is like a collision scene, but they all use the same algorithm with small variations.

please if you cna see any problem cna you show me a demo so that I can fix it.

I am trying to complete the interative demos so that I can test these things.
Julio Jerez
Moderator
Moderator
 
Posts: 10984
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound of convex diff between 2.30 and 2.31

Postby ledahut » Thu Feb 17, 2011 8:45 am

Are you sayind that compound collision is not working in 2.31

I can't say if this is relative to my app or my 3ds model.

I did made some changes but those are related to 3.00

Ok so 2.31 compound=2.30.

please if you cna see any problem cna you show me a demo so that I can fix it.

For the moment it a big application, I need to atomize the problem in a demo.
I will try that later.

It's good to know compound will be more manipulable in 3.00 (like scene collision).
Thanks for your answer.
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France

Re: Compound of convex diff between 2.30 and 2.31

Postby ledahut » Thu Feb 17, 2011 10:07 am

I PM you a demo.
I thinks this topics is in the wrong forum. Maybe someone will move it to 'Requests and Feedback' or 'Bugs and Fixes'.
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France

Re: Compound of convex diff between 2.30 and 2.31

Postby Julio Jerez » Fri Feb 18, 2011 10:31 am

Ok there were tow bug one form you and one from me.

The one form you is that you are not settin the world size box right, i have ot hack it liek this so that I cna runn teh debug dll

Code: Select all
void NewtonSetWorldSize(const NewtonWorld* newtonWorld, const dFloat* minPtr, const dFloat* maxPtr)
{
   Newton* world;

   TRACE_FUNTION(__FUNCTION__);
   world = (Newton *) newtonWorld;
//   dgVector p0 (minPtr[0], minPtr[1], minPtr[2], dgFloat32(1.0f));
//   dgVector p1 (maxPtr[0], maxPtr[1], maxPtr[2], dgFloat32(1.0f));

dgVector p0 (-500, -500, -500, dgFloat32(1.0f));
dgVector p1 (500, 500, 500, dgFloat32(1.0f));

   world->SetWorldSize(p0, p1);



The secund bug is the whne I copy the collision algorithm form teh compound Scen Mesh to the Collision Compound
I have to edito few funtions
one was those wa steh ImproveFistess
the is teh funtion tah update eh tree balace when you move bodies around,
In teh sne collison the they do no deal with teh cent of teh aabb bu teh compound collison do, so I added that by my mistake was that
I scaled the AABB by zero and not by 0.5, and tah makes some of eth tree node have zeor size AABB.
It was a copy and paste but.
For a moment I got scared there because after all these year of usin that in collison tree and scene collision, and could not beleive that I was going
to find a bug there. The will thioght all the work I am doing in 3.00 sicne in 3.00 the scene collision will be the BroadPhase,
luckyly it was a typo in copy and edit

do you get the code frm SVN or you use the download?
Julio Jerez
Moderator
Moderator
 
Posts: 10984
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound of convex diff between 2.30 and 2.31

Postby ledahut » Fri Feb 18, 2011 10:57 am

do you get the code frm SVN or you use the download?

I think is was the one from zip (2.31).
I will always use svn now (by giving you the revision number).

you are not settin the world size box right

I will check that.

The secund bug is the whne I copy the collision algorithm form teh compound Scen Mesh to the Collision Compound
I have to edito few funtions

I thought that the SceneCollision algorithm for compound was only for 3.00. So 2.31 have it too.

Thank you for your work.
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France

Re: Compound of convex diff between 2.30 and 2.31

Postby Julio Jerez » Fri Feb 18, 2011 11:14 am

yes but when working for 3.00 each time I do something that I believ is better and is compatible with 2.00 I copy the differences.
I am tryn to keep them as compatible as possible at teh lowest level
Julio Jerez
Moderator
Moderator
 
Posts: 10984
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound of convex diff between 2.30 and 2.31

Postby ledahut » Fri Feb 18, 2011 11:22 am

Just compiled core200 revision53 and it work as expected.

Can you tell me more about my WorldSize mistake?
Because it actually work fine for me.


About core300 none of my bodies move. Tried breakpoint (with visual 2010). Callback are set correctly.
Engine jump in ForceAndTorque but never in SetTransform.
Is core300 actually runable?
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France

Re: Compound of convex diff between 2.30 and 2.31

Postby Julio Jerez » Fri Feb 18, 2011 11:33 am

the values of p0 and p1 were nans

also if you link to teh debug dll or libray you can see tha you are no reaslin the collision shapes, I asume thsi si because of the demo.

but if it si a bug you cna track memory leks in newton by opening teh file

dgMemory.h and uncomnet the define

#ifdef _DEBUG
//#define __TRACK_MEMORY_LEAKS__
#endif

I will print a listing of all memory allocation, with and ID that you cna use to find out when it was allocated.
Usuallity thsi happen when peopel do no realse teh collision afte the use it.
Julio Jerez
Moderator
Moderator
 
Posts: 10984
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound of convex diff between 2.30 and 2.31

Postby ledahut » Fri Feb 18, 2011 12:04 pm

Ok I remember I send Huge values for size (1E50 and -1E50) to get a big world at start and then reduce it to a given value.
But I these values do not enter in C float type. :)
Thank for the memory leak tip.
I remember that we don't have to release collisions which are part of a compound collision.
What about the new collision algorithme (node scene collision algo)?
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France

Re: Compound of convex diff between 2.30 and 2.31

Postby Julio Jerez » Fri Feb 18, 2011 12:24 pm

All coolision must be realeased in Netwon, yo uare probably confusind tha with "compound collision are no cached"
No new collision algorithm, I maent I got scared if there was a bug because in the AABB tree algorithm, because I am using for such long time that
It will be a big blow if it had a bug, but is was a Typo when I copy and edited form the dgCollisionScene class.
Julio Jerez
Moderator
Moderator
 
Posts: 10984
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Solved bugs

Who is online

Users browsing this forum: No registered users and 1 guest