Regular API function

simSetObjectPosition (remote API equivalent: simxSetObjectPosition)

Description Sets the position (x, y and z-coordinates) of an object. Dynamically simulated objects will implicitely be reset before the command is applied (i.e. similar to calling simResetDynamicObject just before). See also simGetObjectPosition, simSetObjectOrientation, simSetObjectMatrix and the other matrix/transformation functions.
C synopsis simInt simSetObjectPosition(simInt objectHandle,simInt relativeToObjectHandle,const simFloat* position)
C parameters
objectHandle: handle of the object
relativeToObjectHandle: indicates relative to which reference frame the position is specified. Specify -1 to set the absolute position, sim_handle_parent to set the position relative to the object's parent, or an object handle relative to whose reference frame the position is specified.
position: coordinates of the object (x, y and z)
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis number result=simSetObjectPosition(number objectHandle,number relativeToObjectHandle,table_3 position)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page