コード例 #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);
 }