|
Space Sim
|
#include "core/types.h"Go to the source code of this file.
Functions | |
| void | print_mat4 (const mat4 *m) |
| mat4 | make_ortho (float left, float right, float bottom, float top, float near, float far) |
| mat4 | make_projection (float fov_deg, float aspect, float near, float far) |
| void | update_camera (Camera *cam) |
| void | resolve_collisions (Camera *current_cam, float planet_radius) |
| void | apply_velocity (Camera *current_cam, vec3 move_dir, float dt) |
| mat4 | make_look_at (Camera *cam, vec3 eye) |
| void | apply_planet_velocity (Camera *current_cam, vec3 move_dir, float dt) |
| void | compute_camera_basis (Camera *cam, vec3 world_up) |
| void | update_light_camera (Camera *lcam) |
| void | look_at_selected_body () |
Variables | |
| Camera | cam |
| void print_mat4 | ( | const mat4 * | m | ) |
| mat4 make_ortho | ( | float | left, |
| float | right, | ||
| float | bottom, | ||
| float | top, | ||
| float | near, | ||
| float | far ) |
| mat4 make_projection | ( | float | fov_deg, |
| float | aspect, | ||
| float | near, | ||
| float | far ) |
Definition at line 76 of file camera.c.
References mat4::a0, mat4::a1, mat4::a2, mat4::a3, mat4::b0, mat4::b1, mat4::b2, mat4::b3, mat4::c0, mat4::c1, mat4::c2, mat4::c3, mat4::d0, mat4::d1, mat4::d2, mat4::d3, and make_projection().
Referenced by make_projection(), render_sky_cubemap(), and update_camera().
| void update_camera | ( | Camera * | cam | ) |
Definition at line 222 of file camera.c.
References cam, Camera::cam_data, CamData::cam_pos, compute_camera_basis(), Camera::forward, FOV, CamData::inv_proj, CamData::inv_view, make_look_at(), make_projection(), mat4_inverse(), CamData::proj, SCREEN_HEIGHT, SCREEN_WIDTH, Camera::target, update_camera(), vec3_add(), CamData::view, VIEW_FAR, VIEW_NEAR, vec4::x, vec4::y, and vec4::z.
Referenced by get_view_planes(), main(), and update_camera().
| void resolve_collisions | ( | Camera * | current_cam, |
| float | planet_radius ) |
Definition at line 638 of file camera.c.
References cam, Camera::cam_data, CamData::cam_pos, CamData::cam_vel, check_collision(), CHUNK_WORLD_SIZE, find_surface(), ground_hit, planet_radius, resolve_collisions(), start_timer(), vec3_add(), vec3_dot(), vec3_scale(), vec3_sub(), vec3::x, vec4::x, vec3::y, vec4::y, vec3::z, and vec4::z.
Referenced by process_input(), and resolve_collisions().
Definition at line 731 of file camera.c.
References apply_velocity(), cam, Camera::cam_data, CamData::cam_pos, CamData::cam_vel, dt, lerp(), Camera::pitch, Camera::roll, vec3_normalize(), vec4_scale(), vec3::x, vec4::x, vec3::y, vec4::y, Camera::yaw, vec3::z, and vec4::z.
Referenced by apply_velocity(), and process_input().
Definition at line 130 of file camera.c.
References mat4::a0, mat4::a1, mat4::a2, mat4::a3, mat4::b0, mat4::b1, mat4::b2, mat4::b3, mat4::c0, mat4::c1, mat4::c2, mat4::c3, cam, mat4::d0, mat4::d1, mat4::d2, mat4::d3, Camera::forward, make_look_at(), Camera::right, s, Camera::up, vec3_dot(), vec3::x, vec3::y, and vec3::z.
Referenced by make_look_at(), render_sky_cubemap(), update_camera(), and update_light_camera().
Definition at line 333 of file camera.c.
References apply_air_acceleration(), apply_planet_velocity(), cam, Camera::cam_data, CamData::cam_vel, dt, lerp(), Camera::on_ground, Camera::pitch, Camera::roll, scale(), vec3_normalize(), vec4_scale(), vec3::x, vec4::x, vec3::y, vec4::y, Camera::yaw, and vec4::z.
Referenced by apply_planet_velocity(), and process_input().
Definition at line 12 of file camera.c.
References cam, compute_camera_basis(), Camera::forward, Camera::pitch, Camera::right, Camera::up, vec3_cross(), vec3_normalize(), vec3::x, vec3::y, Camera::yaw, and vec3::z.
Referenced by compute_camera_basis(), render_sky_cubemap(), update_camera(), and update_light_camera().
| void update_light_camera | ( | Camera * | lcam | ) |
Definition at line 168 of file camera.c.
References cam, Camera::cam_data, CamData::cam_pos, compute_camera_basis(), Camera::forward, make_look_at(), make_ortho(), Camera::pitch, PLANET_DATA, CamData::proj, PlanetData::sun_dir, Camera::target, update_light_camera(), vec3_add(), vec3_normalize(), CamData::view, vec3::x, vec4::x, vec3::y, vec4::y, Camera::yaw, vec3::z, and vec4::z.
Referenced by main(), and update_light_camera().
| void look_at_selected_body | ( | ) |
Definition at line 832 of file camera.c.
References cam, Camera::cam_data, CamData::cam_pos, fence, Camera::forward, GLOBALS, look_at_selected_body(), PARTICLE_SSBO, Camera::pitch, pitch_difference(), Globals::selected_body, signed_angle(), vec3_normalize(), vec3_scale(), vec3_sub(), vec3::x, vec4::x, vec3::y, vec4::y, Camera::yaw, vec3::z, and vec4::z.
Referenced by look_at_selected_body().
|
extern |
Definition at line 222 of file main.c.
Referenced by apply_air_acceleration(), apply_planet_velocity(), apply_velocity(), check_collision(), compute_camera_basis(), get_view_planes(), hit_ground(), look_at_selected_body(), main(), make_look_at(), process_input(), render(), render_sky_cubemap(), render_sky_from_outside_atmosphere(), resolve_collisions(), update_camera(), and update_light_camera().