15 static std::string
GetType() {
return "Collider"; }
37 std::vector<fVec2> edges = {
fVec2(100,100),
fVec2(-100,100),
fVec2(-100,-100),
fVec2(100,-100) };
55 void Start()
override;
57 int Serialize(std::fstream* data,
int offset)
override;
59 int Deserialize(std::fstream* data,
int offset)
override;
Defines the GameObject class and its related components.
The Collider class represents a base collider component.
Definition Collider.h:7
bool isColliding(Collider *other, fVec2 *depthBuffer=nullptr)
Check if this collider is colliding with another collider.
Definition Collider.cpp:81
int Serialize(std::fstream *data, int offset) override
Serialize the object and write it to the file.
Definition Collider.cpp:100
fVec2 GetPosition()
Get the position of the collider.
Definition Collider.cpp:27
fVec2 GetEdgePosition(int index)
Get the position of a specific edge of the collider.
Definition Collider.cpp:32
int Deserialize(std::fstream *data, int offset) override
Deserialize the object from the file.
Definition Collider.cpp:106
void Start() override
Start the game component.
Definition Collider.cpp:11
bool Sat(Collider *other, fVec2 *depthBuffer=nullptr)
Check if this collider is colliding with another collider using the Separating Axis Theorem (SAT).
Definition Collider.cpp:37
static std::string GetType()
Get the type of the collider.
Definition Collider.h:15
Base class for game components.
Definition GameObject.h:29
Class representing a game object.
Definition GameObject.h:68