Skip to content

Vehicle IK: Interactive elements

Jakub Lukasik edited this page May 13, 2020 · 27 revisions

This page describes how interactive elements can be set up in models so that they can be used by Outerra engine. Multiple properties can be configured for proper action binding, for more info about action binding read "bin/defaults/iomap/readme.txt" located in outerra directory.

Bone properties

The control elements are defined by setting custom attributes to a bone inside your 3D editor. The parameters used by Outerra are following:

"control_type" <integer>
"control_handles" <string>  //< optional
"control_action" <string>   //< optional
"control_vel" <float>       //< optional
"control_acc" <float>       //< optional
"control_cen" <float>       //< optional
"control_min" <float>       //< optional
"control_max" <float>       //< optional
"control_step" <integer>    //< optional
"control_channel" <integer> //< optional

How to set properties

Blender

  1. Select the bone you want to be defining
  2. Select object rollout
  3. Add each property you want and set its value

3DS max

  1. Select the bone you want to be defining
  2. Open: Animation -> Parameter Editor...
  3. Add each property you want
  4. Close the Parameter Editor
  5. The properties are now editable from the rollout

Maya

TODO


Description

control_type

One of the following

button    //< pressed by an index finger
slider    //< held by thumb and index
knob      //< held by thumb, index and middle finger
lever     //< held by whole hand
shaft     //< held by whole hand

control_handles

Semicolon separated list of bone's names used for handling this control element. If is not defined, current bone is used as handle e.g. gear stick (handle is on top of the stick, but control bone is at it's origin)

control_action

Name of action that should be binded for this control.

control_vel

Value is representing rate of change (speed) of the value.

control_acc

Value is representing rate of change (acceleration) of the speed.

control_cen

Value is representing rate of change (speed) the value is returning to zero after binded key release. If value is zero, no centering will happen.

control_min

Minimum value of the value

single_bone_max

Maximum value of the value

single_bone_step

Value granularity, number of steps between min and max.


Bone constrains by control type

button

Bone representing button should have the Y axis in direction of button movement and Z axis in "up" direction (where fingernail should be oriented). Example:

slider

Bone representing slider should have the Y axis in direction towards slider and Z axis in "up" direction (where fingernail should be oriented). Example: TODO image

knob

Bone representing knob should have the Y axis in direction as axis of knob rotation and Z axis "up" direction (where index and middle fingernail should be oriented). Example: TODO image

lever

Bone representing lever should have the X axis in opposite direction as lever and Z axis in direction where palm should be located (Y axis then determine where fingers will be). Note: usually lever control also defines "control_handles" property, as position where hand holds lever is different as point of rotation / translation. Example: TODO image

shaft

Bone representing shaft should have the Z axis pointing out of them. Hand will "grab" the X axis. Example:


defaults

If "control_action" is defined, {acc, vel, cen, min, max, step, channel} are necessary for action register, below is table of defaults used if some of this values are undefined.

          | acc [m/s] | vel [m/s] | cen [m/s] |    min    |    max    |   step    | channel  
---------------------------------------------------------------------------------------------
button    |  instant  |     1     |     1     |    -1     |     1     |     3     |    0     
slider    |  instant  |     1     |     1     |    -1     |     1     |     3     |    0     
knob      |  instant  |     1     |     1     |    -1     |     1     |     3     |    0     
lever     |  instant  |     1     |     1     |    -1     |     1     |     3     |    0     
shaft     |  instant  |     1     |     1     |    -1     |     1     |     3     |    0     

info: table was created as example, at time this was written defaults were not implemented so values are just placeholders