|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Factory class for creating physics bodies in the Box2D world. More...
#include <physics_creation_factory.h>
Public Member Functions | |
| PhysicsCreationFactory (b2WorldId world_id) | |
| Body2D | create_body (Vector3 position, BodyType2D::Type type, Component *component) |
| Create a physics body in the Box2D world. | |
Static Public Member Functions | |
| static Body2D | create_box_fixture (Body2D body, Point offset, float width, float height, PhysicsCreationFlags flags) |
| Create a box-shaped fixture for a given body. | |
| static Body2D | create_circle_fixture (Body2D body, Point offset, float radius, PhysicsCreationFlags flags) |
| Create a circle-shaped fixture for a given body. | |
| static void | destroy_body (Body2D &body) |
| Destroy a body given its identifier. | |
Factory class for creating physics bodies in the Box2D world.
This class provides methods to create various types of physics bodies (such as boxes and circles) with specified properties and flags.
| PhysicsCreationFactory::PhysicsCreationFactory | ( | b2WorldId | world_id | ) |
| Body2D PhysicsCreationFactory::create_body | ( | Vector3 | position, |
| BodyType2D::Type | type, | ||
| Component * | component | ||
| ) |
Create a physics body in the Box2D world.
| position | The initial position of the body |
| type | The type of the body (static, dynamic, kinematic) |
| component | The component associated with the body |
|
static |
Create a box-shaped fixture for a given body.
| body | The identifier of the body to attach the fixture to |
| width | The width of the box |
| height | The height of the box |
| flags | The creation flags for the fixture |
|
static |
Create a circle-shaped fixture for a given body.
| body | The identifier of the body to attach the fixture to |
| radius | The radius of the circle |
| flags | The creation flags for the fixture |
| component | The component associated with the fixture |
|
static |
Destroy a body given its identifier.
| body_id | The identifier of the body to destroy |