Represents a celestial body.
#include <CelestialBody.hpp>
|
| CelestialBody (bonobo::mesh_data const &shape, GLuint const *program, GLuint diffuse_texture_id) |
| Default constructor for a celestial body.
|
|
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.
|
|
void | add_child (CelestialBody *child) |
| Mark another celestial body as being “attached” to the current one.
|
|
std::vector< CelestialBody * > const & | get_children () const |
| Return all the children of this celestial body.
|
|
void | set_orbit (OrbitConfiguration const &configuration) |
| Configure the orbit parameters for this celestial body.
|
|
void | set_scale (glm::vec3 const &scale) |
| Configure the scale of this celestial body.
|
|
void | set_spin (SpinConfiguration const &configuration) |
| Configure the spin parameters for this celestial body.
|
|
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.
|
|
◆ CelestialBody()
CelestialBody::CelestialBody |
( |
bonobo::mesh_data const & |
shape, |
|
|
GLuint const * |
program, |
|
|
GLuint |
diffuse_texture_id |
|
) |
| |
- Parameters
-
[in] | shape | Information about the geometry used to model the celestial body (more details about it in assignment 2 |
[in] | program | Shader program used to render the celestial body (more details about it in assignment~3) |
[in] | diffuse_texture_id | Identifier of the diffuse texture used (more details about it also in assignment~3) |
◆ add_child()
◆ get_children()
std::vector< CelestialBody * > const & CelestialBody::get_children |
( |
| ) |
const |
◆ render()
glm::mat4 CelestialBody::render |
( |
std::chrono::microseconds |
elapsed_time, |
|
|
glm::mat4 const & |
view_projection, |
|
|
glm::mat4 const & |
parent_transform = glm::mat4(1.0f) , |
|
|
bool |
show_basis = false |
|
) |
| |
- Parameters
-
[in] | elapsed_time | Amount of time (in microseconds) between two frames |
[in] | view_projection | Matrix transforming from world space to clip space |
[in] | parent_transform | Matrix transforming from the parent’s local space to world space |
[in] | show_basis | Show a 3D basis transformed by the world matrix of this celestial body |
- Returns
- Matrix transforming from this celestial body’s local space to world space
◆ set_orbit()
◆ set_ring()
void CelestialBody::set_ring |
( |
bonobo::mesh_data const & |
shape, |
|
|
GLuint const * |
program, |
|
|
GLuint |
diffuse_texture_id, |
|
|
glm::vec2 const & |
scale = glm::vec2(1.0f) |
|
) |
| |
- Parameters
-
[in] | shape | Shape used for the rings. |
[in] | program | Identifier of the shader program used to render the ring |
[in] | diffuse_texture_id | Identifier of the diffuse texture used by the ring |
[in] | scale | How much to scale the ring along the x- and y-axis, assuming you are looking at it from above |
◆ set_scale()
void CelestialBody::set_scale |
( |
glm::vec3 const & |
scale | ) |
|
◆ set_spin()
◆ [struct]
struct { ... } CelestialBody::_body |
◆ _children
◆ [struct]
struct { ... } CelestialBody::_ring |
◆ axial_tilt
float CelestialBody::axial_tilt {0.0f} |
◆ inclination
float CelestialBody::inclination {0.0f} |
◆ is_set
bool CelestialBody::is_set {false} |
◆ node
◆ [struct]
struct { ... } CelestialBody::orbit |
◆ radius
float CelestialBody::radius {0.0f} |
◆ rotation_angle
float CelestialBody::rotation_angle {0.0f} |
How much has it rotated around its rotational axis; in radians.
◆ scale [1/2]
glm::vec3 CelestialBody::scale {1.0f} |
◆ scale [2/2]
glm::vec2 CelestialBody::scale {1.0f} |
◆ speed
float CelestialBody::speed {0.0f} |
◆ [struct]
struct { ... } CelestialBody::spin |
The documentation for this class was generated from the following files: