Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
physics_creation_factory.h
Go to the documentation of this file.
1#pragma once
2
3#include <box2d/box2d.h>
10
11#include <memory>
12#include <vector>
13
21 public:
22 PhysicsCreationFactory(b2WorldId world_id);
23
33 Component* component);
34
44 static Body2D create_box_fixture(Body2D body, Point offset, float width,
45 float height, PhysicsCreationFlags flags);
46
56 static Body2D create_circle_fixture(Body2D body, Point offset, float radius,
58
64 static void destroy_body(Body2D& body);
65
66 private:
67 b2WorldId world_id_;
68};
Base class for all components that can be attached to GameObjects.
Definition component.h:24
Factory class for creating physics bodies in the Box2D world.
Definition physics_creation_factory.h:20
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.
Body2D create_body(Vector3 position, BodyType2D::Type type, Component *component)
Create a physics body in the Box2D world.
PhysicsCreationFactory(b2WorldId world_id)
Represents a point in 2D space.
Definition point.h:6
Represents a 3D vector with x, y, and z components. This class provides basic vector operations such ...
Definition vector3.h:8
Structure representing a 2D physics body.
Definition body_2d.h:26
Type
Definition body_type_2d.h:14
Flags for creating physics bodies.
Definition physics_creation_flags.h:14