How to set an object velocity?

Typically: "How do I... ", "How can I... " questions
Post Reply
HitSShuo
Posts: 1
Joined: 06 Nov 2019, 13:37

How to set an object velocity?

Post by HitSShuo » 03 Dec 2019, 13:36

I want to set an object's velocity as input, but I didn't find the relative functions.
The APIs just provide setpos/ setorientation.

So, is there any reason for not providing the function to set velocity and what I can do to get this goal(set velocity)

coppelia
Site Admin
Posts: 7450
Joined: 14 Dec 2012, 00:25

Re: How to set an object velocity?

Post by coppelia » 03 Dec 2019, 14:18

You can set the initial velocity of a dynamic shape. For that, use sim.setObjectFloatParameter(objectHandle,X,y), where X can be sim.shapefloatparam_init_velocity_x, sim.shapefloatparam_init_velocity_y or sim.shapefloatparam_init_velocity_z, and y the initial velocity in that direction.

Cheers

Post Reply