| 4345 | } |
| 4346 | |
| 4347 | void 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 | |
| 4365 | void PhysicsBackend::AddCloth(void* scene, void* cloth) |
| 4366 | { |