Empty compound collision

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Empty compound collision

Postby Julio Jerez » Sun May 20, 2012 11:00 pm

I just load the secudn one and I do no see any problems.
thsi one is a flat box as floor and tow smalled dynamics boxes, I can pick and move then.

I check in the sanbox demo with teh camera code commnet oput so tha you can load it, try load the teh scene your self and tell why it is that you are getting wrong.
for waht I can see it is all working correctly.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Empty compound collision

Postby PJani » Mon May 21, 2012 8:13 am

Ok i tryed every thing...

If i preload/prefill sub collssions into compound everything works perfectly, without a glitch.

If i try to update/change collision after when the collision was assigned to body nothing works(bodies with updated collisions are not colliding).
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Empty compound collision

Postby Julio Jerez » Mon May 21, 2012 8:48 am

do you have a demo that I can test? this should not have to be so hard.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Empty compound collision

Postby PJani » Mon May 21, 2012 10:42 am

I will make demo...can i make demo for your sandbox? because i don't want to write all the graphics again.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Empty compound collision

Postby Julio Jerez » Mon May 21, 2012 10:49 am

yes of course, that will be much mich better for me.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Empty compound collision

Postby PJani » Tue May 22, 2012 11:22 am

Here :roll:

It shows same symptoms as in my project( the middle box jumps in the middle of bottom box and other boxes are not colliding)

Demo menu line:
void PostCompoundCreateBuildTest(DemoEntityManager* const scene);

{"PostCompoundCreateBuildTest", "PostCompoundCreateBuildTest", PostCompoundCreateBuildTest},

I puted this file into:
...applications\demosSandbox\sdkDemos\demos

btw, dont judge my code it was written in 20mins
Attachments
PostCompoundCreateBuildTest.zip
(1.51 KiB) Downloaded 191 times
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Empty compound collision

Postby Julio Jerez » Tue May 22, 2012 11:55 am

Oh thank you.
It is late for me do test now, I do it tonigh.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Empty compound collision

Postby Julio Jerez » Wed May 23, 2012 7:46 am

Ok I paste the demo in teh sandbox, and I see what you mean, it is very bad.
I do not know what it si yet, but I happen even with just teh large box an done box.
the colliosn lalfuntion all over the place.

I am debuging to see what it is.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Empty compound collision

Postby Julio Jerez » Wed May 23, 2012 8:45 am

Ok I found the bug. this is a legacy form newton 1.00
In newton 1.00 the representative of body in teh broadphase was eth body itselft,
for core 200 teh representative is a proxy object that link the node in teh bradphase and the body, plsus soem other braphase data.

in core 300 wit intrduce the Collision instance and it is part of teh pal to go back to teh method of core 100 where the body represent itself in teh braphase, but this time
it will be the instance of the body. I have no doen it yet and that is what case the problem.
I adde a work aroudn with is to update teh bady matrix.
here is the solution

Code: Select all
NewtonBody* createTestCompound (DemoEntityManager* const scene, dFloat mass, const dMatrix& matrix, dVector size, int materialId)
{
   NewtonWorld* const world = scene->GetNewton();
   
   NewtonCollision* collision = NewtonCreateCompoundCollision(world, 0);

   //create the rigid body
   NewtonBody* const rigidBody = NewtonCreateBody (world, collision, &matrix[0][0]);
   NewtonDestroyCollision(collision);

   collision = NewtonBodyGetCollision(rigidBody);

   NewtonCompoundCollisionBeginAddRemove(collision);//BEGIN

   NewtonCollision* sub_col = NewtonCreateBox(world, size.m_x,size.m_y,size.m_z,0,0);
   NewtonCompoundCollisionAddSubCollision(collision, sub_col);
   NewtonDestroyCollision(sub_col);

   NewtonCompoundCollisionEndAddRemove(collision);   //END

   // add this line because after you change the collision of a body,
   // if the bod is static, the broad phase does not knows that a child shape shape, so it has no reason to update the
   // node location in the database. this will not be need it when the collision instance is the representative of the
   // body in the broaphase, but for now this si a work around
   NewtonBodySetMatrix(rigidBody, &matrix[0][0]);

   DemoMesh* const geometry = new DemoMesh("cylinder_1", collision, "smilli.tga", "smilli.tga", "smilli.tga");



after I have the Model editor further alone I will complete that part of teh collsion instance whch will unific teh treatme of stuff like, Triggers, and Kineatic bodies in teh aabb.
Bascially a collsion intanace will be what teh body place in the AABB, becasieo fo this a collsion instance by itsefl can be added to teh braphase and tah make newton a 100 % full collsion systm
no need for extra statioc collsion update, or contrive flags to indicate that a shape is a trigger, of that a body is a kenematic body.

for now just add that lien of code each time you modify the body shape, and it should work

I added that demo to teh list of SDK demos. you can sinck and check it out.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Empty compound collision

Postby PJani » Wed May 23, 2012 9:44 am

Yep that solved the problem :D

Code: Select all
      float current_matrix[16];
      NewtonBodyGetMatrix(m_body->getNewtonBody(), current_matrix);
      NewtonBodySetMatrix(m_body->getNewtonBody(), current_matrix);


Thank you! :)
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Empty compound collision

Postby PJani » Wed May 23, 2012 10:36 am

Anyway now i have another problem, why is NewtonConvexHullGetFaceIndices crashing when trying to loop thru all faces?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Empty compound collision

Postby Julio Jerez » Wed May 23, 2012 10:53 am

can you modify the demo again to see what it is ?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Empty compound collision

Postby Julio Jerez » Tue Jul 17, 2012 12:06 pm

yes endeed that was a bug, It is checked in now.

Thanks for the report.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron