|
Engine²
Open-source game engine written in C++.
|
Soft body simulation settings. More...
#include <SoftBody.hpp>
Static Public Member Functions | |
| static SoftBodySettings | Default () |
| Default soft body settings. | |
| static SoftBodySettings | Cloth (float stiffness=0.5f) |
| Settings optimized for cloth simulation. | |
| static SoftBodySettings | Rope (float stiffness=0.9f) |
| Settings optimized for rope simulation. | |
| static SoftBodySettings | Balloon (float pressure=1000.0f) |
| Settings for pressure-based soft bodies (balloons). | |
| static SoftBodySettings | Jelly () |
| Settings for jelly-like objects. | |
Public Attributes | |
| uint32_t | solverIterations = 5 |
| Number of solver iterations (higher = more accurate but slower). | |
| float | linearDamping = 0.1f |
| Linear damping (velocity decay). | |
| float | maxLinearVelocity = 500.0f |
| Maximum linear velocity (m/s). | |
| float | gravityFactor = 1.0f |
| Gravity factor (1.0 = normal gravity). | |
| float | restitution = 0.0f |
| Restitution (bounciness) [0, 1]. | |
| float | friction = 0.2f |
| Friction coefficient [0, 1]. | |
| float | pressure = 0.0f |
| float | edgeCompliance = 0.0f |
| Edge constraint compliance (0 = rigid, higher = softer). | |
| float | shearCompliance = 0.0f |
| Shear constraint compliance. | |
| float | bendCompliance = 1.0f |
| Bend constraint compliance (FLT_MAX = disable bending). | |
| float | vertexRadius = 0.0f |
| Vertex collision radius (for collision detection). | |
| bool | allowSleeping = true |
| Allow sleeping when stable. | |
| bool | doubleSidedFaces = false |
| Treat faces as double-sided for collision. | |
Soft body simulation settings.
|
inlinestatic |
Settings for pressure-based soft bodies (balloons).
| pressure | Internal pressure |
Uses stiff constraint values inspired by Jolt's SoftBodyCreator defaults:
|
inlinestatic |
Settings optimized for cloth simulation.
| stiffness | Cloth stiffness [0, 1] (1 = stiff like canvas, 0 = very soft like silk) |
|
inlinestatic |
Default soft body settings.
|
inlinestatic |
Settings for jelly-like objects.
|
inlinestatic |
Settings optimized for rope simulation.
| stiffness | Rope stiffness [0, 1] |
| bool Physics::Component::SoftBodySettings::allowSleeping = true |
Allow sleeping when stable.
| float Physics::Component::SoftBodySettings::bendCompliance = 1.0f |
Bend constraint compliance (FLT_MAX = disable bending).
| bool Physics::Component::SoftBodySettings::doubleSidedFaces = false |
Treat faces as double-sided for collision.
| float Physics::Component::SoftBodySettings::edgeCompliance = 0.0f |
Edge constraint compliance (0 = rigid, higher = softer).
| float Physics::Component::SoftBodySettings::friction = 0.2f |
Friction coefficient [0, 1].
| float Physics::Component::SoftBodySettings::gravityFactor = 1.0f |
Gravity factor (1.0 = normal gravity).
| float Physics::Component::SoftBodySettings::linearDamping = 0.1f |
Linear damping (velocity decay).
| float Physics::Component::SoftBodySettings::maxLinearVelocity = 500.0f |
Maximum linear velocity (m/s).
| float Physics::Component::SoftBodySettings::pressure = 0.0f |
Pressure for volume preservation (0 = no pressure) For balloons/inflatables: n * R * T (substance amount * gas constant * temperature)
| float Physics::Component::SoftBodySettings::restitution = 0.0f |
Restitution (bounciness) [0, 1].
| float Physics::Component::SoftBodySettings::shearCompliance = 0.0f |
Shear constraint compliance.
| uint32_t Physics::Component::SoftBodySettings::solverIterations = 5 |
Number of solver iterations (higher = more accurate but slower).
| float Physics::Component::SoftBodySettings::vertexRadius = 0.0f |
Vertex collision radius (for collision detection).