|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Flags for creating physics bodies. More...
#include <physics_creation_flags.h>
Public Attributes | |
| bool | dynamic {true} |
| Density of the body. | |
| bool | enable_rotation {false} |
| Whether to enable rotation for the body. | |
| bool | sensor {false} |
| Whether the body is a sensor. | |
| bool | enable_contact_events {true} |
| Whether to enable contact events for the body. | |
| bool | enable_sensor_events {true} |
| Whether to enable sensor events for the body. | |
| bool | is_bullet {false} |
| Whether the body is treated as a bullet. | |
| uint16_t | category = default_collision_category |
| Collision category filtering. | |
| uint16_t | mask = default_collision_mask |
| Collision mask filtering. | |
| float | desired_mass {1.0f} |
| Desired mass of the body. | |
| float | friction {0.5f} |
| Friction coefficient of the body. | |
| float | bounciness {0.5f} |
| Bounciness (restitution) of the body. | |
Flags for creating physics bodies.
This struct encapsulates various options that can be set when creating physics bodies in the Box2D world.
| float PhysicsCreationFlags::bounciness {0.5f} |
Bounciness (restitution) of the body.
Default is 0.5f. This value defines how bouncy the body is during collisions.
| uint16_t PhysicsCreationFlags::category = default_collision_category |
Collision category filtering.
Default is 0x0001. This value defines the category of the body for collision filtering. E.g, 0x0002 for player, 0x0004 for enemies.
| float PhysicsCreationFlags::desired_mass {1.0f} |
Desired mass of the body.
Default is 1.0f. This value sets the mass of the body directly.
| bool PhysicsCreationFlags::dynamic {true} |
Density of the body.
Default is 1.0f if not specified.
| bool PhysicsCreationFlags::enable_contact_events {true} |
Whether to enable contact events for the body.
Default is true. If true, the body will generate contact events on collisions.
| bool PhysicsCreationFlags::enable_rotation {false} |
Whether to enable rotation for the body.
Default is false.
| bool PhysicsCreationFlags::enable_sensor_events {true} |
Whether to enable sensor events for the body.
Default is true. If true, the body will generate events when other bodies enter/exit the sensor.
| float PhysicsCreationFlags::friction {0.5f} |
Friction coefficient of the body.
Default is 0.5f. This value defines the friction applied to the body during collisions.
| bool PhysicsCreationFlags::is_bullet {false} |
Whether the body is treated as a bullet.
Default is false. A bullet is a fast-moving object that requires continuous collision detection.
| uint16_t PhysicsCreationFlags::mask = default_collision_mask |
Collision mask filtering.
Default is 0xFFFF | 0x0001. This value defines which categories this body collides with. E.g, 0x0002 | 0x0004 to collide with players and enemies.
| bool PhysicsCreationFlags::sensor {false} |
Whether the body is a sensor.
Default is false. A sensor does not generate collision responses but can detect overlaps.