====== DIMPLE 0.0.6: Documentation ====== This documentation describes the messages received and sent by DIMPLE. The following syntax is used: * Square brackets ''[]'' for optional parameters * Triangle brackets ''<>'' for required parameters * Parameters are prefixed with a type indicator: * i: 32-bit integer * f: 32-bit floating point * s: string ===== Values ===== Any value specified by an OSC address can be **set** by providing a parameter directly, or **retrieved** by appending the suffix ''/get''. The ''/get'' suffix with no parameters will return the value exactly once. An optional integer parameter to ''/get'' specifies that the value should be returned at regular intervals the given number of milliseconds apart. (Currently 10 ms is the lowest interval that can be specified.) These timed messages can be cancelled by specifying a parameter of 0 to ''/get''. Values can be either //scalars// or //vectors//. Vectors can be identified by exactly three floating-point parameters. Vectors can also be referenced by appending the ''/magnitude'' suffix which will set the magnitude of the vector, leaving its current direction the same. ''/get'' can also be appended to ''/magnitude''. There are currently some exceptions to these rules, but later versions of DIMPLE will attempt to mostly eliminate them. ===== Connecting to DIMPLE ===== DIMPLE communicates exclusively using [[http://opensoundcontrol.org/|Open Sound Control]] over UDP, using port 7770 for receiving and port 7771 for sending. In other words, using 7770 as the destination port in your application, and 7771 as the receiving port. ===== Messages ===== ==== Enabling graphics and haptics ==== Graphics and haptics have to be enabled explicitly after connecting to DIMPLE. /haptics/enable /graphics/enable Use a parameter of 1 to enable either modality. Graphics takes place in a GLUT window, and haptics opens communiation with a haptic device. ==== Creating objects ==== /object/prism/create [f:x] [f:y] [f:z] /object/sphere/create [f:x] [f:y] [f:z] /object/mesh/create [f:x] [f:y] [f:z] These messages create a named object as either a prism, sphere, or arbitrary mesh, which must be specified in the .3DS file format. Optionally, an initial position can be specified. The initial size will be quite small, so these messages are usually followed up by a ''/size'' or ''/radius'' message. ==== Creating constraints ==== /constraint/fixed/create /constraint/ball/create /constraint/hinge/create /constraint/hinge2/create /constraint/universal/create Constraints can be created between two objects, or between an object and the **world** coordinate system. For the latter, specify //object2// as ''world''. Different constraints take different numbers of arguments depending on how many points and vectors are needed to define them. Please see the ODE documentation section on Joints for more information on each constraint type. ==== Object values ==== /object//position /object//velocity /object//acceleration /object//force /object//mass /object//color === Values for prisms and meshes === /object//size === Values for spheres === /object//radius ==== Other object messages ==== /object//texture/image Sets a visual and haptic texture for the object. Currently only implemented for prisms. /object//collide/get A parameter of 1 indicates that collisions for this object are requested. 0 indicates not to report collisions for this object. /object//grab [i:0] This message with no parameter indicates that this object should be "grabbed", i.e., should be attached by virtual coupling to the location of the haptic proxy. A parameter of 0, or grabbing another object, will return the object to the default behaviour. ==== Constraint responses ==== /constraint//response/spring Currently only the spring response on the hinge constraint is implemented. Stiffness and damping coefficients can be specified for this spring. ==== Global messages ==== /object/collide/get This message with a parameter of 1 specifies that collisions between //any// two objects should be reported. A parameter of 0 disables reporting of collisions between any two objects, but specific objects can still be enabled for collision reporting. /world/gravity Sets the world's gravity vector to a given direction and magnitude. /world/clear Clears all objects in the world. (Note: A bug often causes crashing when this method is called.) ==== Send-only messages ==== These messages are sent by DIMPLE, but are not received by DIMPLE. /object/collide A collision between the two given objects has occurred at the given velocity. /object//collide The object //name// has collided with a given object at the given velocity.