Code: Select all
sim.addForce(int shapeHandle,float[3] position,float[3] force)
The position parameter in this function is written as a relative position in the official document. Is this relative position based on the object coordinate system?I have some doubts about the position of the force applied by using this function. If you could provide an answer to this, I would greatly appreciate it.
The following is my code to apply a force to an object(a cuboid):
Code: Select all
function sysCall_init()
-- do some initialization here
hcuboid = sim.getObject('.')
end
function sysCall_actuation()
--position=sim.getObjectPosition(hcuboid,sim.handle_world)
--print(position)
sim.addForce(hcuboid,{0,0,0},{2,0,0})
end
The script was placed on the block, but the object did not move at all after running the simulation. But if I set the position parameter to {0,0,0.05}, the block will move in a straight line. The size of the block is 0.1 * 0.1 * 0.1