| 888 | } |
| 889 | |
| 890 | void Cloth::OnPostUpdate() |
| 891 | { |
| 892 | if (_meshDeformation) |
| 893 | { |
| 894 | // Mark mesh as dirty |
| 895 | Matrix invWorld; |
| 896 | GetWorldToLocalMatrix(invWorld); |
| 897 | BoundingBox localBounds; |
| 898 | BoundingBox::Transform(_box, invWorld, localBounds); |
| 899 | _meshDeformation->Dirty(_mesh.LODIndex, _mesh.MeshIndex, MeshBufferType::Vertex0, localBounds); |
| 900 | if (_simulationSettings.ComputeNormals) |
| 901 | _meshDeformation->Dirty(_mesh.LODIndex, _mesh.MeshIndex, MeshBufferType::Vertex1, localBounds); |
| 902 | |
| 903 | // Update bounds (for mesh culling) |
| 904 | auto* actor = (ModelInstanceActor*)GetParent(); |
| 905 | actor->UpdateBounds(); |
| 906 | if (_sceneRenderingKey != -1) |
| 907 | GetSceneRendering()->UpdateActor(this, _sceneRenderingKey); |
| 908 | } |
| 909 | } |
| 910 | |
| 911 | void Cloth::Draw(RenderContext& renderContext) |
| 912 | { |
no test coverage detected