6#include <glm/gtc/quaternion.hpp>
8#include "core/reflect.h"
11namespace Vkm::Engine {
18enum class JointType : uint8_t {
32 JointType type = JointType::Point;
35 glm::vec3
anchor = {0.0f, 0.0f, 0.0f};
81VKM_ENUM_NAMES(::Vkm::Engine::JointType,
"Point",
"Distance")
83VKM_REFLECT_BEGIN(::Vkm::Engine::Joint)
86 VKM_F(connectedAnchor)
90 VKM_F(collideConnected)
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23
Ties this entity's body to another, at a point on each.
Definition joint.h:31
float holdTorque
Most torque, in newton-metres, spent holding the two bodies at the angle between them.
Definition joint.h:68
float distance
Distance the anchors are held at, in metres, for a Distance joint.
Definition joint.h:43
bool collideConnected
Whether the two bodies still collide.
Definition joint.h:76
float resolvedDistance
The length actually held, once the solver has measured it; runtime, not serialized.
Definition joint.h:50
glm::vec3 anchor
On this body, local.
Definition joint.h:35
glm::quat heldRotation
The angle held, the connected body's rotation in this one's frame; runtime, not serialized.
Definition joint.h:71
bool heldResolved
Whether heldRotation is current; cleared while neither body can move. Runtime.
Definition joint.h:74
float stiffness
How hard the joint pulls drifted anchors back together, 0 to 1.
Definition joint.h:59
EntityId connected
The other body; empty, or this entity, disables.
Definition joint.h:34
glm::vec3 connectedAnchor
On the other, local.
Definition joint.h:36