C# Class VoxelTerrain.Helper

Defines a class with various helper functions.
Afficher le fichier Open project: barograf/VoxelTerrain

Méthodes publiques

Méthode Description
Clamp ( float value, float min, float max ) : float

Restricts a value to be within a specified range.

Lerp ( float x, float y, float s ) : float

Performs a linear interpolation.

MouseDirection ( Device graphicsDevice, Camera camera, System.Vector2 mousePosition ) : System.Vector3

Computes a mouse direction in world coordinates.

Saturate ( float value ) : float

Restricts a value to be within a zero to one range.

Method Details

Clamp() public static méthode

Restricts a value to be within a specified range.
public static Clamp ( float value, float min, float max ) : float
value float The value to clamp.
min float The minimum value.
max float The maximum value.
Résultat float

Lerp() public static méthode

Performs a linear interpolation.
public static Lerp ( float x, float y, float s ) : float
x float First parameter.
y float Second parameter.
s float A value that linearly interpolates between parameters.
Résultat float

MouseDirection() public static méthode

Computes a mouse direction in world coordinates.
public static MouseDirection ( Device graphicsDevice, Camera camera, System.Vector2 mousePosition ) : System.Vector3
graphicsDevice Device Virtual adapter used to perform rendering.
camera Camera Allows observing the scene with the mouse and keyboard.
mousePosition System.Vector2 Position of a mouse in screen coordinates.
Résultat System.Vector3

Saturate() public static méthode

Restricts a value to be within a zero to one range.
public static Saturate ( float value ) : float
value float The value to saturate.
Résultat float