![]() |
Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
|
#include <physics.hpp>
Public Member Functions | |
| void | exit () override |
| virtual void | physicsUpdate ()=0 |
| void | initialize () override |
| virtual void | initCompute () |
| template<class Archive > | |
| void | save (Archive &ar) const |
| template<class Archive > | |
| void | load (Archive &ar) |
| b2BodyId | getBodyId () |
| b2ShapeId | getShapeId () |
Public Member Functions inherited from Component | |
| virtual | ~Component ()=default |
| virtual void | update (float deltaTime) |
| virtual void | render (std::shared_ptr< Window > window) |
| virtual void | input (InputEvent &event) |
| virtual void | postLoad () |
| Node * | getNode () const |
| void | setNode (Node *n) |
| template<class Archive > | |
| void | save (Archive &ar) const |
| template<class Archive > | |
| void | load (Archive &ar) |
Public Attributes | |
| Signal< PhysicsBody * > | collisionEnter |
| Signal< PhysicsBody * > | collisionExit |
| Signal< PhysicsBody * > | collisionHit |
| Signal | mouseEntered |
| Signal | mouseExited |
| std::shared_ptr< Shape > | shape |
Protected Attributes | |
| bool | sensor |
| b2BodyDef | bodyDef |
| b2BodyId | bodyId |
| b2ShapeId | shapeId |
| Transform | storedTransform |
The base PhysicsBody class defines the Shape, functions and signals that are the base of every physics body.
You can connect callbacks onto the collision signals of the physics body:
There are also signals for when the mouse enters and leaves the body, which are very useful for UI elements.
For more information, take a look at the button example.
|
overridevirtual |
Reimplemented from Component.
|
inline |
|
inline |
|
virtual |
Reimplemented in StaticBody, RigidBody, and KinematicBody.
|
overridevirtual |
Reimplemented from Component.
|
inline |
|
pure virtual |
Reimplemented from Component.
Implemented in StaticBody, RigidBody, and KinematicBody.
|
inline |
|
protected |
|
protected |
| Signal<PhysicsBody *> PhysicsBody::collisionEnter |
| Signal<PhysicsBody *> PhysicsBody::collisionExit |
| Signal<PhysicsBody *> PhysicsBody::collisionHit |
| Signal PhysicsBody::mouseEntered |
| Signal PhysicsBody::mouseExited |
|
protected |
| std::shared_ptr<Shape> PhysicsBody::shape |
|
protected |
|
protected |