MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnPostUpdate

Method OnPostUpdate

Source/Engine/Physics/Actors/Cloth.cpp:890–909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888}
889
890void 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
911void Cloth::Draw(RenderContext& renderContext)
912{

Callers 1

UpdateClothsMethod · 0.80

Calls 5

UpdateActorMethod · 0.80
TransformClass · 0.50
GetParentFunction · 0.50
DirtyMethod · 0.45
UpdateBoundsMethod · 0.45

Tested by

no test coverage detected