6 #include <glm/mat4x4.hpp>
7 #include <glm/vec3.hpp>
35 GLuint diffuse_texture_id);
49 glm::mat4
render(std::chrono::microseconds elapsed_time,
50 glm::mat4
const& view_projection,
51 glm::mat4
const& parent_transform = glm::mat4(1.0f),
52 bool show_basis =
false);
79 GLuint diffuse_texture_id,
80 glm::vec2
const&
scale = glm::vec2(1.0f));
Represents a celestial body.
Definition: CelestialBody.hpp:24
float radius
Distance in metres between its centre of gravity and the centre of the orbit.
Definition: CelestialBody.hpp:86
void set_scale(glm::vec3 const &scale)
Configure the scale of this celestial body.
Definition: CelestialBody.cpp:67
std::vector< CelestialBody * > const & get_children() const
Return all the children of this celestial body.
Definition: CelestialBody.cpp:54
float speed
Rotation speed in radians per second.
Definition: CelestialBody.hpp:88
CelestialBody(bonobo::mesh_data const &shape, GLuint const *program, GLuint diffuse_texture_id)
Default constructor for a celestial body.
Definition: CelestialBody.cpp:9
float rotation_angle
How much has it rotated around its orbital axis; in radians.
Definition: CelestialBody.hpp:89
struct CelestialBody::@2::@5 spin
void add_child(CelestialBody *child)
Mark another celestial body as being “attached” to the current one.
Definition: CelestialBody.cpp:49
struct CelestialBody::@2 _body
struct CelestialBody::@3 _ring
glm::vec3 scale
Definition: CelestialBody.hpp:91
void set_orbit(OrbitConfiguration const &configuration)
Configure the orbit parameters for this celestial body.
Definition: CelestialBody.cpp:59
std::vector< CelestialBody * > _children
Definition: CelestialBody.hpp:105
struct CelestialBody::@2::@4 orbit
void set_spin(SpinConfiguration const &configuration)
Configure the spin parameters for this celestial body.
Definition: CelestialBody.cpp:72
void set_ring(bonobo::mesh_data const &shape, GLuint const *program, GLuint diffuse_texture_id, glm::vec2 const &scale=glm::vec2(1.0f))
Default constructor for a celestial body.
Definition: CelestialBody.cpp:79
float inclination
Angle in radians between the its orbital axis and its parent's rotational axis.
Definition: CelestialBody.hpp:87
Node node
Definition: CelestialBody.hpp:84
glm::mat4 render(std::chrono::microseconds elapsed_time, glm::mat4 const &view_projection, glm::mat4 const &parent_transform=glm::mat4(1.0f), bool show_basis=false)
Render this celestial body.
Definition: CelestialBody.cpp:18
bool is_set
Definition: CelestialBody.hpp:102
float axial_tilt
Angle in radians between the its rotational and orbital axis.
Definition: CelestialBody.hpp:93
Represents a node of a scene graph.
Definition: node.hpp:17
Definition: CelestialBody.hpp:16
float radius
Distance in metres between the centre of the orbit and the body's centre of gravity.
Definition: CelestialBody.hpp:17
float inclination
Angle in radians between the body's orbital axis and its parent's rotational axis.
Definition: CelestialBody.hpp:18
float speed
Rotation speed in radians per second.
Definition: CelestialBody.hpp:19
Definition: CelestialBody.hpp:10
float axial_tilt
Angle in radians between the body's rotational and orbital axis.
Definition: CelestialBody.hpp:11
float speed
Rotation speed in radians per second.
Definition: CelestialBody.hpp:12
Contains the data for a mesh in OpenGL.
Definition: helpers.hpp:42