| 42 | } |
| 43 | |
| 44 | void Cloth::SetMesh(const ModelInstanceActor::MeshReference& value) |
| 45 | { |
| 46 | if (_mesh.LODIndex == value.LODIndex && _mesh.MeshIndex == value.MeshIndex) |
| 47 | return; |
| 48 | |
| 49 | // Remove mesh deformer (mesh index/lod changes) |
| 50 | if (_meshDeformation) |
| 51 | { |
| 52 | Function<void(const MeshBase*, MeshDeformationData&)> deformer; |
| 53 | deformer.Bind<Cloth, &Cloth::RunClothDeformer>(this); |
| 54 | _meshDeformation->RemoveDeformer(_mesh.LODIndex, _mesh.MeshIndex, MeshBufferType::Vertex0, deformer); |
| 55 | _meshDeformation->RemoveDeformer(_mesh.LODIndex, _mesh.MeshIndex, MeshBufferType::Vertex1, deformer); |
| 56 | _meshDeformation = nullptr; |
| 57 | } |
| 58 | |
| 59 | _mesh = value; |
| 60 | _mesh.Actor = nullptr; // Don't store this reference |
| 61 | #if WITH_CLOTH |
| 62 | if (_cloth) |
| 63 | Rebuild(); |
| 64 | #endif |
| 65 | } |
| 66 | |
| 67 | void Cloth::SetForce(const ForceSettings& value) |
| 68 | { |
nothing calls this directly
no test coverage detected