class

ClothSystem

Creates one Jolt soft body per Cloth entity (grid + XPBD edge/ shear/bend constraints from SoftBodySharedSettings::CreateConstraints), mirrors world-space vertex bounds into the component every frame, and removes the body when the component or entity goes away. Raw JPH types stay inside Physics.dll (same rule as VehicleSystem).

Module
Physics
Header
#include "Physics/ClothSystem.h"
Namespace
Mowo

Type aliases

AliasDescription
using FSkinnedSourceProvider = std::function<bool(EntityID entity, int32_t submesh, FClothSkinnedSource& outSource)>Skinned-mesh cloth. The providers are installed by the scene: the source one answers once per cloth with the submesh's vertices, the palette one every frame with the animator's pose. Vertices are welded by position for the solver; GetSkinnedVertexPositions hands back one MESH-SPACE position per ORIGINAL vertex, in the source's order, so a render clone can be written straight from it.
using FSkinPaletteProvider = std::function<bool(EntityID entity, FClothSkinPalette& outPalette)>

Constructors

SignatureNameDescription
ClothSystem()ClothSystem
~ClothSystem() override~ClothSystem
ClothSystem(const ClothSystem&) = deleteClothSystem

Public functions

ReturnsNameDescription
ClothSystem&operator=
voidInitialize
voidShutdown
voidUpdate
boolGetVertexPositionsWorld-space vertex positions (row-major, segmentsY rows of segmentsX).
voidSetSkinnedSourceProvider
voidSetSkinPaletteProvider
boolGetSkinnedVertexPositions
boolIsSkinnedCloth
boolGetSoftBodyVertexPositionsSoft body over a static mesh: WORLD-space positions, one per original vertex (seams welded for the solver, expanded back here).
boolIsSoftBody

Function details

ClothSystem

C++
ClothSystem()

~ClothSystem

C++
~ClothSystem() override

ClothSystem

C++
ClothSystem(const ClothSystem&) = delete

operator=

C++
ClothSystem& operator=(const ClothSystem&) = delete

Initialize

C++
void Initialize(World* world) override

Shutdown

C++
void Shutdown() override

Update

C++
void Update(float deltaTime) override

GetVertexPositions

C++
bool GetVertexPositions(EntityID entity, std::vector<Vec3>& outPositions) const

World-space vertex positions (row-major, segmentsY rows of segmentsX). False when the entity has no live cloth body yet.

SetSkinnedSourceProvider

C++
void SetSkinnedSourceProvider(FSkinnedSourceProvider provider)

SetSkinPaletteProvider

C++
void SetSkinPaletteProvider(FSkinPaletteProvider provider)

GetSkinnedVertexPositions

C++
bool GetSkinnedVertexPositions(EntityID entity, std::vector<Vec3>& outMeshSpace) const

IsSkinnedCloth

C++
bool IsSkinnedCloth(EntityID entity) const

GetSoftBodyVertexPositions

C++
bool GetSoftBodyVertexPositions(EntityID entity, std::vector<Vec3>& outWorld) const

Soft body over a static mesh: WORLD-space positions, one per original vertex (seams welded for the solver, expanded back here).

IsSoftBody

C++
bool IsSoftBody(EntityID entity) const
Generated from Physics/ClothSystem.h via physics.json · Nov 4, 2026Version 1.0.0