3
0

ClothComponentMeshTest.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <AZTestShared/Math/MathTestHelpers.h>
  9. #include <AzCore/UnitTest/UnitTest.h>
  10. #include <AzCore/Component/Entity.h>
  11. #include <AzFramework/Components/TransformComponent.h>
  12. #include <Components/ClothComponentMesh/ClothComponentMesh.h>
  13. #include <UnitTestHelper.h>
  14. #include <ActorHelper.h>
  15. #include <Integration/Components/ActorComponent.h>
  16. namespace UnitTest
  17. {
  18. //! Fixture to setup entity with actor component and the tests data.
  19. class NvClothComponentMesh
  20. : public ::testing::Test
  21. {
  22. public:
  23. const AZStd::string MeshNodeName = "cloth_node";
  24. const AZStd::vector<AZ::Vector3> MeshVertices = {{
  25. AZ::Vector3(-1.0f, 0.0f, 0.0f),
  26. AZ::Vector3(1.0f, 0.0f, 0.0f),
  27. AZ::Vector3(0.0f, 1.0f, 0.0f)
  28. }};
  29. const AZStd::vector<NvCloth::SimIndexType> MeshIndices = {{
  30. 0, 1, 2
  31. }};
  32. const AZStd::vector<VertexSkinInfluences> MeshSkinningInfo = {{
  33. VertexSkinInfluences{ SkinInfluence(0, 1.0f) },
  34. VertexSkinInfluences{ SkinInfluence(0, 1.0f) },
  35. VertexSkinInfluences{ SkinInfluence(0, 1.0f) }
  36. }};
  37. const AZStd::vector<AZ::Vector2> MeshUVs = {{
  38. AZ::Vector2(0.0f, 0.0f),
  39. AZ::Vector2(1.0f, 0.0f),
  40. AZ::Vector2(0.5f, 1.0f)
  41. }};
  42. // [inverse mass, motion constrain radius, backstop offset, backstop radius]
  43. const AZStd::vector<AZ::Color> MeshClothData = {{
  44. AZ::Color(0.75f, 0.6f, 0.5f, 0.1f),
  45. AZ::Color(1.0f, 0.16f, 0.1f, 1.0f),
  46. AZ::Color(0.25f, 1.0f, 0.9f, 0.5f)
  47. }};
  48. const AZ::u32 LodLevel = 0;
  49. protected:
  50. // ::testing::Test overrides ...
  51. void SetUp() override;
  52. void TearDown() override;
  53. EMotionFX::Integration::ActorComponent* m_actorComponent = nullptr;
  54. private:
  55. AZStd::unique_ptr<AZ::Entity> m_entity;
  56. };
  57. void NvClothComponentMesh::SetUp()
  58. {
  59. m_entity = AZStd::make_unique<AZ::Entity>();
  60. m_entity->CreateComponent<AzFramework::TransformComponent>();
  61. m_actorComponent = m_entity->CreateComponent<EMotionFX::Integration::ActorComponent>();
  62. m_entity->Init();
  63. m_entity->Activate();
  64. }
  65. void NvClothComponentMesh::TearDown()
  66. {
  67. m_entity->Deactivate();
  68. m_actorComponent = nullptr;
  69. m_entity.reset();
  70. }
  71. TEST_F(NvClothComponentMesh, ClothComponentMesh_DefaultConstructor_ReturnsEmptyRenderData)
  72. {
  73. AZ::EntityId entityId;
  74. NvCloth::ClothComponentMesh clothComponentMesh(entityId, {});
  75. const auto& renderData = clothComponentMesh.GetRenderData();
  76. EXPECT_TRUE(renderData.m_particles.empty());
  77. EXPECT_TRUE(renderData.m_tangents.empty());
  78. EXPECT_TRUE(renderData.m_bitangents.empty());
  79. EXPECT_TRUE(renderData.m_normals.empty());
  80. }
  81. TEST_F(NvClothComponentMesh, ClothComponentMesh_InitWithEmptyActor_ReturnsEmptyRenderData)
  82. {
  83. {
  84. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  85. actor->FinishSetup();
  86. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  87. }
  88. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), {});
  89. const auto& renderData = clothComponentMesh.GetRenderData();
  90. EXPECT_TRUE(renderData.m_particles.empty());
  91. EXPECT_TRUE(renderData.m_tangents.empty());
  92. EXPECT_TRUE(renderData.m_bitangents.empty());
  93. EXPECT_TRUE(renderData.m_normals.empty());
  94. }
  95. TEST_F(NvClothComponentMesh, ClothComponentMesh_InitWithActorWithNoMesh_ReturnsEmptyRenderData)
  96. {
  97. {
  98. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  99. actor->AddJoint(MeshNodeName);
  100. actor->FinishSetup();
  101. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  102. }
  103. NvCloth::ClothConfiguration clothConfig;
  104. clothConfig.m_meshNode = MeshNodeName;
  105. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  106. const auto& renderData = clothComponentMesh.GetRenderData();
  107. EXPECT_TRUE(renderData.m_particles.empty());
  108. EXPECT_TRUE(renderData.m_tangents.empty());
  109. EXPECT_TRUE(renderData.m_bitangents.empty());
  110. EXPECT_TRUE(renderData.m_normals.empty());
  111. }
  112. // [TODO LYN-1891]
  113. // Revisit when Cloth Component Mesh works with Actors adapted to Atom models.
  114. // Editor Cloth component now uses the new AZ::Render::MeshComponentNotificationBus::OnModelReady
  115. // notification and this test does not setup a model yet.
  116. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_InitWithEntityActorWithNoClothData_TriggersError)
  117. {
  118. {
  119. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  120. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  121. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs));
  122. actor->FinishSetup();
  123. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  124. }
  125. NvCloth::ClothConfiguration clothConfig;
  126. clothConfig.m_meshNode = MeshNodeName;
  127. AZ_TEST_START_TRACE_SUPPRESSION;
  128. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  129. AZ_TEST_STOP_TRACE_SUPPRESSION(1); // Expect 1 error
  130. }
  131. // [TODO LYN-1891]
  132. // Revisit when Cloth Component Mesh works with Actors adapted to Atom models.
  133. // Editor Cloth component now uses the new AZ::Render::MeshComponentNotificationBus::OnModelReady
  134. // notification and this test does not setup a model yet.
  135. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_InitWithEntityActor_ReturnsValidRenderData)
  136. {
  137. {
  138. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  139. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  140. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  141. actor->FinishSetup();
  142. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  143. }
  144. NvCloth::ClothConfiguration clothConfig;
  145. clothConfig.m_meshNode = MeshNodeName;
  146. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  147. const auto& renderData = clothComponentMesh.GetRenderData();
  148. EXPECT_EQ(renderData.m_particles.size(), MeshVertices.size());
  149. EXPECT_EQ(renderData.m_particles.size(), MeshClothData.size());
  150. for (size_t i = 0; i < renderData.m_particles.size(); ++i)
  151. {
  152. EXPECT_THAT(renderData.m_particles[i].GetAsVector3(), IsCloseTolerance(MeshVertices[i], Tolerance));
  153. EXPECT_NEAR(renderData.m_particles[i].GetW(), MeshClothData[i].GetR(), ToleranceU8);
  154. }
  155. EXPECT_THAT(renderData.m_tangents, ::testing::Each(IsCloseTolerance(AZ::Vector3::CreateAxisX(), Tolerance)));
  156. EXPECT_THAT(renderData.m_bitangents, ::testing::Each(IsCloseTolerance(AZ::Vector3::CreateAxisY(), Tolerance)));
  157. EXPECT_THAT(renderData.m_normals, ::testing::Each(IsCloseTolerance(AZ::Vector3::CreateAxisZ(), Tolerance)));
  158. }
  159. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_TickClothSystem_RunningSimulationVerticesGoDown)
  160. {
  161. {
  162. const float height = 4.7f;
  163. const float radius = 1.2f;
  164. const auto collider = CreateCapsuleCollider(MeshNodeName, height, radius);
  165. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  166. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  167. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  168. actor->AddClothCollider(collider);
  169. actor->FinishSetup();
  170. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  171. }
  172. NvCloth::ClothConfiguration clothConfig;
  173. clothConfig.m_meshNode = MeshNodeName;
  174. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  175. const AZStd::vector<NvCloth::SimParticleFormat> particlesBefore = clothComponentMesh.GetRenderData().m_particles;
  176. // Ticking Cloth System updates all its solvers
  177. for (size_t i = 0; i < 300.0f; ++i)
  178. {
  179. const float deltaTimeSim = 1.0f / 60.0f;
  180. AZ::TickBus::Broadcast(&AZ::TickEvents::OnTick,
  181. deltaTimeSim,
  182. AZ::ScriptTimePoint(AZStd::chrono::steady_clock::now()));
  183. }
  184. const AZStd::vector<NvCloth::SimParticleFormat> particlesAfter = clothComponentMesh.GetRenderData().m_particles;
  185. EXPECT_EQ(particlesAfter.size(), particlesBefore.size());
  186. for (size_t i = 0; i < particlesAfter.size(); ++i)
  187. {
  188. EXPECT_LT(particlesAfter[i].GetZ(), particlesBefore[i].GetZ());
  189. }
  190. }
  191. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_UpdateConfigurationInvalidEntity_ReturnEmptyRenderData)
  192. {
  193. {
  194. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  195. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  196. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  197. actor->FinishSetup();
  198. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  199. }
  200. NvCloth::ClothConfiguration clothConfig;
  201. clothConfig.m_meshNode = MeshNodeName;
  202. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  203. AZ::EntityId newEntityId;
  204. clothComponentMesh.UpdateConfiguration(newEntityId, clothConfig);
  205. const auto& renderData = clothComponentMesh.GetRenderData();
  206. EXPECT_TRUE(renderData.m_particles.empty());
  207. EXPECT_TRUE(renderData.m_tangents.empty());
  208. EXPECT_TRUE(renderData.m_bitangents.empty());
  209. EXPECT_TRUE(renderData.m_normals.empty());
  210. }
  211. // [TODO LYN-1891]
  212. // Revisit when Cloth Component Mesh works with Actors adapted to Atom models.
  213. // Editor Cloth component now uses the new AZ::Render::MeshComponentNotificationBus::OnModelReady
  214. // notification and this test does not setup a model yet.
  215. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_UpdateConfigurationDifferentEntity_ReturnsRenderDataFromNewEntity)
  216. {
  217. {
  218. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  219. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  220. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  221. actor->FinishSetup();
  222. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  223. }
  224. NvCloth::ClothConfiguration clothConfig;
  225. clothConfig.m_meshNode = MeshNodeName;
  226. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  227. const AZStd::vector<AZ::Vector3> newMeshVertices = {{
  228. AZ::Vector3(-2.3f, 0.0f, 0.0f),
  229. AZ::Vector3(4.0f, 0.0f, 0.0f),
  230. AZ::Vector3(0.0f, -1.0f, 0.0f)
  231. }};
  232. auto newEntity = AZStd::make_unique<AZ::Entity>();
  233. newEntity->CreateComponent<AzFramework::TransformComponent>();
  234. auto* newActorComponent = newEntity->CreateComponent<EMotionFX::Integration::ActorComponent>();
  235. newEntity->Init();
  236. newEntity->Activate();
  237. {
  238. auto actor = AZStd::make_unique<ActorHelper>("actor_test2");
  239. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  240. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(newMeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  241. actor->FinishSetup();
  242. newActorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  243. }
  244. clothComponentMesh.UpdateConfiguration(newActorComponent->GetEntityId(), clothConfig);
  245. const auto& renderData = clothComponentMesh.GetRenderData();
  246. EXPECT_EQ(renderData.m_particles.size(), newMeshVertices.size());
  247. EXPECT_EQ(renderData.m_particles.size(), MeshClothData.size());
  248. for (size_t i = 0; i < renderData.m_particles.size(); ++i)
  249. {
  250. EXPECT_THAT(renderData.m_particles[i].GetAsVector3(), IsCloseTolerance(newMeshVertices[i], Tolerance));
  251. EXPECT_NEAR(renderData.m_particles[i].GetW(), MeshClothData[i].GetR(), ToleranceU8);
  252. }
  253. }
  254. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_UpdateConfigurationInvalidMeshNode_ReturnEmptyRenderData)
  255. {
  256. {
  257. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  258. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  259. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  260. actor->FinishSetup();
  261. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  262. }
  263. NvCloth::ClothConfiguration clothConfig;
  264. clothConfig.m_meshNode = MeshNodeName;
  265. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  266. clothConfig.m_meshNode = "unknown_cloth_mesh_node";
  267. clothComponentMesh.UpdateConfiguration(m_actorComponent->GetEntityId(), clothConfig);
  268. const auto& renderData = clothComponentMesh.GetRenderData();
  269. EXPECT_TRUE(renderData.m_particles.empty());
  270. EXPECT_TRUE(renderData.m_tangents.empty());
  271. EXPECT_TRUE(renderData.m_bitangents.empty());
  272. EXPECT_TRUE(renderData.m_normals.empty());
  273. }
  274. // [TODO LYN-1891]
  275. // Revisit when Cloth Component Mesh works with Actors adapted to Atom models.
  276. // Editor Cloth component now uses the new AZ::Render::MeshComponentNotificationBus::OnModelReady
  277. // notification and this test does not setup a model yet.
  278. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_UpdateConfigurationNewMeshNode_ReturnsRenderDataFromNewMeshNode)
  279. {
  280. const AZStd::string meshNode2Name = "cloth_node_2";
  281. const AZStd::vector<AZ::Vector3> mesh2Vertices = {{
  282. AZ::Vector3(-2.3f, 0.0f, 0.0f),
  283. AZ::Vector3(4.0f, 0.0f, 0.0f),
  284. AZ::Vector3(0.0f, -1.0f, 0.0f)
  285. }};
  286. {
  287. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  288. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  289. auto meshNode2Index = actor->AddJoint(meshNode2Name);
  290. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  291. actor->SetMesh(LodLevel, meshNode2Index, CreateEMotionFXMesh(mesh2Vertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  292. actor->FinishSetup();
  293. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  294. }
  295. NvCloth::ClothConfiguration clothConfig;
  296. clothConfig.m_meshNode = MeshNodeName;
  297. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  298. clothConfig.m_meshNode = meshNode2Name;
  299. clothComponentMesh.UpdateConfiguration(m_actorComponent->GetEntityId(), clothConfig);
  300. const auto& renderData = clothComponentMesh.GetRenderData();
  301. EXPECT_EQ(renderData.m_particles.size(), mesh2Vertices.size());
  302. EXPECT_EQ(renderData.m_particles.size(), MeshClothData.size());
  303. for (size_t i = 0; i < renderData.m_particles.size(); ++i)
  304. {
  305. EXPECT_THAT(renderData.m_particles[i].GetAsVector3(), IsCloseTolerance(mesh2Vertices[i], Tolerance));
  306. EXPECT_NEAR(renderData.m_particles[i].GetW(), MeshClothData[i].GetR(), ToleranceU8);
  307. }
  308. }
  309. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_UpdateConfigurationInvertingGravity_RunningSimulationVerticesGoUp)
  310. {
  311. {
  312. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  313. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  314. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  315. actor->FinishSetup();
  316. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  317. }
  318. NvCloth::ClothConfiguration clothConfig;
  319. clothConfig.m_meshNode = MeshNodeName;
  320. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  321. const AZStd::vector<NvCloth::SimParticleFormat> particlesBefore = clothComponentMesh.GetRenderData().m_particles;
  322. clothConfig.m_gravityScale = -1.0f;
  323. clothComponentMesh.UpdateConfiguration(m_actorComponent->GetEntityId(), clothConfig);
  324. // Ticking Cloth System updates all its solvers
  325. for (size_t i = 0; i < 300.0f; ++i)
  326. {
  327. const float deltaTimeSim = 1.0f / 60.0f;
  328. AZ::TickBus::Broadcast(&AZ::TickEvents::OnTick,
  329. deltaTimeSim,
  330. AZ::ScriptTimePoint(AZStd::chrono::steady_clock::now()));
  331. }
  332. const AZStd::vector<NvCloth::SimParticleFormat> particlesAfter = clothComponentMesh.GetRenderData().m_particles;
  333. EXPECT_EQ(particlesAfter.size(), particlesBefore.size());
  334. for (size_t i = 0; i < particlesAfter.size(); ++i)
  335. {
  336. EXPECT_GT(particlesAfter[i].GetZ(), particlesBefore[i].GetZ());
  337. }
  338. }
  339. // [TODO LYN-1891]
  340. // Revisit when Cloth Component Mesh works with Actors adapted to Atom models.
  341. // At the moment, CreateAssetFromActor fills only Actor to the ActorAsset, but not the RenderActor,
  342. // because of that the AtomModel is not created and OnModelReady is not called.
  343. TEST_F(NvClothComponentMesh, DISABLED_ClothComponentMesh_ModifyMesh_RenderMeshIsUpdated)
  344. {
  345. {
  346. auto actor = AZStd::make_unique<ActorHelper>("actor_test");
  347. auto meshNodeIndex = actor->AddJoint(MeshNodeName);
  348. actor->SetMesh(LodLevel, meshNodeIndex, CreateEMotionFXMesh(MeshVertices, MeshIndices, MeshSkinningInfo, MeshUVs/*, MeshClothData*/));
  349. actor->FinishSetup();
  350. m_actorComponent->SetActorAsset(CreateAssetFromActor(AZStd::move(actor)));
  351. }
  352. NvCloth::ClothConfiguration clothConfig;
  353. clothConfig.m_meshNode = MeshNodeName;
  354. NvCloth::ClothComponentMesh clothComponentMesh(m_actorComponent->GetEntityId(), clothConfig);
  355. // Ticking Cloth System updates all its solvers
  356. for (size_t i = 0; i < 300.0f; ++i)
  357. {
  358. const float deltaTimeSim = 1.0f / 60.0f;
  359. AZ::TickBus::Broadcast(&AZ::TickEvents::OnTick,
  360. deltaTimeSim,
  361. AZ::ScriptTimePoint(AZStd::chrono::steady_clock::now()));
  362. }
  363. /*
  364. CryRenderMeshStub renderMesh(MeshVertices);
  365. LmbrCentral::MeshModificationNotificationBus::Event(
  366. m_actorComponent->GetEntityId(),
  367. &LmbrCentral::MeshModificationNotificationBus::Events::ModifyMesh,
  368. LodLevel,
  369. 0,
  370. &renderMesh);
  371. const AZStd::vector<NvCloth::SimParticleFormat>& clothParticles = clothComponentMesh.GetRenderData().m_particles;
  372. const AZStd::vector<Vec3>& renderMeshPositions = renderMesh.m_positions;
  373. EXPECT_EQ(renderMeshPositions.size(), clothParticles.size());
  374. for (size_t i = 0; i < renderMeshPositions.size(); ++i)
  375. {
  376. EXPECT_THAT(LYVec3ToAZVec3(renderMeshPositions[i]), IsCloseTolerance(clothParticles[i].GetAsVector3(), Tolerance));
  377. }
  378. */
  379. }
  380. } // namespace UnitTest