Regular API function

remote API equivalent: simxSetObjectParent
RosPlugin API equivalent: simRosSetObjectParent

Description Sets an object's parent object. See also simGetObjectParent.
C synopsis simInt simSetObjectParent(simInt objectHandle,simInt parentObjectHandle,simBool keepInPlace)
C parameters
objectHandle: handle of the object that will become child of the parent object. Can be combined with sim_handleflag_assembly (simply add sim_handleflag_assembly to objectHandle), if the two objects can be assembled via a predefined assembly transformation (refer to the assembling option in the object common properties). In that case, parentObjectHandle can't be -1, and keepInPlace should be set to false.
parentObjectHandle: handle of the object that will become parent, or -1 if the object should become parentless.
keepInPlace: indicates whether the object's absolute position and orientation should stay same
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=simSetObjectParent(number objectHandle,number parentObjectHandle,boolean keepInPlace)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page