3#include "structure/design_pattern/spk_cached_data.hpp"
4#include "structure/design_pattern/spk_contract_provider.hpp"
5#include "structure/engine/2d/spk_component_2d.hpp"
6#include "structure/engine/2d/spk_force_2d.hpp"
7#include "structure/math/spk_matrix.hpp"
8#include "structure/math/spk_vector2.hpp"
9#include "structure/math/spk_vector3.hpp"
28 spk::Vector2 _position = {0, 0};
29 spk::Vector2 _scale = {1, 1};
34 spk::RigidBody2D *_rigidBodyCache =
nullptr;
36 spk::CachedData<spk::Matrix4x4> _localModelMatrix;
37 spk::CachedData<spk::Matrix4x4> _localInverseModelMatrix;
38 spk::CachedData<spk::Matrix4x4> _modelMatrix;
39 spk::CachedData<spk::Matrix4x4> _inverseModelMatrix;
41 spk::ContractProvider _onEditionContractProvider;
51 bool _checkCollision(
const spk::Matrix4x4 &p_futureModelMatrix);
52 spk::Matrix4x4 _composeLocalMatrix(
const spk::Vector2 &p_position,
const spk::Vector2 &p_scale,
float p_rotation)
const;
53 void _setPosition(
const spk::Vector2 &p_position);
54 void _setScale(
const spk::Vector2 &p_scale);
55 void _setRotation(
const float &p_rotation);
100 void setLayer(
const float &p_layer);
105 const float &
layer()
const;
121 const spk::Vector2 &
position()
const;
132 void setScale(
const spk::Vector2 &p_scale);
137 const spk::Vector2 &
scale()
const;
169 const spk::Force2D &
velocity()
const;
Component2D(const std::wstring &p_name)
Builds a 2D component with a name.
Definition spk_component_2d.cpp:9
Physics component that handles collisions in 2D.
Definition spk_rigid_body_2d.hpp:20
typename Contract::Job Job
Definition spk_contract_provider.hpp:267
Directional force represented by direction and magnitude.
Definition spk_force_2d.hpp:13