23#define KTECH_DEFINITION
24#include "../ktech.hpp"
25#undef KTECH_DEFINITION
26#include "../basic/point.hpp"
27#include "../basic/upoint.hpp"
53 std::vector<bool>
m_c;
56 void Write(
const std::vector<std::string>& stringVector, uint8_t type,
Point relativePosition =
Point(0, 0));
61 [[nodiscard]]
auto operator()(
size_t x,
size_t y)
const -> bool;
2D physical space for Objects.
Definition collider.hpp:46
UPoint m_size
Rectangle size (used in both simple and complex forms).
Definition collider.hpp:52
void Write(const std::vector< std::string > &stringVector, uint8_t type, Point relativePosition=Point(0, 0))
Construct a complex Collider (2D bitmap).
Definition collider.cpp:75
void ByTextureForeground(const Texture &texture, uint8_t type, uint8_t alphaThreshold=0)
Construct a Collider based on a Texture's foreground values.
Definition collider.cpp:157
Point m_rPos
Relative position to the parent Object.
Definition collider.hpp:51
void Simple(UPoint size, uint8_t type, Point relativePosition=Point(0, 0))
Construct a simple Collider (filled rectangle).
Definition collider.cpp:34
std::vector< bool > m_c
1D vector of the 2D bitmap (used only in complex form).
Definition collider.hpp:53
auto operator()(size_t x, size_t y) const -> bool
Get a value from the 2D bitmap by-value (complex Colliders only).
Definition collider.cpp:185
void ByTextureBackground(const Texture &texture, uint8_t type, uint8_t alphaThreshold=0)
Construct a Collider based on a Texture's background values.
Definition collider.cpp:133
void ByTextureCharacter(const Texture &texture, uint8_t type, char excludedCharacter=' ')
Construct a Collider based on a Texture's character values.
Definition collider.cpp:109
bool m_active
Activation status: true means enabled. false means disabled, and will be ignored in Object movement p...
Definition collider.hpp:47
bool m_simple
true means simple, false means complex.
Definition collider.hpp:49
uint8_t m_type
Collider type, which determines collision results based on Collision::colliderTypes.
Definition collider.hpp:50
2D vector, mostly used to store positions and directions.
Definition point.hpp:30
A CellA-based sprite.
Definition texture.hpp:48
Unsigned 2D vector, mostly used to store sizes and 2D indexes.
Definition upoint.hpp:29