Untitled
Loading...
Searching...
No Matches
camera.h
Go to the documentation of this file.
1
6#ifndef CAMERA_H
7#define CAMERA_H
8
9#include "engine_types.h"
10
11extern Camera cam;
12
23mat4
25 (
26 float left,
27 float right,
28 float bottom,
29 float top,
30 float near,
31 float far
32 );
33
42mat4
44 (
45 float fov_deg,
46 float aspect,
47 float near,
48 float far
49 );
50
57mat4
59 (
60 Camera * cam,
61 vec3 eye
62 );
63
72void
74 (
75 Camera * cam,
76 float yaw,
77 float pitch,
78 float roll,
79 vec3 world_up
80 );
81
87void
89 (
90 Skeleton * s,
91 Camera * cam
92 );
93
99void
101 (
102 Camera * lcam,
103 Light * light
104 );
105
106// TODO pass player instead of cam to this funciton.
110void
112 (
113 Camera * current_cam
114 );
115
121void
123 (
124 Camera * current_cam,
125 vec3 move_dir,
126 float dt
127 );
128
134void
136 (
137 Camera * current_cam,
138 vec3 move_dir,
139 float dt
140 );
141
142
149void update_skeleton(Skeleton * s, Camera * cam, vec3 vel);
150
151// TODO pass player here
152
160void update_body_from_legs(LegIK * left_leg, LegIK * right_leg, vec3 intended_vel, float dt);
161
167void reset_skeleton(Skeleton * s, vec3 pos);
168
169bool collision(vec3 proposed, vec3 pts[3], vec3 normal, CollisionPoints * p);
170
171#endif
void update_light_camera(Camera *lcam, Light *light)
Updates a directional light camera and locks it to texel size.
Definition camera.c:298
bool collision(vec3 proposed, vec3 pts[3], vec3 normal, CollisionPoints *p)
Definition camera.c:443
mat4 make_ortho(float left, float right, float bottom, float top, float near, float far)
Makes an 4x4 orthographic matrix.
Definition camera.c:179
void reset_skeleton(Skeleton *s, vec3 pos)
Resets a skeleton to be relative to a new position.
Definition camera.c:963
void update_skeleton(Skeleton *s, Camera *cam, vec3 vel)
Moves feet, then solves a skeleton's leg IKs and updates the springs accordingly.
Definition camera.c:1287
void resolve_collisions(Camera *cam)
Resolves collisions between camera and geometry, uses player.
Definition camera.c:1378
void apply_velocity(Camera *cam, vec3 move_dir, float dt)
Applies no-clip mode velocity to player with no gravity applied.
Definition camera.c:660
void compute_camera_basis(Camera *cam, float yaw, float pitch, float roll, vec3 world_up)
Computes camera vectors based on yaw, pitch, and roll.
Definition camera.c:136
mat4 make_look_at(Camera *cam, vec3 eye)
Makes a 4x4 view matrix using camera vectors.
Definition camera.c:258
void update_body_from_legs(LegIK *left_leg, LegIK *right_leg, vec3 intended_vel, float dt)
Calculates velocity based on leg positions and integrates them into the player.
Definition camera.c:1052
void update_camera(Skeleton *s, Camera *cam)
Updates a camera based on a skeleton's current neck and body position.
Definition camera.c:477
mat4 make_projection(float fov_deg, float aspect, float near, float far)
Makes an 4x4 projection matrix.
Definition camera.c:221
void apply_planet_velocity(Camera *cam, vec3 move_dir, float dt)
Applies normal velocity to player with gravity and friction applied.
Definition camera.c:594
Camera cam
This is currently the player cam.
Definition main.c:322
Engine specific types and defines.
The camera structure for players and entities.
The controller for leg IKs for Skeletons.
The controller for leg IKs for Skeletons.
Points that track collision data such as direction, penetration depth, and more to generate Manifolds...
The CPU side structure for Lights.
float dt
The 1.0f/60 simulation timestep.
Definition main.c:319
Definition types.h:21
Definition types.h:12