SanAndreasUnity/Assets/Scripts/Importing/Collision/Sphere.cs

31 lines
800 B
C#
Raw Normal View History

2020-05-31 17:07:22 +00:00
using System.IO;
namespace SanAndreasUnity.Importing.Collision
{
public class Sphere
{
public const int Size = sizeof(float) + Vector3.Size + Surface.Size;
public readonly float Radius;
public readonly Vector3 Center;
public readonly Surface Surface;
public Sphere(BinaryReader reader, Version version)
{
switch (version)
{
case Version.COLL:
Radius = reader.ReadSingle();
Center = new Vector3(reader);
break;
default:
Center = new Vector3(reader);
Radius = reader.ReadSingle();
break;
}
Surface = new Surface(reader);
}
}
}