Page 1 of 1

make object respondable after importing

Posted: 13 Aug 2013, 13:09
by xelda1988
Hi

In a childscript I import an object from a .stl file.
I want to make this object respondable in the simulation by using the function simSetObjectSpecialProperty(handle,sim_objectspecialproperty_respondable)
But it seems the system doesn't know the API constant sim_objectspecialproperty_respondable:

My Code:

Code: Select all

   shapeHandle=simImportShape(4,"/home/alexander/faceplate.stl",0,0,0.001)
   handle=simGetObjectHandle('Shape')
   simSetObjectPosition(handle,-1,{0,0,1})
   result=simSetObjectSpecialProperty(handle,sim_objectspecialproperty_respondable) -- here the script stops with : One of the function's argument type is not correct. (simSetObjectSpecialProperty)
   print(type(sim_objectspecialproperty_collidable)) -- says Nil

Re: make object respondable after importing

Posted: 13 Aug 2013, 13:56
by coppelia
Hello,

there is a mistake in the documentation, thanks for pointing that out!
If you want to make your shape respondable, use following function:

simSetObjectIntParameter(objectHandle,3004,1)

If you call above function during simulation, you might have to call simResetDynamicObject(objectHandle) too.

Cheers

Re: make object respondable after importing

Posted: 13 Aug 2013, 14:31
by xelda1988
Thanks

the object is now dynamically enabled, but still does not fall down - how can I change this?

*Edit: I solved it with setting simSetObjectIntParameter(handle,3003,0)