Skip to content

Vehicle IK: Interactive elements

Jakub Lukasik edited this page Oct 24, 2023 · 27 revisions

This page describes how interactive elements (also called "knobs" for short) can be configured in models so that they can be imported and 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

Interactive elements (knobs) are defined by setting custom properties to the bone inside your 3D editor. The parameters read by Outerra are following:

"ot_knob_type" <string> //from list of predefined names
"ot_knob_handles" <string>

"ot_knob_action_name" <string>
"ot_knob_action_velocity" <float>
"ot_knob_action_acceleration" <float>
"ot_knob_action_centering" <float>
"ot_knob_action_min_value" <float>
"ot_knob_action_max_value" <float>
"ot_knob_action_positions" <integer>
"ot_knob_action_channel" <integer>

"ot_knob_anim_type" <string> //from list of predefined names
"ot_knob_anim_min" <float>
"ot_knob_anim_max" <float>

How to set properties

Blender

  1. Select armature object and use Edit mode
  2. Select the bone you want to edit
  3. Select bone properties in Property window
  4. Add custom property you want ("ot_knob_type" is mandatory) and set its value or better, use our blender plugin https://github.com/Outerra/anteworld/tree/master/blender/2.80/ot_knob_bones

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

ot_knob_type

Type of hand pose that would be used for interaction with knob.

One of 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
stick     //< held by whole hand

ot_knob_handles

Comma separated list of bone names used as handles for this element.

if defined: any bone defined in list can be interacted for handling current element
if not defined: current bone is used as handle

ot_knob_action_name

action path from iomap definition
or empty if knob is just visual and doesn't have any action

Node: When knob doesn't have defined action name, automatic name is assigned so that action can be referenced by script.
Format of automatic generated name is knob_action_[name of bone] so for example for bone with name "left_wheel" it would be knob_action_left_wheel.

ot_knob_action_velocity

if defined: maximum velocity of action value change
if not defined: default from table below is used

ot_knob_action_acceleration

if defined: acceleration of action value change
if not defined: default from table below is used

ot_knob_action_centering

if defined: speed of value returning to 0.0 action value
if not defined: default from table below is used

ot_knob_action_min_value

if defined: minimum action value
if not defined: default from table below is used

ot_knob_action_max_value

if defined: maximum action value
if not defined: default from table below is used

ot_knob_action_positions in interval <0, 255>

if defined: number of fixed positions between min and max values or 0 for continuous values
if positions == 1: object acts as button, after releasing, it returns to default position
if not defined: default from table below is used

ot_knob_action_channel in interval <0, 7>

if defined: channel number used by the knob
if not defined: default 0 is used

ot_knob_anim_type

One of following:

rotateX      //< rotation around bone's X axis
rotateY      //< rotation around bone's Y axis
rotateZ      //< rotation around bone's Z axis
translateX   //< translation in bone's X axis
translateY   //< translation in bone's Y axis
translateZ   //< translation in bone's Z axis

ot_knob_anim_min

Amount of transformation when action value is at it's minimum

if defined:
        if type is rotation: value represents angle rotation in degrees
        if type is translation: value represents movement in centimeters
if not defined: default value by table below is used

ot_knob_anim_max

Amount of transformation when action value is at it's maximum

if defined:
        if type is rotation: value represents angle rotation in degrees
        if type is translation: value represents movement in centimeters
if not defined: default value by table below is used

Default values by type

Type Velocity Acceleration Centering Min value Max value Positions Animation type Anim min value Anim max value
Button Instant Instant Instant 0 1 2 translateY 0 cm 1 cm
Slider Instant Instant Instant 0 1 2 translateX 0 cm 1 cm
Knob Instant Instant Instant 0 1 2 rotateY 90°
Lever Instant Instant Instant 0 1 2 rotateX 45°
Stick Instant Instant Instant 0 1 3 rotateX -15° 15°

Hand poses 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:

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:

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 knob also defines "ot_knob_handles" property, as position where hand holds lever is different as point of rotation / translation.

Example:

stick

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

Note: usually stick knob also defines "ot_knob_handles" property, as position where hand holds stick is different as point of rotation / translation.

Example: