Space Engineers
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
Sandbox.Engine.Voxels.MyPlanetShapeProvider Class Reference

Public Member Functions

 MyPlanetShapeProvider (Vector3 translation, float radius, MyPlanetGeneratorDefinition definition)
 
void Close ()
 
void PrepareCache ()
 
unsafe float GetValueForPositionCacheless (int face, ref Vector2 texcoord, out Vector3 localNormal)
 
float SignedDistanceWithSample (float lodVoxelSize, float distance, float value)
 
void ProjectToSurface (Vector3 localPos, out Vector3 surface)
 
double GetDistanceToSurfaceWithCache (Vector3 localPos)
 
double GetDistanceToSurfaceCacheless (Vector3 localPos)
 
unsafe float GetValueForPositionWithCache (int face, ref Vector2 texcoord, out Vector3 localNormal)
 
float AltitudeToRatio (float altitude)
 
ContainmentType IntersectBoundingBox (ref BoundingBox box, float lodLevel)
 
bool IntersectLineFace (ref LineD ll, int face, out double startOffset, out double endOffset)
 
unsafe bool IntersectLine (ref LineD ll, out double startOffset, out double endOffset)
 
unsafe void GetBounds (Vector3 *localPoints, int pointCount, out float minHeight, out float maxHeight)
 Get the minimum and maximum ranges of terrain height in the area determined by the provided points. More...
 
unsafe void GetBounds (ref BoundingBox box)
 

Static Public Member Functions

static void SetTau (float tau)
 
static float GetTau ()
 
static string GetKnownLodSizes ()
 

Static Public Attributes

static MyDebugHitCounter PruningStats = new MyDebugHitCounter()
 
static MyDebugHitCounter CacheStats = new MyDebugHitCounter()
 
static MyDebugHitCounter CullStats = new MyDebugHitCounter()
 
static MyQueue< MyVoxelDataRequestUnculledRequestHistory = new MyQueue<MyVoxelDataRequest>(MAX_UNCULLED_HISTORY)
 
static MyConcurrentDictionary< int, MyConcurrentHashSet< Vector3I > > KnownLodSizes = new MyConcurrentDictionary<int, MyConcurrentHashSet<Vector3I>>()
 

Protected Member Functions

unsafe ContainmentType IntersectBoundingBoxInternal (ref BoundingBox box, float lodLevel)
 

Properties

static string FormatedUnculledHistory [get]
 
float OuterRadius [get]
 
float InnerRadius [get]
 
bool Closed [get]
 
float MinHillHeight [get]
 
float MaxHillHeight [get]
 
float Radius [get]
 
MyHeightCubemap Heightmap [get]
 

Detailed Description

Definition at line 17 of file MyPlanetShapeProvider.cs.

Constructor & Destructor Documentation

Sandbox.Engine.Voxels.MyPlanetShapeProvider.MyPlanetShapeProvider ( Vector3  translation,
float  radius,
MyPlanetGeneratorDefinition  definition 
)
inline

Definition at line 273 of file MyPlanetShapeProvider.cs.

Member Function Documentation

float Sandbox.Engine.Voxels.MyPlanetShapeProvider.AltitudeToRatio ( float  altitude)
inline

Definition at line 812 of file MyPlanetShapeProvider.cs.

void Sandbox.Engine.Voxels.MyPlanetShapeProvider.Close ( )
inline

Definition at line 323 of file MyPlanetShapeProvider.cs.

unsafe void Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetBounds ( Vector3 localPoints,
int  pointCount,
out float  minHeight,
out float  maxHeight 
)
inline

Get the minimum and maximum ranges of terrain height in the area determined by the provided points.

Parameters
localPointsList of points to query
pointCountNumber of points
minHeightThe calculated minimum possible height of terrain
maxHeightThe calculated maximum possible height of terrain

Definition at line 1212 of file MyPlanetShapeProvider.cs.

unsafe void Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetBounds ( ref BoundingBox  box)
inline

Takes the x and y bounds of the box and queries the heightmap for the minimum and maximum height in the box.

The values are returned in the query box itself as the Z bounds.

This only works if all vertices of the box are in the same face.

Definition at line 1251 of file MyPlanetShapeProvider.cs.

double Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetDistanceToSurfaceCacheless ( Vector3  localPos)
inline

Get the height for a position using the coefficient cache. Calculated position is for LOD0.

Definition at line 671 of file MyPlanetShapeProvider.cs.

double Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetDistanceToSurfaceWithCache ( Vector3  localPos)
inline

Get the height for a position using the coefficient cache. Calculated position is for LOD0.

Definition at line 647 of file MyPlanetShapeProvider.cs.

static string Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetKnownLodSizes ( )
inlinestatic

Definition at line 84 of file MyPlanetShapeProvider.cs.

static float Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetTau ( )
inlinestatic

Definition at line 45 of file MyPlanetShapeProvider.cs.

unsafe float Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetValueForPositionCacheless ( int  face,
ref Vector2  texcoord,
out Vector3  localNormal 
)
inline

Gets the elevation for a position.

Does not use the cache, does not consider details.

Definition at line 587 of file MyPlanetShapeProvider.cs.

unsafe float Sandbox.Engine.Voxels.MyPlanetShapeProvider.GetValueForPositionWithCache ( int  face,
ref Vector2  texcoord,
out Vector3  localNormal 
)
inline

Get the height for a position using the coefficient cache. Calculated position is for LOD0.

Definition at line 701 of file MyPlanetShapeProvider.cs.

ContainmentType Sandbox.Engine.Voxels.MyPlanetShapeProvider.IntersectBoundingBox ( ref BoundingBox  box,
float  lodLevel 
)
inline

Definition at line 824 of file MyPlanetShapeProvider.cs.

unsafe ContainmentType Sandbox.Engine.Voxels.MyPlanetShapeProvider.IntersectBoundingBoxInternal ( ref BoundingBox  box,
float  lodLevel 
)
inlineprotected

Definition at line 893 of file MyPlanetShapeProvider.cs.

unsafe bool Sandbox.Engine.Voxels.MyPlanetShapeProvider.IntersectLine ( ref LineD  ll,
out double  startOffset,
out double  endOffset 
)
inline

Definition at line 1027 of file MyPlanetShapeProvider.cs.

bool Sandbox.Engine.Voxels.MyPlanetShapeProvider.IntersectLineFace ( ref LineD  ll,
int  face,
out double  startOffset,
out double  endOffset 
)
inline

Definition at line 979 of file MyPlanetShapeProvider.cs.

void Sandbox.Engine.Voxels.MyPlanetShapeProvider.PrepareCache ( )
inline

The cache does not store in it's cells which map does one cell belong to, so before using it we have to invalidate all entries.

Maybe at some point we can come up with a more elegant solution for multiple planets.

Definition at line 387 of file MyPlanetShapeProvider.cs.

void Sandbox.Engine.Voxels.MyPlanetShapeProvider.ProjectToSurface ( Vector3  localPos,
out Vector3  surface 
)
inline

Project a position in space to the surface of the heightmap.

Definition at line 621 of file MyPlanetShapeProvider.cs.

static void Sandbox.Engine.Voxels.MyPlanetShapeProvider.SetTau ( float  tau)
inlinestatic

Definition at line 37 of file MyPlanetShapeProvider.cs.

float Sandbox.Engine.Voxels.MyPlanetShapeProvider.SignedDistanceWithSample ( float  lodVoxelSize,
float  distance,
float  value 
)
inline

Use a heightmap sample to produce signed distance.

Definition at line 613 of file MyPlanetShapeProvider.cs.

Member Data Documentation

MyDebugHitCounter Sandbox.Engine.Voxels.MyPlanetShapeProvider.CacheStats = new MyDebugHitCounter()
static

Definition at line 51 of file MyPlanetShapeProvider.cs.

MyDebugHitCounter Sandbox.Engine.Voxels.MyPlanetShapeProvider.CullStats = new MyDebugHitCounter()
static

Definition at line 52 of file MyPlanetShapeProvider.cs.

MyConcurrentDictionary<int, MyConcurrentHashSet<Vector3I> > Sandbox.Engine.Voxels.MyPlanetShapeProvider.KnownLodSizes = new MyConcurrentDictionary<int, MyConcurrentHashSet<Vector3I>>()
static

Definition at line 59 of file MyPlanetShapeProvider.cs.

MyDebugHitCounter Sandbox.Engine.Voxels.MyPlanetShapeProvider.PruningStats = new MyDebugHitCounter()
static

Definition at line 50 of file MyPlanetShapeProvider.cs.

MyQueue<MyVoxelDataRequest> Sandbox.Engine.Voxels.MyPlanetShapeProvider.UnculledRequestHistory = new MyQueue<MyVoxelDataRequest>(MAX_UNCULLED_HISTORY)
static

Definition at line 57 of file MyPlanetShapeProvider.cs.

Property Documentation

bool Sandbox.Engine.Voxels.MyPlanetShapeProvider.Closed
get

Definition at line 160 of file MyPlanetShapeProvider.cs.

string Sandbox.Engine.Voxels.MyPlanetShapeProvider.FormatedUnculledHistory
staticget

Definition at line 62 of file MyPlanetShapeProvider.cs.

MyHeightCubemap Sandbox.Engine.Voxels.MyPlanetShapeProvider.Heightmap
get

Definition at line 269 of file MyPlanetShapeProvider.cs.

float Sandbox.Engine.Voxels.MyPlanetShapeProvider.InnerRadius
get

Definition at line 146 of file MyPlanetShapeProvider.cs.

float Sandbox.Engine.Voxels.MyPlanetShapeProvider.MaxHillHeight
get

Definition at line 256 of file MyPlanetShapeProvider.cs.

float Sandbox.Engine.Voxels.MyPlanetShapeProvider.MinHillHeight
get

Definition at line 248 of file MyPlanetShapeProvider.cs.

float Sandbox.Engine.Voxels.MyPlanetShapeProvider.OuterRadius
get

Definition at line 140 of file MyPlanetShapeProvider.cs.

float Sandbox.Engine.Voxels.MyPlanetShapeProvider.Radius
get

Definition at line 264 of file MyPlanetShapeProvider.cs.


The documentation for this class was generated from the following file: