A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by blackbird_dream » Wed Apr 04, 2018 11:35 am
It's similar to this topic :
viewtopic.php?f=9&t=9147I've lost the inertia meanwhile
It's the real mess .
I don't know which version of ND and Unity plugin I'm dealing with.
I cannot download the last versions as they don't work (//solver and so on)
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by Julio Jerez » Wed Apr 04, 2018 11:40 am
Was that question to me?
If so, then I made a mistake.
It should get the com form the Collison shape, not from the rigid body.
The code to posted reduce to a recursive change of the com.
If using the Collison shape com, the the com act as a natural body center origin.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by blackbird_dream » Wed Apr 04, 2018 11:56 am
can you tell me please what version of Newton Dynamics works with the Unity plugin dated Mar 15, 2018 (ee38fae) ?
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by blackbird_dream » Wed Apr 04, 2018 3:15 pm
can you give me a pair of version (Newton Dynamics / Unity plugin) that may work together please ?
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by blackbird_dream » Wed Apr 04, 2018 3:22 pm
ND version jan 30, 2018 compilation ok
NUP version Mar 15, 2108 failed :
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by Sweenie » Wed Apr 04, 2018 4:25 pm
ok, seems ND from Jan 2, 2018(7e379d7) works ok with the Plugin from Mars 15.
Both compile fine and the plugin demos seems to work.
-
Sweenie
-
- Posts: 498
- Joined: Mon Jan 24, 2005 7:59 am
- Location: Sweden
by blackbird_dream » Thu Apr 05, 2018 4:19 am
This post is pure bullshit (my fantasy).
My concern was about setting the collider independently from the mass properties or (optional) calculating inertia from the collider and setting the NBody CoM at the collision's reference.
It seems it can be done following
http://newtondynamics.com/forum/viewtopic.php?f=9&t=9147just adding the modification :
- Code: Select all
m_body.SetCenterOfMass(value.x, value.y, value.z, m_Ixx, m_Iyy, m_Izz, m_CalculateInertia);
in the property: public Vector3 CenterOfMass
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
by blackbird_dream » Thu Apr 05, 2018 5:11 am
I tested it with a simple demo. One cube of mass 10 wih a horizontal hinge joint passing in its center.
A collision box shifted half its width horizontally and a second cube of lower mass fixed on the upper horizontal edge of the bigger cube.
here I'm using the editor values for inertia. The smaller cube's mass is 1 and the bigger cube has null inertia Ixx :
https://ufile.io/rjlu4here the inertia is no longer null but equals 10. the rotation is much slower. So it seems the Inertia value was well taken into account :
https://ufile.io/vs45rhere the option 'Calculate Inertia' was selected and the mass of the smaller cube was set to 0.001. the bigger cube (null inertia Ixx) still rotates, mainly due to the shift of the collider. So the CoM of the Nbody was moved to the collider's center:
https://ufile.io/oe37j
Last edited by
blackbird_dream on Thu Apr 12, 2018 9:48 am, edited 1 time in total.
-
blackbird_dream
-
- Posts: 354
- Joined: Wed Jun 07, 2006 3:08 pm
- Location: France
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 12 guests