Пример #1
0
 public static Vector3i ConvertWorldToChunkCoordinates(Vector3 input)
 {
     return(new Vector3i(Convert.ToInt32(input.X / ChunkSize),
                         Convert.ToInt32(input.Y / ChunkSize),
                         Convert.ToInt32(input.Z / ChunkSize)));
 }
Пример #2
0
 public static UInt64 GetIDfromWorldPos(Vector3 worldpos)
 {
     return(Convert.ToUInt64(Convert.ToInt32(worldpos.Z) + Convert.ToInt32(worldpos.Y) * SideLengthWorld + Convert.ToInt32(worldpos.X) * Math.Floor(Math.Pow(2, 42))));
 }
Пример #3
0
 public static UInt64 GetChunkIDfromWorldPos(Vector3 worldpos)
 {
     return(GetIDfromWorldPos(worldpos / ChunkSize));
 }
Пример #4
0
 public static bool FrustumCheckChunk(Vector3i pos_to_check)
 {
     return(MathHelper.RadiansToDegrees(MathHelper.Acos(Vector3.Dot(Camera.Front.Normalized(),
                                                                    (Camera.Position - ConvertChunkToWorldCoordinates(pos_to_check)).Normalized()))) >
            Camera.Frustrum / 2f);
 }