MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
ship.hpp
Go to the documentation of this file.
1#ifndef ASTEROIDS3D_SHIP_HPP
2#define ASTEROIDS3D_SHIP_HPP
3
5
6namespace space {
7
8 class Ship {
9 public:
10 glm::vec3 position{0.0f, 0.0f, 0.0f};
11 glm::vec3 prev_position{0.0f, 0.0f, 0.0f};
12 glm::vec3 velocity{0.0f};
13 glm::vec3 rotation{0.0f};
14 float current_speed = 1.0f;
15 float min_speed = 0.1f;
16 float max_speed = 25.0f;
17 float turn_speed = 140.0f;
18 float pitch_speed_multiplier = 0.55f;
19 float camera_distance = 6.0f;
20 float camera_height = 1.6f;
21 bool visible = true;
22 bool exploding = false;
23 int explosion_timer = 0;
24 int lives = 5;
25 int score = 0;
26 int fire_cooldown = 0;
27 int burst_count = 0;
29 bool overheated = false;
30 int overheat_cooldown = 0;
31
32 glm::vec3 forward() const;
33 };
34
35} // namespace space
36
37#endif
Mutable gameplay and movement state for a player ship.
Definition ship.hpp:17
glm::vec3 position
Current world-space position.
Definition ship.hpp:20
glm::vec3 rotation
Euler rotation in degrees.
Definition ship.hpp:26
glm::vec3 prev_position
Position from the previous simulation step.
Definition ship.hpp:22
float max_speed
Maximum controllable speed.
Definition ship.hpp:32
float camera_height
Third-person camera height.
Definition ship.hpp:40
int continuous_fire_timer
Timer controlling continuous fire.
Definition ship.hpp:56
int overheat_cooldown
Frames remaining in the overheat cooldown.
Definition ship.hpp:60
float pitch_speed_multiplier
Pitch rate relative to the yaw rate.
Definition ship.hpp:36
int burst_count
Shots already fired in the current burst.
Definition ship.hpp:54
int score
Current score.
Definition ship.hpp:50
float camera_distance
Third-person camera distance.
Definition ship.hpp:38
float min_speed
Minimum controllable speed.
Definition ship.hpp:30
glm::vec3 velocity
Current world-space velocity.
Definition ship.hpp:24
int explosion_timer
Remaining explosion animation frames.
Definition ship.hpp:46
int fire_cooldown
Frames remaining before the next shot is allowed.
Definition ship.hpp:52
bool overheated
Whether firing is disabled by overheating.
Definition ship.hpp:58
glm::vec3 forward() const
float current_speed
Current forward speed.
Definition ship.hpp:28
bool exploding
Whether the ship is currently exploding.
Definition ship.hpp:44
float turn_speed
Yaw rate in degrees per second.
Definition ship.hpp:34
int lives
Remaining lives.
Definition ship.hpp:48
bool visible
Whether the ship is rendered.
Definition ship.hpp:42