|
ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
|
变换组件,决定 GameObject 的位置 / 缩放 / 旋转 更多...
#include <TransformComponent.h>
Public 成员函数 | |
| TransformComponent () | |
| ~TransformComponent () override=default | |
| const Vector2 & | getPosition () const |
| void | setPosition (const Vector2 &position) |
| const Vector2 & | getScale () const |
| void | setScale (const Vector2 &scale) |
| float | getRotation () const |
| void | setRotation (float rotation) |
| Public 成员函数 继承自 Component | |
| Component () | |
| virtual | ~Component ()=default |
| virtual void | onCreate () |
| virtual void | onAttach () |
| virtual void | onDetach () |
| virtual void | onDestroy () |
| Component (const Component &)=delete | |
| Component & | operator= (const Component &)=delete |
| Component (Component &&)=delete | |
| Component & | operator= (Component &&)=delete |
| GameObject * | getOwner () const |
| bool | isRegistered () const |
友元 | |
| class | GameObject |
额外继承的成员函数 | |
| Protected 属性 继承自 Component | |
| GameObject * | m_owner = nullptr |
| bool | m_isRegistered = false |
变换组件,决定 GameObject 的位置 / 缩放 / 旋转
每个 GameObject 默认不含 TransformComponent,需手动 addComponent。 位置单位为世界坐标,旋转单位为度。
|
explicit |
|
overridedefault |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |