Structure representing a physics component.
More...
#include <PhysicsSystem.hpp>
|
| static PhysicsComponent | Box (glm::vec3 halfExtents={0.5f, 0.5f, 0.5f}, BodyType bodyType=BodyType::STATIC, float mass=1.0f, float friction=0.5f, float bounce=0.1f) |
| | Creates a box-shaped physics component.
|
| static PhysicsComponent | RoundedBox (glm::vec3 halfExtents, float radius=0.05f, BodyType bodyType=BodyType::DYNAMIC, float mass=1.0f, float friction=0.5f, float bounce=0.1f) |
| | Creates a rounded box.
|
| static PhysicsComponent | Sphere (float radius=0.5f, BodyType bodyType=BodyType::STATIC, float mass=1.0f, float friction=0.5f, float bounce=0.1f) |
| | Creates a sphere-shaped physics component.
|
| static PhysicsComponent | Capsule (float radius=0.5f, float height=1.0f, BodyType bodyType=BodyType::STATIC, float mass=1.0f, float friction=0.5f, float bounce=0.1f) |
| | Creates a capsule-shaped physics component.
|
| static PhysicsComponent | Cylinder (float radius=0.5f, float height=1.0f, BodyType bodyType=BodyType::STATIC, float mass=1.0f, float friction=0.5f, float bounce=0.1f) |
| | Creates a cylinder-shaped physics component.
|
| static PhysicsComponent | ConvexHull (std::vector< JPH::Vec3 > points, BodyType bodyType=BodyType::STATIC, float mass=1.0f, float friction=0.5f, float bounce=0.1f) |
| | Creates a convex hull-shaped physics component.
|
| static PhysicsComponent | Mesh (MeshComponent &mesh, BodyType bodyType=BodyType::STATIC, float mass=1.0f, float friction=0.5f, float bounce=0.1f) |
| | Creates a mesh-shaped physics component.
|
Structure representing a physics component.
Definition at line 100 of file PhysicsSystem.hpp.
◆ PhysicsComponent()
| vex::PhysicsComponent::PhysicsComponent |
( |
ShapeType | s | ) |
|
|
inlineexplicit |
◆ addCollisionEnterBinding()
Binds a callback for collision enter events.
- Parameters
-
Definition at line 281 of file PhysicsSystem.hpp.
◆ addCollisionExitBinding()
| void vex::PhysicsComponent::addCollisionExitBinding |
( |
std::function< void(vex::Entity, vex::Entity)> | callback | ) |
|
|
inline |
Binds a callback for collision exit events.
- Parameters
-
| std::function<void(vex::Entity,vex::Entity)> | callback The callback function to bind. |
Definition at line 293 of file PhysicsSystem.hpp.
◆ addCollisionStayBinding()
Binds a callback for collision stay events.
- Parameters
-
Definition at line 287 of file PhysicsSystem.hpp.
◆ Box()
| PhysicsComponent vex::PhysicsComponent::Box |
( |
glm::vec3 | halfExtents = {0.5f, 0.5f, 0.5f}, |
|
|
BodyType | bodyType = BodyType::STATIC, |
|
|
float | mass = 1.0f, |
|
|
float | friction = 0.5f, |
|
|
float | bounce = 0.1f ) |
|
inlinestatic |
Creates a box-shaped physics component.
- Parameters
-
| glm::vec3 | halfExtents The half-extents of the box. |
| BodyType | bodyType The type of body (static, dynamic, kinematic). |
| float | mass The mass of the box. |
| float | friction The friction coefficient of the box. |
| float | bounce The bounce coefficient of the box. |
Definition at line 145 of file PhysicsSystem.hpp.
◆ Capsule()
| PhysicsComponent vex::PhysicsComponent::Capsule |
( |
float | radius = 0.5f, |
|
|
float | height = 1.0f, |
|
|
BodyType | bodyType = BodyType::STATIC, |
|
|
float | mass = 1.0f, |
|
|
float | friction = 0.5f, |
|
|
float | bounce = 0.1f ) |
|
inlinestatic |
Creates a capsule-shaped physics component.
- Parameters
-
| float | radius The radius of the capsule. |
| float | height The height of the capsule. |
| BodyType | bodyType The type of body (static, dynamic, kinematic). |
| float | mass The mass of the capsule. |
| float | friction The friction coefficient of the capsule. |
| float | bounce The bounce coefficient of the capsule. |
Definition at line 199 of file PhysicsSystem.hpp.
◆ ConvexHull()
| PhysicsComponent vex::PhysicsComponent::ConvexHull |
( |
std::vector< JPH::Vec3 > | points, |
|
|
BodyType | bodyType = BodyType::STATIC, |
|
|
float | mass = 1.0f, |
|
|
float | friction = 0.5f, |
|
|
float | bounce = 0.1f ) |
|
inlinestatic |
Creates a convex hull-shaped physics component.
- Parameters
-
| std::vector<JPH::Vec3> | points The points defining the convex hull. |
| BodyType | bodyType The type of body (static, dynamic, kinematic). |
| float | mass The mass of the convex hull. |
| float | friction The friction coefficient of the convex hull. |
| float | bounce The bounce coefficient of the convex hull. |
Definition at line 236 of file PhysicsSystem.hpp.
◆ Cylinder()
| PhysicsComponent vex::PhysicsComponent::Cylinder |
( |
float | radius = 0.5f, |
|
|
float | height = 1.0f, |
|
|
BodyType | bodyType = BodyType::STATIC, |
|
|
float | mass = 1.0f, |
|
|
float | friction = 0.5f, |
|
|
float | bounce = 0.1f ) |
|
inlinestatic |
Creates a cylinder-shaped physics component.
- Parameters
-
| float | radius The radius of the cylinder. |
| float | height The height of the cylinder. |
| BodyType | bodyType The type of body (static, dynamic, kinematic). |
| float | mass The mass of the cylinder. |
| float | friction The friction coefficient of the cylinder. |
| float | bounce The bounce coefficient of the cylinder. |
Definition at line 218 of file PhysicsSystem.hpp.
◆ Mesh()
Creates a mesh-shaped physics component.
- Parameters
-
| MeshComponent& | mesh The mesh component to create the physics component from. |
| BodyType | bodyType The type of body (static, dynamic, kinematic). |
| float | mass The mass of the mesh. |
| float | friction The friction coefficient of the mesh. |
| float | bounce The bounce coefficient of the mesh. |
Definition at line 253 of file PhysicsSystem.hpp.
◆ RoundedBox()
| PhysicsComponent vex::PhysicsComponent::RoundedBox |
( |
glm::vec3 | halfExtents, |
|
|
float | radius = 0.05f, |
|
|
BodyType | bodyType = BodyType::DYNAMIC, |
|
|
float | mass = 1.0f, |
|
|
float | friction = 0.5f, |
|
|
float | bounce = 0.1f ) |
|
inlinestatic |
Creates a rounded box.
- Parameters
-
| glm::vec3 | halfExtents The half-extents of the rounded box. |
| float | radius The radius of the rounded corners. |
| BodyType | bodyType The type of body (static, dynamic, kinematic). |
| float | mass The mass of the rounded box. |
| float | friction The friction coefficient of the rounded box. |
| float | bounce The bounce coefficient of the rounded box. |
Definition at line 163 of file PhysicsSystem.hpp.
◆ Sphere()
| PhysicsComponent vex::PhysicsComponent::Sphere |
( |
float | radius = 0.5f, |
|
|
BodyType | bodyType = BodyType::STATIC, |
|
|
float | mass = 1.0f, |
|
|
float | friction = 0.5f, |
|
|
float | bounce = 0.1f ) |
|
inlinestatic |
Creates a sphere-shaped physics component.
- Parameters
-
| float | radius The radius of the sphere. |
| BodyType | bodyType The type of body (static, dynamic, kinematic). |
| float | mass The mass of the sphere. |
| float | friction The friction coefficient of the sphere. |
| float | bounce The bounce coefficient of the sphere. |
Definition at line 181 of file PhysicsSystem.hpp.
◆ allowSleeping
| bool vex::PhysicsComponent::allowSleeping = true |
◆ angularDamping
| float vex::PhysicsComponent::angularDamping = 0.05f |
◆ bodyId
| JPH::BodyID vex::PhysicsComponent::bodyId = JPH::BodyID(JPH::BodyID::cInvalidBodyID) |
◆ bodyType
| BodyType vex::PhysicsComponent::bodyType = BodyType::STATIC |
◆ bounce
| float vex::PhysicsComponent::bounce = 0.1f |
◆ boxHalfExtents
| glm::vec3 vex::PhysicsComponent::boxHalfExtents = {0.5f, 0.5f, 0.5f} |
◆ capsuleHeight
| float vex::PhysicsComponent::capsuleHeight = 1.0f |
◆ capsuleRadius
| float vex::PhysicsComponent::capsuleRadius = 0.5f |
◆ convexPoints
| std::vector<JPH::Vec3> vex::PhysicsComponent::convexPoints |
◆ cylinderHeight
| float vex::PhysicsComponent::cylinderHeight = 1.0f |
◆ cylinderRadius
| float vex::PhysicsComponent::cylinderRadius = 0.5f |
◆ debugDraw
| bool vex::PhysicsComponent::debugDraw = true |
◆ friction
| float vex::PhysicsComponent::friction = 0.5f |
◆ isSensor
| bool vex::PhysicsComponent::isSensor = false |
◆ linearDamping
| float vex::PhysicsComponent::linearDamping = 0.05f |
◆ mass
| float vex::PhysicsComponent::mass = 1.0f |
◆ meshIndices
| std::vector<uint32_t> vex::PhysicsComponent::meshIndices |
◆ meshVertices
| std::vector<glm::vec3> vex::PhysicsComponent::meshVertices |
◆ objectLayer
| uint8_t vex::PhysicsComponent::objectLayer = 0 |
◆ onCollisionEnter
◆ onCollisionExit
◆ onCollisionStay
◆ roundedRadius
| float vex::PhysicsComponent::roundedRadius = 0.05f |
◆ shape
| ShapeType vex::PhysicsComponent::shape = ShapeType::BOX |
◆ sphereRadius
| float vex::PhysicsComponent::sphereRadius = 0.5f |
The documentation for this struct was generated from the following file: