C# 클래스 VoxelTerrain.Helper

Defines a class with various helper functions.
파일 보기 프로젝트 열기: barograf/VoxelTerrain

공개 메소드들

메소드 설명
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.

메소드 상세

Clamp() 공개 정적인 메소드

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.
리턴 float

Lerp() 공개 정적인 메소드

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.
리턴 float

MouseDirection() 공개 정적인 메소드

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.
리턴 System.Vector3

Saturate() 공개 정적인 메소드

Restricts a value to be within a zero to one range.
public static Saturate ( float value ) : float
value float The value to saturate.
리턴 float