Compound collision and center of mass

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Compound collision and center of mass

Postby carli2 » Mon Aug 13, 2012 4:27 am

I have a question:

When you have materials lighter than air, like the hot air of a bimp, this moves the center of mass out of the body. Am I right?
Or how would I simulate that the body of the blimp is lighter than air? (it does not have a negative mass, dosent it?)
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: Compound collision and center of mass

Postby PJani » Mon Aug 13, 2012 5:03 am

it should not move com out of body, com is always contained witheen the body aabb.
hot air baloon...you need to use bouancy equation in force callback if you want to do such thing. tip: gravity force - bouancy force.
bouancy always points oposite of gravity force and is the same thing as is in the water -> only densities are different.

i am currently working on something like that but without properly working compound(density) my project is at halt(cant continue without working compund).
| 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: Compound collision and center of mass

Postby PJani » Mon Aug 13, 2012 5:31 am

Correction: the last added sub collision sets mass and com of whole body.
| 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: Compound collision and center of mass

Postby Julio Jerez » Mon Aug 13, 2012 7:36 am

the inertia of the whole compound is set whn ethe function AddRemove End called.

yes the com is always inside the aabb

to set the inerta of a shape of the diffrent densities yo ucna have and auxialry compound tha is a copy o fthe original compound.
the on the auaxilaty shape se the scale of the equavalen body usin the raltion densisty = mass / volume
this will give you a shape of dioffner siace but with same mass,

basically a lig air ballum you make the ballom shape,
then make a copy of teh origulan shape

the calculate the mass of each sub shape,
by using the density of te hvallume the new the scale will be he new density, which will make a smalle shape of the density is ligher tha air
now you have a shape of same mass, but dirrent volume, which will make a body with diffrent inertia
the use thi new shape top set thebody inertia

this is no totally acurate because a ballome is not a solid body it a thing body which mean it is a body wi a large inertia since is concetrate on the surafce, is thsi property tha make balloms so resistance to rotata
it is the same as a beach ball and balling ball. beach ball rotate very litle.

an better way to do this is to use two balloms one small tah the other, and sustrat the inerta of the first for the inertia of the secund.
and use the result as the inertia of the body.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound collision and center of mass

Postby PJani » Mon Aug 13, 2012 7:56 am

ok i am a bit confused. Does this work right with multiple subcollisions or i am missing something?

NewtonBodySetMassProperties( m_body->getNewtonBody(), ci.density * ci.volume, NewtonCompoundCollisionGetCollisionFromNode(m_compound, ci.node));

EDIT:

Oh, i see 0_0 i thought this sets per sub collision mass...silly me
| 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: Compound collision and center of mass

Postby Julio Jerez » Mon Aug 13, 2012 8:05 am

it shoud be working with compound, all of teh work is competed for inertia. I test with few shapes and it works.
The original bug was beacsue I was applying the central thoerem to inertias that waer not at the center of mass, that gnerated incorrect values, after I fixed that it is all working now.

i do no see what the problem is.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound collision and center of mass

Postby PJani » Mon Aug 13, 2012 8:23 am

Sorry it was my mistake, i was sure that with NewtonBodySetMassProperties you set per sub collision mass :lol: not the mass for whole body!


So you are saying i should make another copy of compound, localy scale its sub collisions and use NewtonBodySetMassProperties for non homogeneus density?
| 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: Compound collision and center of mass

Postby PJani » Wed Aug 15, 2012 10:12 am

Okey i was testing compound and sometimes it happens that some bodies get lodged in between two sub collisions of my compound. These two sub collisions are 0.0 units(they are touching each other) apart from each other.
| 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: Compound collision and center of mass

Postby Julio Jerez » Wed Aug 15, 2012 10:21 am

PJani wrote: These two sub collisions are 0.0 units

what this means?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound collision and center of mass

Postby PJani » Wed Aug 15, 2012 10:55 am

With that i meant there is no space in between sub collisions...they are sharing same verticles at that face!...of course i mean 2 convex sub collisions
| 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: Compound collision and center of mass

Postby Julio Jerez » Wed Aug 15, 2012 12:12 pm

can you post an image?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Compound collision and center of mass

Postby PJani » Wed Aug 15, 2012 12:26 pm

I will try to make screenshot when it happens.
| 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: Compound collision and center of mass

Postby PJani » Wed Aug 15, 2012 2:08 pm

Actually is more worse than i thought. Bodies at certain area are just going through sub collision. I will make a video.
| 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

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest