Refactor Physics Colliders to use auto serialization.

This commit is contained in:
Chandler Cox
2023-12-02 12:01:32 -06:00
parent 712c400e43
commit 73d33e4af0
14 changed files with 7 additions and 162 deletions

View File

@@ -292,30 +292,6 @@ void Collider::OnMaterialChanged()
PhysicsBackend::SetShapeMaterial(_shape, Material.Get());
}
void Collider::Serialize(SerializeStream& stream, const void* otherObj)
{
// Base
PhysicsColliderActor::Serialize(stream, otherObj);
SERIALIZE_GET_OTHER_OBJ(Collider);
SERIALIZE_MEMBER(IsTrigger, _isTrigger);
SERIALIZE_MEMBER(Center, _center);
SERIALIZE_MEMBER(ContactOffset, _contactOffset);
SERIALIZE(Material);
}
void Collider::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
{
// Base
PhysicsColliderActor::Deserialize(stream, modifier);
DESERIALIZE_MEMBER(IsTrigger, _isTrigger);
DESERIALIZE_MEMBER(Center, _center);
DESERIALIZE_MEMBER(ContactOffset, _contactOffset);
DESERIALIZE(Material);
}
void Collider::BeginPlay(SceneBeginData* data)
{
// Check if has no shape created (it means no rigidbody requested it but also collider may be spawned at runtime)