The Table Engine
|
Script to manage collisions between game objects. More...
#include <collision_script.h>
Public Member Functions | |
CollisionScript () | |
Constructs a new Collision Script object. More... | |
void | update () override |
Updates the collision status of the associated game object. More... | |
void | render () override |
Renders collision-related visuals if necessary. More... | |
![]() | |
Script () | |
Default constructor, initializes an empty script. More... | |
Script (std::string name) | |
Constructs a Script with a specified name. More... | |
virtual | ~Script () |
Virtual destructor to allow for cleanup in derived script classes. More... | |
std::string | getName () |
Retrieves the name of the script. More... | |
GameObject * | getOwner () |
Retrieves the owner GameObject of this script. More... | |
void | setOwner (GameObject *owner) |
Sets the owner of this script. More... | |
virtual void | input () |
Virtual method for handling input. Should be overridden by derived classes. More... | |
Private Attributes | |
bool | m_collide |
Additional Inherited Members | |
![]() | |
std::string | m_name |
Name of the script, useful for identification or debugging. More... | |
GameObject * | m_owner |
Pointer to the GameObject that owns this script. More... | |
Script to manage collisions between game objects.
Inherits from the Script class and utilizes the Collide component to handle collisions.
Definition at line 19 of file collision_script.h.
CollisionScript::CollisionScript | ( | ) |
Constructs a new Collision Script object.
Initializes the collision flag to false.
Definition at line 9 of file collision_script.cpp.
|
overridevirtual |
Renders collision-related visuals if necessary.
This method is called once per frame after update(), if there is a need to render visual cues related to collision (like debug outlines).
Reimplemented from Script.
Definition at line 33 of file collision_script.cpp.
|
overridevirtual |
Updates the collision status of the associated game object.
This method is called once per frame and checks for any collisions that involve the game object this script is attached to.
Reimplemented from Script.
Definition at line 13 of file collision_script.cpp.
|
private |
Flag to track collision state
Definition at line 21 of file collision_script.h.