Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
|
#include <camera.h>
Public Member Functions | |
Camera2D () | |
Camera2D (const std::string &name) | |
void | set_offset (const glm::vec2 &offset) |
glm::vec2 | get_offset () const |
void | set_zoom (const glm::vec2 &zoom) |
glm::vec2 | get_zoom () const |
void | set_viewport (int width, int height) |
glm::vec2 | get_viewport () const |
void | follow (Node2D *target) |
void | process (double dt) override |
glm::mat4 | get_view_matrix () const |
![]() | |
Node2D () | |
Node2D (std::string name) | |
void | set_z_index (int index) |
int | get_z_index () const |
int | get_effective_z_index () const |
void | print_tree (int indent=0) const |
void | change_visibility (bool visible) |
void | translate (float dx, float dy) |
void | rotate (float radians) |
void | scale (float sx, float sy) |
Transform2D | get_global_transform () const |
Transform2D | get_transform () const |
void | set_transform (const Transform2D &transform) |
void | add_child (const std::string &base_name, Node2D *node) |
Node2D * | get_node (const std::string &path) |
template<typename T > | |
T * | get_node () |
virtual void | ready () |
virtual void | draw (Renderer *renderer) |
virtual void | input (const InputManager *input) |
virtual void | draw_inspector () |
virtual void | draw_hierarchy () |
void | queue_free () |
virtual | ~Node2D () |
const std::string & | get_name () const |
bool | is_visible () const |
bool | is_effective_visible () const |
HashMap< std::string, Node2D * > & | get_tree () |
bool | is_alive () const |
Additional Inherited Members | |
![]() | |
Transform2D | _transform = {} |
std::string | _name = "Node" |
int | _z_index = 0 |
bool | _is_visible = true |
bool | _is_ready = false |
bool | _to_free = false |
Camera2D component.
orthographic
view_width | Viewport width |
view_height | Viewport height |
zoom | Camera zoom between (0.0f - 10.0f) |
|
default |
|
inlineexplicit |
void Camera2D::follow | ( | Node2D * | target | ) |
glm::vec2 Camera2D::get_offset | ( | ) | const |
glm::mat4 Camera2D::get_view_matrix | ( | ) | const |
glm::vec2 Camera2D::get_viewport | ( | ) | const |
glm::vec2 Camera2D::get_zoom | ( | ) | const |
|
overridevirtual |
Reimplemented from Node2D.
void Camera2D::set_offset | ( | const glm::vec2 & | offset | ) |
void Camera2D::set_viewport | ( | int | width, |
int | height | ||
) |
void Camera2D::set_zoom | ( | const glm::vec2 & | zoom | ) |