LibGame  v0.4.0
The LG Game Engine - Copyright (C) 2024-2025 ETMSoftware
lg_cam_controls.c File Reference

Functions

zboolean lg_camera_apply_in (LG_Camera *camera, LG_Camera_K *camera_k)
 
const char * lg_rotations_order_from_yaw_pitch_roll (const char *str)
 

Function Documentation

◆ lg_camera_apply_in()

zboolean lg_camera_apply_in ( LG_Camera camera,
LG_Camera_K camera_k 
)

Check camera->input_state and move/rotate the camera

typedef struct {
// Also in LG_InputState
float move_forward;
float move_up;
float cam_truck;
float yaw;
float pitch;
float roll;
float h_orbit;
float v_orbit;
float dz_wheel;
zboolean slow_motion;
// Not in LG_InputState
char rotations_order[4]; // One of "XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"
char attitude_seq[13]; // One of "PitchYawRoll", "PitchRollYaw", "YawPitchRoll", "YawRollPitch", "RollPitchYaw", "RollYawPitch"
Parameters
cameraPointer to a LG_Camera
camera_kPointer to a LG_Camera_K
Returns
TRUE if OK, FALSE otherwise

◆ lg_rotations_order_from_yaw_pitch_roll()

const char* lg_rotations_order_from_yaw_pitch_roll ( const char *  str)

Helper func to get rotations sequence string (eg, "YXZ") from attitude string (eg, "YawPitchRoll")

Parameters
strAttitude string
Returns
Rotations sequence string
LG_Camera_K
Definition: lg_cam_controls.h:12