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

Method SetClothPaint

Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp:4347–4363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4345}
4346
4347void PhysicsBackend::SetClothPaint(void* cloth, Span<const float> value)
4348{
4349 PROFILE_CPU();
4350 auto clothPhysX = (nv::cloth::Cloth*)cloth;
4351 if (value.IsValid())
4352 {
4353 const nv::cloth::MappedRange<const PxVec4> range = ((const nv::cloth::Cloth*)clothPhysX)->getCurrentParticles();
4354 nv::cloth::Range<PxVec4> motionConstraints = clothPhysX->getMotionConstraints();
4355 ASSERT(motionConstraints.size() <= (uint32)value.Length());
4356 for (int32 i = 0; i < value.Length(); i++)
4357 motionConstraints.begin()[i] = PxVec4(range[i].getXYZ(), value[i]);
4358 }
4359 else
4360 {
4361 clothPhysX->clearMotionConstraints();
4362 }
4363}
4364
4365void PhysicsBackend::AddCloth(void* scene, void* cloth)
4366{

Callers

nothing calls this directly

Calls 5

getXYZMethod · 0.80
IsValidMethod · 0.45
sizeMethod · 0.45
LengthMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected