|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Structure representing a 2D physics body. More...
#include <body_2d.h>
Static Public Member Functions | |
| static struct Body2DTransform | get_body_transform (const Body2D &body) |
| Retrieves the transform of the specified body. | |
| static struct Body2DTransform | get_pixel_transform (const Body2D &body) |
| Retrieves the pixel transform of the specified body. | |
| static void | set_body_transform (const struct Body2DTransform &transform, bool in_pixels=false) |
| Sets the transform of the specified body. | |
| static void | set_body_type (const Body2D &body, BodyType2D::Type type) |
| Sets the type of the specified body. | |
| static void | set_body_gravity_scale (const Body2D &body, float scale) |
| Sets the size of the specified body. | |
| static void | set_body_mass (const Body2D &body, float mass) |
| Sets the mass of the specified body. | |
| static void | set_body_size (const Body2D &body, const Vector3 &size, Point offset) |
| Sets the size of the specified body. | |
| static void | set_body_radius (const Body2D &body, float radius, Point offset) |
| Sets the radius of the specified body. | |
| static void | set_body_bounciness (const Body2D &body, float bounciness, ShapeType2D::Type type) |
| Sets the bounciness of the specified body for a given shape type. | |
| static void | set_body_friction (const Body2D &body, float friction, ShapeType2D::Type type) |
| Sets the friction of the specified body for a given shape type. | |
| static void | set_body_velocity (const Body2D &body, const Vector3 &velocity) noexcept |
| Sets the velocity of the specified body. | |
| static void | apply_force (const Body2D &body, const Vector3 &force) noexcept |
| Applies a force to the specified body. | |
| static void | apply_impulse (const Body2D &body, const Vector3 &impulse) noexcept |
| Applies an impulse to the specified body. | |
| static Vector3 | get_body_velocity (const Body2D &body) noexcept |
| Retrieves the current velocity of the specified body. | |
Public Attributes | |
| b2BodyId | id {} |
| std::vector< Shape2D > | shapes |
Structure representing a 2D physics body.
Includes the body ID and associated shapes.
Applies a force to the specified body.
| body | The Body2D instance to apply the force to. |
| force | The force vector to apply. |
Applies an impulse to the specified body.
| body | The Body2D instance to apply the impulse to. |
| impulse | The impulse vector to apply. |
|
static |
Retrieves the transform of the specified body.
| body | The Body2D instance to get the transform for. |
|
static |
Retrieves the pixel transform of the specified body.
| body | The Body2D instance to get the local transform for. |
|
static |
Sets the bounciness of the specified body for a given shape type.
| body | The Body2D instance to set the bounciness for. |
| bounciness | The new bounciness value. |
| type | The ShapeType2D::Type to apply the bounciness to. |
|
static |
Sets the friction of the specified body for a given shape type.
| body | The Body2D instance to set the friction for. |
| friction | The new friction value. |
| type | The ShapeType2D::Type to apply the friction to. |
|
static |
|
static |
Sets the mass of the specified body.
| body | The Body2D instance to set the mass for. |
| mass | The new mass value. |
Sets the radius of the specified body.
| body | The Body2D instance to set the radius for. |
| radius | The new radius value. |
|
static |
Sets the transform of the specified body.
| transform | The Body2DTransform instance containing the new transform data. |
| in_pixels | Whether the provided transform is in pixels (true) or Box2D units (false). |
|
static |
Sets the type of the specified body.
| body | The Body2D instance to set the type for. |
| type | The BodyType2D::Type to set. |
|
staticnoexcept |
Sets the velocity of the specified body.
| body | The Body2D instance to set the velocity for. |
| velocity | The new velocity vector. |
| b2BodyId Body2D::id {} |
| std::vector<Shape2D> Body2D::shapes |