|
virtual std::vector< std::weak_ptr< component > > const & | components () const |
|
virtual std::vector< std::weak_ptr< component > > & | components () |
|
virtual float | x () const |
|
void | set_x (float x) override |
|
virtual float | y () const |
|
void | set_y (float y) override |
|
virtual float | angle () const |
|
void | set_angle (float angle) override |
|
virtual std::array< float, 4 > const & | transformation_matrix () const |
|
float | x_offset () const override |
|
virtual void | set_x_offset (float x_offset) |
|
float | y_offset () const override |
|
virtual void | set_y_offset (float y_offset) |
|
float | angle_offset () const override |
|
virtual void | set_angle_offset (float angle_offset) |
|
bool | attach_x () const override |
|
virtual void | set_attach_x (bool attach_x) |
|
bool | attach_y () const override |
|
virtual void | set_attach_y (bool attach_y) |
|
bool | attach_angle () const override |
|
virtual void | set_attach_angle (bool attach_angle) |
|
bool | x_angle_lock () const override |
|
virtual void | set_x_angle_lock (bool x_angle_lock) |
|
bool | y_angle_lock () const override |
|
virtual void | set_y_angle_lock (bool y_angle_lock) |
|
| entity (std::vector< std::weak_ptr< component > > const &components={}, float x=0, float y=0, float angle=0, float x_offset=0, float y_offset=0, float angle_offset=0, bool attach_x=true, bool attach_y=true, bool attach_angle=true, bool x_angle_lock=true, bool y_angle_lock=true) |
|
virtual void | recompose () |
|
Definition at line 34 of file entity.hpp.
◆ entity()
wze::entity::entity |
( |
std::vector< std::weak_ptr< component > > const & | components = {}, |
|
|
float | x = 0, |
|
|
float | y = 0, |
|
|
float | angle = 0, |
|
|
float | x_offset = 0, |
|
|
float | y_offset = 0, |
|
|
float | angle_offset = 0, |
|
|
bool | attach_x = true, |
|
|
bool | attach_y = true, |
|
|
bool | attach_angle = true, |
|
|
bool | x_angle_lock = true, |
|
|
bool | y_angle_lock = true ) |
|
explicit |
Definition at line 165 of file entity.cpp.
169 {
170 this->components() = components;
171 set_x(x);
172 set_y(y);
173 set_angle(angle);
174 set_x_offset(x_offset);
175 set_y_offset(y_offset);
176 set_angle_offset(angle_offset);
177 set_attach_x(attach_x);
178 set_attach_y(attach_y);
179 set_attach_angle(attach_angle);
180 set_x_angle_lock(x_angle_lock);
181 set_y_angle_lock(y_angle_lock);
182}
◆ components() [1/2]
std::vector< std::weak_ptr< wze::component > > const & wze::entity::components |
( |
| ) |
const |
|
nodiscardvirtual |
Definition at line 61 of file entity.cpp.
61 {
62 return _components;
63}
◆ components() [2/2]
std::vector< std::weak_ptr< wze::component > > & wze::entity::components |
( |
| ) |
|
|
nodiscardvirtual |
Definition at line 65 of file entity.cpp.
65 {
66 return _components;
67}
◆ x()
float wze::entity::x |
( |
| ) |
const |
|
nodiscardvirtual |
◆ set_x()
void wze::entity::set_x |
( |
float | x | ) |
|
|
overridevirtual |
◆ y()
float wze::entity::y |
( |
| ) |
const |
|
nodiscardvirtual |
◆ set_y()
void wze::entity::set_y |
( |
float | y | ) |
|
|
overridevirtual |
◆ angle()
float wze::entity::angle |
( |
| ) |
const |
|
nodiscardvirtual |
Definition at line 87 of file entity.cpp.
87 {
88 return _angle;
89}
◆ set_angle()
void wze::entity::set_angle |
( |
float | angle | ) |
|
|
overridevirtual |
Implements wze::component.
Definition at line 91 of file entity.cpp.
91 {
92 _angle = angle;
94 update<&entity::update_x, &entity::update_y, &entity::update_angle>();
95}
static std::array< float, 4 > transformation_matrix(float angle, float scale)
Creates a transformation matrix.
◆ transformation_matrix()
std::array< float, 4 > const & wze::entity::transformation_matrix |
( |
| ) |
const |
|
nodiscardvirtual |
Definition at line 97 of file entity.cpp.
97 {
98 return _transformation_matrix;
99}
◆ x_offset()
float wze::entity::x_offset |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_x_offset()
void wze::entity::set_x_offset |
( |
float | x_offset | ) |
|
|
virtual |
Definition at line 105 of file entity.cpp.
105 {
106 _x_offset = x_offset;
107}
◆ y_offset()
float wze::entity::y_offset |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_y_offset()
void wze::entity::set_y_offset |
( |
float | y_offset | ) |
|
|
virtual |
Definition at line 113 of file entity.cpp.
113 {
114 _y_offset = y_offset;
115}
◆ angle_offset()
float wze::entity::angle_offset |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_angle_offset()
void wze::entity::set_angle_offset |
( |
float | angle_offset | ) |
|
|
virtual |
Definition at line 121 of file entity.cpp.
121 {
122 _angle_offset = angle_offset;
123}
◆ attach_x()
bool wze::entity::attach_x |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_attach_x()
void wze::entity::set_attach_x |
( |
bool | attach_x | ) |
|
|
virtual |
Definition at line 129 of file entity.cpp.
129 {
130 _attach_x = attach_x;
131}
◆ attach_y()
bool wze::entity::attach_y |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_attach_y()
void wze::entity::set_attach_y |
( |
bool | attach_y | ) |
|
|
virtual |
Definition at line 137 of file entity.cpp.
137 {
138 _attach_y = attach_y;
139}
◆ attach_angle()
bool wze::entity::attach_angle |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_attach_angle()
void wze::entity::set_attach_angle |
( |
bool | attach_angle | ) |
|
|
virtual |
Definition at line 145 of file entity.cpp.
145 {
146 _attach_angle = attach_angle;
147}
◆ x_angle_lock()
bool wze::entity::x_angle_lock |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_x_angle_lock()
void wze::entity::set_x_angle_lock |
( |
bool | x_angle_lock | ) |
|
|
virtual |
Definition at line 153 of file entity.cpp.
153 {
154 _x_angle_lock = x_angle_lock;
155}
◆ y_angle_lock()
bool wze::entity::y_angle_lock |
( |
| ) |
const |
|
nodiscardoverridevirtual |
◆ set_y_angle_lock()
void wze::entity::set_y_angle_lock |
( |
bool | y_angle_lock | ) |
|
|
virtual |
Definition at line 161 of file entity.cpp.
161 {
162 _y_angle_lock = y_angle_lock;
163}
◆ recompose()
void wze::entity::recompose |
( |
| ) |
|
|
virtual |
Definition at line 184 of file entity.cpp.
184 {
185 update<&entity::update_x, &entity::update_y, &entity::update_angle>();
186}
The documentation for this class was generated from the following files: