39 ES_PROPERTY(tooltip=
"Off leaves the chain exactly as the animation poses it.")
43 ES_PROPERTY(category=
Motion, min=0, max=1, step=0.01, slider, tooltip=
"How hard each bone is pulled back toward its animated pose. 0 hangs free, 1 follows the animation exactly.")
47 ES_PROPERTY(category=
Motion, min=0, max=1, step=0.01, slider, tooltip=
"How much of its speed a bone loses each frame. Higher settles sooner.")
51 ES_PROPERTY(category=
Motion, tooltip=
"Gravity on the chain, in world units a second squared (world y is up).")
55 ES_PROPERTY(category=Wind, tooltip=
"A steady wind on the chain, in world units a second squared. Zero is still air.")
56 glm::vec3
wind{0.0f, 0.0f, 0.0f};
59 ES_PROPERTY(category=Wind, min=0, max=1, step=0.01, slider, tooltip=
"How far gusts swing the wind's strength. 0 is a steady wind, 1 takes it from calm to twice its strength.")
63 ES_PROPERTY(category=Wind, min=0, step=0.05, tooltip=
"Gusts a second.")
67 ES_PROPERTY(category=Chain, min=0, step=0.1, tooltip=
"Length of the tip past each end bone, in world units. 0 leaves the end bones unsimulated.")
71 ES_PROPERTY(category=Chain, min=0, step=0.1, tooltip=
"Thickness of the strand, in world units, kept clear of the colliders.")
75 ES_PROPERTY(category=Chain, min=0, max=1, step=0.01, slider, tooltip=
"How much of the simulation is used. 0 is the animation alone.")
79 ES_PROPERTY(category=
Collision, entity_ref, tooltip=
"Entities with a SpringBoneCollider that this chain is kept out of (the head, the shoulders).")
97 ES_PROPERTY(category=
Shape, min=0, step=0.1, tooltip=
"Radius in world units, before the entity's scale.")
101 ES_PROPERTY(category=
Shape, min=0, step=0.1, shown_when=shape:
Capsule, tooltip=
"A capsule's length between the centres of its end spheres, in world units before scale.")
105 ES_PROPERTY(category=
Shape, tooltip=
"Where the centre of the shape is, in the entity's own space.")
Math utilities and GLM configuration for ESEngine.
Reflection and metadata system for automatic binding generation.
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
#define ES_ENUM(...)
Mark an enum that should be exposed to scripts.
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Core type definitions and utilities for ESEngine.
SpringBoneShape
What a SpringBoneCollider is shaped like.
std::int32_t i32
Signed 32-bit integer.
float f32
32-bit floating point
Entity identifier with packed index + generation.
SpringBoneCollider()=default
f32 height
A capsule's length between its two end spheres' centres, in world units before scale.
glm::vec3 offset
Where the shape's centre is, in the entity's own space.
f32 radius
Radius, in world units before the entity's scale.
f32 drag
How much of its velocity a bone loses each frame, 0 to 1.
glm::vec3 wind
A steady wind on the chain, in world units a second squared.
f32 weight
How much of the simulated pose is used, 0 to 1: 0 is the animation alone.
f32 windGust
How far gusts swing the wind's strength, 0 to 1.
f32 radius
The thickness of the strand, in world units, kept clear of every collider.
bool enabled
Simulated this frame. Off leaves the chain exactly as the animation poses it.
std::vector< Entity > colliders
Entities with a SpringBoneCollider this chain keeps out of.
f32 windFrequency
Gusts a second.
glm::vec3 gravity
Gravity on the chain, in world units a second squared.
f32 endLength
How far the last bones of a chain reach past themselves, in world units: a leaf has no child to aim a...
f32 stiffness
How hard each bone is pulled back toward the pose the animation gives it, 0 to 1.