.TH "ttypt/lam-cam.h" 3 "Version 1.0.0" "liblamina" \" -*- nroff -*- .ad l .nh .SH NAME ttypt/lam-cam.h \- 3D Camera, matrix math, and perspective projection for liblamina\&. .SH SYNOPSIS .br .PP \fR#include \fP .br \fR#include \fP .br .SS "Functions" .in +1c .ti -1c .RI "void \fBlam_mat4_identity\fP (float m[16])" .br .RI "Initialize matrix to 4x4 identity\&. " .ti -1c .RI "void \fBlam_mat4_mul\fP (float out[16], const float a[16], const float b[16])" .br .RI "Multiply two 4x4 matrices: out = a * b\&. " .ti -1c .RI "void \fBlam_mat4_translate\fP (float m[16], float x, float y, float z)" .br .RI "Apply translation to matrix m\&. " .ti -1c .RI "void \fBlam_mat4_scale\fP (float m[16], float sx, float sy, float sz)" .br .RI "Apply scaling to matrix m\&. " .ti -1c .RI "void \fBlam_mat4_rotate_x\fP (float m[16], float rad)" .br .RI "Rotate matrix m around X axis by angle in radians\&. " .ti -1c .RI "void \fBlam_mat4_rotate_y\fP (float m[16], float rad)" .br .RI "Rotate matrix m around Y axis by angle in radians\&. " .ti -1c .RI "void \fBlam_mat4_rotate_z\fP (float m[16], float rad)" .br .RI "Rotate matrix m around Z axis by angle in radians\&. " .ti -1c .RI "void \fBlam_mat4_perspective\fP (float m[16], float fov_rad, float aspect, float near_z, float far_z)" .br .RI "Construct standard perspective projection matrix\&. " .ti -1c .RI "void \fBlam_mat4_ortho\fP (float m[16], float l, float r, float b, float t, float n, float f)" .br .RI "Construct standard orthographic projection matrix\&. " .ti -1c .RI "void \fBlam_mat4_look_at\fP (float m[16], const float eye[3], const float target[3], const float up[3])" .br .RI "Construct view matrix looking from eye towards target with given up vector\&. " .ti -1c .RI "bool \fBlam_mat4_invert\fP (float out[16], const float in[16])" .br .RI "Invert a 4x4 matrix\&. Returns true on success, false if singular\&. " .ti -1c .RI "void \fBlam_cam_set_3d\fP (float target_x, float target_y, float distance, float pitch_deg, float yaw_deg, float fov_deg)" .br .RI "Configure and activate the 3D camera\&. " .ti -1c .RI "void \fBlam_cam_set_2d\fP (void)" .br .RI "Restore classic 2D orthographic rendering mode\&. " .ti -1c .RI "int \fBlam_cam_is_3d\fP (void)" .br .RI "Check if 3D camera mode is currently active\&. " .ti -1c .RI "const lam_cam_t * \fBlam_cam_get\fP (void)" .br .RI "Get pointer to active camera state\&. " .ti -1c .RI "void \fBlam_cam_get_vp\fP (float out[16])" .br .RI "Copy the current View-Projection matrix into out\&. " .ti -1c .RI "void \fBlam_cam_get_right\fP (float r[3])" .br .RI "Get the camera right vector in world coordinates\&. " .ti -1c .RI "int \fBlam_unproject_ground\fP (int32_t screen_x, int32_t screen_y, float *out_x, float *out_y)" .br .RI "Cast a ray from screen coordinates and find intersection with ground plane Z=0\&. " .in -1c .SH "Detailed Description" .PP 3D Camera, matrix math, and perspective projection for liblamina\&. Provides a lightweight 3D pipeline for 2\&.5D tilted-camera and full 3D views, including 4x4 matrix operations, camera setup, ray-plane unprojecting, ground tiles, and billboard sprites\&. .SH "Function Documentation" .PP .SS "void lam_cam_set_3d (float target_x, float target_y, float distance, float pitch_deg, float yaw_deg, float fov_deg)" .PP Configure and activate the 3D camera\&. .PP \fBParameters\fP .RS 4 \fItarget_x,target_y\fP Target world coordinates on the ground plane .br \fIdistance\fP Camera distance / zoom .br \fIpitch_deg\fP Camera tilt angle in degrees (e\&.g\&. 45\&.\&.60) .br \fIyaw_deg\fP Camera yaw rotation angle in degrees .br \fIfov_deg\fP Field of view in degrees (e\&.g\&. 45\&.0) .RE .PP .SS "int lam_unproject_ground (int32_t screen_x, int32_t screen_y, float * out_x, float * out_y)" .PP Cast a ray from screen coordinates and find intersection with ground plane Z=0\&. .PP \fBParameters\fP .RS 4 \fIscreen_x,screen_y\fP Screen pixel coordinates .br \fIout_x,out_y\fP Output world coordinates on the ground plane .RE .PP \fBReturns\fP .RS 4 1 on intersection, 0 if parallel or pointing away .RE .PP .SH "Author" .PP Generated automatically by Doxygen for liblamina from the source code\&.