Description
|
Retrieves the linear and/or angular velocity of an object, in absolute coordinates. The velocity is a measured velocity (i.e. from one simulation step to the next), and is available for all objects in the scene. See also sim.getVelocity.
|
C/C++ synopsis
|
simInt simGetObjectVelocity(simInt objectHandle,simFloat* linearVelocity,simFloat* angularVelocity)
|
C/C++ parameters |
objectHandle: handle of a scene object. It is recommended to add sim.handleflag_axis to the object handle, in order to obtain the regular angular velocity for the object, i.e. the rotation axis and the rotation velocity that is represented by the axis' length.
linearVelocity: pointer to 3 values that will receive the linear velocity. Can be nullptr
angularVelocity: pointer to 3 values that will receive the angular velocity. Can be nullptr
|
C/C++ return value
|
-1 if operation was not successful
|
Lua synopsis
|
float[3] linearVelocity,float[3] angularVelocity=sim.getObjectVelocity(int objectHandle) |
Lua parameters |
objectHandle: Similar to the C-function counterpart
|
Lua return values
|
linearVelocity: table containing 3 values that represent the linear velocity
angularVelocity: table containing 3 values that represent the angular velocity
|
Python synopsis |
list linearVelocity,list angularVelocity=sim.getObjectVelocity(int objectHandle) |