Function gvr_sys::gvr_controller_apply_arm_model [] [src]

pub unsafe extern "C" fn gvr_controller_apply_arm_model(
    api: *mut gvr_controller_context,
    controller_index: i32,
    handedness: i32,
    behavior: i32,
    head_space_from_start_space_rotation: gvr_mat4f
)

Sets up arm model with user's handedness, gaze behavior and head rotation. This setting needs to be applied for every frame. User preferences of handedness and gaze behavior can be changed as needed in a sequence of frames. This needs to be called before gvr_controller_state_update() to apply arm model. GVR_CONTROLLER_ENABLE_ARM_MODEL flag needs to be enabled to apply arm model. The controller position computed with arm model is relative to the head origin. If using the opt-in neck model, the effective eye position after using vr_apply_neck_model() is shifted forward from the head origin by the neck-to-eye distance (8cm) when the head is in neutral position, and a matching forward offset should be applied to the controller position to compensate.

When multiple controllers are configured, this arm model will be applied to the controller at the given controller_index, if one exists.

@param api Pointer to a gvr_controller_context. @param controller_index Index of the controller to apply the arm model to. @param handedness User's preferred handedness (GVR_CONTROLLER_RIGHT_HANDED or GVR_CONTROLLER_LEFT_HANDED). Arm model will assume this is the hand that is holding the controller and position the arm accordingly. @param behavior User's preferred gaze behavior (SYNC_GAZE / FOLLOW_GAZE / IGNORE_GAZE). Arm model uses this to determine how the body rotates as gaze direction (i.e. head rotation) changes. @param head_space_from_start_space_rotation User's head rotation with respect to start space.