1#ifndef ASTEROIDS3D_STARFIELD_HPP
2#define ASTEROIDS3D_STARFIELD_HPP
33 void init(
int star_count,
float min_radius,
float max_radius);
50 void update(
float delta_time,
const glm::vec3 &camera_position,
float elapsed_time);
55 std::vector<Star> stars{};
57 bool initialized =
false;
58 float min_radius = 50.0f;
59 float max_radius = 200.0f;
61 void respawn(
Star &star,
const glm::vec3 ¢er);
Shared simulation constants, data types, and utility functions.
Depth-tested 3D billboard sprite batch.
Main Vulkan window wrapper for MXVK.
void init(int star_count, float min_radius, float max_radius)
Creates the stars.
void setSprite(mxvk::VK_Sprite3D *sprite_batch)
Assigns the non-owning sprite batch used to render stars.
void update(float delta_time, const glm::vec3 &camera_position, float elapsed_time)
Advances star movement and twinkling.
StarField()=default
Creates an uninitialized starfield.
void resize(mxvk::VK_Window *window)
Updates rendering resources after a window-size change.
void draw()
Submits the current stars to the assigned sprite batch.
Utilities for loading and saving PNG images.
Runtime state for one animated background star.