Merge pull request #2315 from aws-lumberyard-dev/MultiplayerWeapons

Multiplayer weapons
This commit is contained in:
kberg-amzn
2021-07-21 17:37:21 -07:00
committed by GitHub
8 changed files with 43 additions and 34 deletions
@@ -303,4 +303,22 @@ namespace AzNetworking
return serializer.IsValid();
}
};
template <>
struct SerializeObjectHelper<AZ::Transform>
{
static bool SerializeObject(ISerializer& serializer, AZ::Transform& value)
{
AZ::Vector3 translation = value.GetTranslation();
AZ::Quaternion rotation = value.GetRotation();
float uniformScale = value.GetUniformScale();
serializer.Serialize(translation, "Translation");
serializer.Serialize(rotation, "Rotation");
serializer.Serialize(uniformScale, "Scale");
value.SetTranslation(translation);
value.SetRotation(rotation);
value.SetUniformScale(uniformScale);
return serializer.IsValid();
}
};
}
@@ -11,9 +11,9 @@
namespace AzNetworking
{
// This gives us a hash sensitivity of around 1/128th of a unit, and will detect errors within a range of -16,777,216 to +16,777,216
static const int32_t FloatHashMinValue = (INT_MIN >> 7);
static const int32_t FloatHashMaxValue = (INT_MAX >> 7);
// This gives us a hash sensitivity of around 1/512th of a unit, and will detect errors within a range of -4,194,304 to +4,194,304
static const int32_t FloatHashMinValue = (INT_MIN >> 9);
static const int32_t FloatHashMaxValue = (INT_MAX >> 9);
AZ::HashValue32 HashSerializer::GetHash() const
{