| 489 | /////////////////////////////////////////// |
| 490 | |
| 491 | bool input_controller_key(handed_ hand, controller_key_ key, float *out_amount) { |
| 492 | *out_amount = 0; |
| 493 | switch (key) { |
| 494 | case controller_key_trigger: if (input_controllers[hand].trigger > 0.1f) { *out_amount = input_controllers[hand].trigger; return true; } else { return false; } |
| 495 | case controller_key_grip: if (input_controllers[hand].grip > 0.1f) { *out_amount = input_controllers[hand].grip; return true; } else { return false; } |
| 496 | case controller_key_menu: return (input_controller_menubtn & button_state_active) > 0; |
| 497 | case controller_key_stick: return (input_controllers[hand].stick_click & button_state_active) > 0; |
| 498 | case controller_key_x1: return (input_controllers[hand].x1 & button_state_active) > 0; |
| 499 | case controller_key_x2: return (input_controllers[hand].x2 & button_state_active) > 0; |
| 500 | default: return false; |
| 501 | } |
| 502 | } |
| 503 | /////////////////////////////////////////// |
| 504 | |
| 505 | void input_hand_sim(handed_ handedness, bool center_on_finger, vec3 hand_pos, quat orientation, bool tracked) { |