How to directly control the motion of objects?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

How to directly control the motion of objects?

Postby jiandingzhe » Sat Jul 09, 2011 6:59 am

I'm trying to make an RTS game. In my game, there will have lots of vessels and turrets.

I don't want to control those units by force and torque, because the control law will be very difficult. Instead, I want to have control of moving speed and rotation speed directly.

I still want to use the dynamics solver, not only the collision solver. Because when two object collides, I can know the relative speed of the collision pair.

Does Newton allow me to do this? How can I do it?

Thanks a lot!
User avatar
jiandingzhe
 
Posts: 48
Joined: Fri Jul 08, 2011 11:21 am
Location: Beijing

Re: How to directly control the motion of objects?

Postby JernejL » Sat Jul 09, 2011 2:10 pm

You can set the velocity directly or use a joint to achieve any kind of complex movement like you describe.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: How to directly control the motion of objects?

Postby jiandingzhe » Sat Jul 09, 2011 8:48 pm

JernejL wrote:You can set the velocity directly or use a joint to achieve any kind of complex movement like you describe.

Where are the documents for the joints library (CustomXXX) provided with newton?
User avatar
jiandingzhe
 
Posts: 48
Joined: Fri Jul 08, 2011 11:21 am
Location: Beijing

Re: How to directly control the motion of objects?

Postby JernejL » Sun Jul 10, 2011 5:53 am

I never dealt with the joint library, so i don't know if it even has any documentation.. julio maybe knows more :s
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: How to directly control the motion of objects?

Postby jiandingzhe » Sun Jul 10, 2011 10:19 am

JernejL wrote:You can set the velocity directly or use a joint to achieve any kind of complex movement like you describe.

When shall I set the velocity and angular velocity safely? Just set them before calling NewtonUpdate?
User avatar
jiandingzhe
 
Posts: 48
Joined: Fri Jul 08, 2011 11:21 am
Location: Beijing

Re: How to directly control the motion of objects?

Postby JoeJ » Mon Jul 11, 2011 5:12 am

I do not recommend setting velocity directly. Using joints is more complex than necessary (for a lot of objects i guess it's a performance drop too).
If you know the wanted velocities, it's easy to compute the necessary forces to apply in callback as usual:

Directional:
http://newtondynamics.com/forum/viewtopic.php?f=9&t=6722
Angular:
http://newtondynamics.com/forum/viewtopic.php?f=9&t=6570&p=46210#p46210
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 3 guests