I am serializing a FVector and a FRotator like this.
//----------------------------------------------------------------------------
TArray<uint8> UMovementReplicatorComponent::EncodeLocationAndRotation()
{
TArray<uint8> Payload;
FMemoryWriter Ar(Payload);
Ar << Location; //FVector
Ar << Rotation; //Rotator
return Payload;
}
//----------------------------------------------------------------------------
void UMovementReplicatorComponent::DecodeLocationAndRotation(const TArray<uint8>& Payload)
{
FMemoryReader Ar(Payload);
Ar << Location; //FVector
Ar << Rotation; //FRotator
}
//----------------------------------------------------------------------------
I would like to work only with two decimal places
I’m looking at the definition of FVector_NetQuantize100 and I see that it uses FArchive instead.
I need fast serialization.
Is there a way to serialize FVector and FRotation to two decimal places from memory?
Thank you so much!!