Skip to main content

SoftBody

The SoftBody plugin is a GPU-accelerated soft body physics engine that supports simulation on single or multiple GPUs to achieve high fidelity and performance. It enables simulation of cloth and tetrahedral-based deformable bodies with automatic geometry generation from meshes. The system is fully compute-driven and configurable, supporting real-time physics for complex dynamic objects such as fabrics, soft tissues, or volumetric solids.

#include <physics/softbody/include/TellusimSoftManager.h>
#include <physics/softbody/include/TellusimSoftSolver.h>
#include <physics/softbody/include/TellusimSoftObjectBrush.h>
#include <physics/softbody/include/TellusimSoftObjectShell.h>
#include <physics/softbody/include/TellusimSoftObjectSolid.h>

Example

// Create soft body physics manager
SoftManager soft_manager(&scene_manager);
if(!soft_manager.create(soft_device)) return false;

// Configure global simulation parameters
soft_manager.setDragForce(2.0f);
soft_manager.setShapeForce(16.0f);
soft_manager.setDistanceScale(1.5f);
soft_manager.setGravityAcceleration(Vector3f(0.0f, 0.0f, -9.8f));

// Update physics state
soft_manager.update(soft_device);

// Run physics simulation step
soft_manager.dispatch(soft_device, compute, scene.getTime(), 1.0f / 200.0f);