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

Method Deserialize

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

Source from the content-addressed store, hash-verified

309}
310
311void Cloth::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
312{
313 Actor::Deserialize(stream, modifier);
314
315 PROFILE_MEM(PhysicsCloth);
316 DESERIALIZE_MEMBER(Mesh, _mesh);
317 _mesh.Actor = nullptr; // Don't store this reference
318 DESERIALIZE_MEMBER(Force, _forceSettings);
319 DESERIALIZE_MEMBER(Collision, _collisionSettings);
320 DESERIALIZE_MEMBER(Simulation, _simulationSettings);
321 DESERIALIZE_MEMBER(Fabric, _fabricSettings);
322 DESERIALIZE_MEMBER(Paint, _paint);
323
324#if USE_CLOTH_SANITY_CHECKS
325 {
326 // Sanity check
327 const float* data = _paint.Get();
328 bool allValid = true;
329 for (int32 i = 0; i < _paint.Count(); i++)
330 allValid &= !isnan(data[i]) && !isinf(data[i]);
331 ASSERT(allValid);
332 }
333#endif
334
335 // Refresh cloth when settings were changed
336#if WITH_CLOTH
337 if (_cloth)
338 Rebuild();
339#endif
340}
341
342#if USE_EDITOR
343

Callers

nothing calls this directly

Calls 6

isinfFunction · 0.85
RebuildFunction · 0.85
DeserializeFunction · 0.50
isnanFunction · 0.50
GetMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected