Regular API function

simSetObjectPosition / sim.setObjectPosition

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 sim.resetDynamicObject just before). See also sim.getObjectPosition, sim.setObjectOrientation, sim.setObjectMatrix 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=sim.setObjectPosition(number objectHandle,number relativeToObjectHandle,table_3 position)
Lua parameters
Same as C-function
Lua return values
Same as C-function
Remote API equiv.
Legacy remote API: simxSetObjectPosition

All regular API functions on one page