Moving static platform

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Moving static platform

Postby razi » Mon Jul 09, 2012 4:22 am

Hi, can anyone suggest any way how to achieve moving platforms? The predefined platforms movement should not be affected by other objects. I created the easiest solution by directly setting position and rotation, however such teleporting provides almost none physical response, no friction etc, when I put object on top and move platform to side object remains frozen levitating. Ive searched and found only this topic which doesnt really tell me much. Im using newton 2. Thank you.
User avatar
razi
 
Posts: 21
Joined: Wed Sep 01, 2010 7:13 am

Re: Moving static platform

Postby JoeJ » Mon Jul 09, 2012 10:20 am

You can use the Kinematic Joint fron the Joint Library (dCustomJoints).
That way you give the Joint a target matrix, and the dynamic platform body will follow it precisely.

Maybe the platform will be affected by a small amount from collisions with other bodies,
but if that's a problem you can use the target matrix for rendering.

See http://newtondynamics.com/wiki/index.php5?title=Tutorial_103:_-_Adding_Joints at the bottom.
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Moving static platform

Postby razi » Mon Jul 09, 2012 5:20 pm

Thank you for your suggestion. I tried CustomKinematicJoint, but for some reason the force to get to set transformation was just too low and any contact would make it way out of course. But the usage of joints reminded me of how I implemented rock climbing. I tried creating inside platform second, "helperBody" which was static and connected to platform by joint with 0 dof, and setting transformation directly to this body. The platform now steadily follows the path/rotations and with enough mass is seemingly totaly resistant to contacts, so I guess though a bit hacky it works so Im happy. Too bad it of course collides with other static objects, but that can be taken care of by setting path correctly or setting their collisions off.
User avatar
razi
 
Posts: 21
Joined: Wed Sep 01, 2010 7:13 am

Re: Moving static platform

Postby pHySiQuE » Tue Jul 10, 2012 2:47 am

You cn use a fixed joint between a static object (mass=0) and the platform. Move the static object and the platform will follow, without losing physics.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Moving static platform

Postby JoeJ » Tue Jul 10, 2012 8:27 am

razi wrote: but for some reason the force to get to set transformation was just too low and any contact would make it way out of course

Looking at the joints source you can adjust the force by raising those two values:
m_maxLinearFriction
m_maxAngularFriction
I guess you have some unusual world / mass scale, so the default values won't fit. For me that's the case.
I don't understand exactly what you do as a work around, but if you get problems (jitter because of rigid joint etc.), you can give it another try - it should work.
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Moving static platform

Postby razi » Wed Jul 11, 2012 3:45 am

JoeJ wrote:
razi wrote: but for some reason the force to get to set transformation was just too low and any contact would make it way out of course

Looking at the joints source you can adjust the force by raising those two values:
m_maxLinearFriction
m_maxAngularFriction
I guess you have some unusual world / mass scale, so the default values won't fit. For me that's the case.
I don't understand exactly what you do as a work around, but if you get problems (jitter because of rigid joint etc.), you can give it another try - it should work.


1 unit = 1 meter
0.5 mass

Maybe low mass values? But shouldnt lower mass be even easier to control? I remember playing with this joint a bit while implementing picking objects with similar weak results, eventually using custom gravity for it.
User avatar
razi
 
Posts: 21
Joined: Wed Sep 01, 2010 7:13 am

Re: Moving static platform

Postby JoeJ » Wed Jul 11, 2012 9:59 am

razi wrote:0.5 mass

Why don't you use a large mass for the platform, and a light mass for the game objects?
That way the impact of game objects will be very small for the platform.
Larger mass does not mean less stiff - much joints at one body would make it less stiff.

On latest source the Max-Friction-Values can now be set with (no need to hardcode & recompile):
SetMaxLinearFriction(dFloat accel)
SetMaxAngularFriction(dFloat accel)

For an imroved joint:
http://newtondynamics.com/forum/viewtopic.php?f=26&t=7332
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron