Drag[en]gine Script Module DragonScript Script API  1.0
DEMath Class Reference

Extended math support. More...

Inheritance diagram for DEMath:

Static Public Member Functions

Degrees based replacements for methods from Math.
static float acos (float n)
 Arc cosine of n using degrees. More...
 
static float asin (float n)
 Arc sine of n using degrees. More...
 
static float atan (float n)
 Arc tangense of n using degrees. More...
 
static float atan2 (float y, float x)
 Tangense of y/x using degrees. More...
 
static float cos (float x)
 Cosine of value x using degrees. More...
 
static float cosh (float x)
 Hyperbolic cosine of value x using degrees. More...
 
static float sin (float x)
 Sinus using degrees. More...
 
static float sinh (float x)
 Hyperbolic sinus using degrees. More...
 
static float tan (float x)
 Tangense using degrees. More...
 
static float tanh (float x)
 Hhyperbolic tangense using degrees. More...
 
Helper methods.
static float degToRad (float degrees)
 Convert degrees to radians. More...
 
static float radToDeg (float radians)
 Converst radians to degrees. More...
 
static float linearStep (float x, float lower, float upper)
 Linear step function clamping normalized x linearly to the range from 0 to 1. More...
 
static float linearStep (float x, float lower, float upper, float mapLower, float mapUpper)
 Linear step function clamping normalized x linearly to a new range. More...
 
static float smoothStep (float x, float lower, float upper)
 GLSL type smooth step into the range from 0 to 1. More...
 
static float smoothStep (float x, float lower, float upper, float mapLower, float mapUpper)
 GLSL type smooth step into a new rage. More...
 
static float normalize (float x, float lower, float upper)
 Normalize value into a range using wrapping around at the limits. More...
 
static float normalize (float x, float upper)
 Normalize value into a range starting at 0 using wrapping around at the limits. More...
 
static float mix (float a, float b, float blend)
 GLSL type mix. More...
 
static float random ()
 Random float between 0 and 1 inclusive. More...
 
static int random (int lower, int upper)
 Random integer from range. More...
 
static float random (float lower, float upper)
 Random float from range. More...
 
static bool probability (float threshold)
 Random value in the range from 0 to 1 inclusive is less than a propability threshold. More...
 

Detailed Description

Extended math support.

Extends Math from Math package from base DragonScript.

Overwrites trigonometric methods to operate on degrees instead of radians. To use radians version use Math directly.

Furthermore adds some additional methods useful for game development.

This is a native class. This class is for static use only and can not instanciated but subclassed.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ acos()

static float acos ( float  n)
static

Arc cosine of n using degrees.

§ asin()

static float asin ( float  n)
static

Arc sine of n using degrees.

§ atan()

static float atan ( float  n)
static

Arc tangense of n using degrees.

§ atan2()

static float atan2 ( float  y,
float  x 
)
static

Tangense of y/x using degrees.

§ cos()

static float cos ( float  x)
static

Cosine of value x using degrees.

§ cosh()

static float cosh ( float  x)
static

Hyperbolic cosine of value x using degrees.

§ degToRad()

static float degToRad ( float  degrees)
static

Convert degrees to radians.

§ linearStep() [1/2]

static float linearStep ( float  x,
float  lower,
float  upper 
)
static

Linear step function clamping normalized x linearly to the range from 0 to 1.

§ linearStep() [2/2]

static float linearStep ( float  x,
float  lower,
float  upper,
float  mapLower,
float  mapUpper 
)
static

Linear step function clamping normalized x linearly to a new range.

§ mix()

static float mix ( float  a,
float  b,
float  blend 
)
static

GLSL type mix.

§ normalize() [1/2]

static float normalize ( float  x,
float  lower,
float  upper 
)
static

Normalize value into a range using wrapping around at the limits.

§ normalize() [2/2]

static float normalize ( float  x,
float  upper 
)
static

Normalize value into a range starting at 0 using wrapping around at the limits.

Same as normalize(x, 0.0, upper).

§ probability()

static bool probability ( float  threshold)
static

Random value in the range from 0 to 1 inclusive is less than a propability threshold.

§ radToDeg()

static float radToDeg ( float  radians)
static

Converst radians to degrees.

§ random() [1/3]

static float random ( )
static

Random float between 0 and 1 inclusive.

§ random() [2/3]

static int random ( int  lower,
int  upper 
)
static

Random integer from range.

§ random() [3/3]

static float random ( float  lower,
float  upper 
)
static

Random float from range.

§ sin()

static float sin ( float  x)
static

Sinus using degrees.

§ sinh()

static float sinh ( float  x)
static

Hyperbolic sinus using degrees.

§ smoothStep() [1/2]

static float smoothStep ( float  x,
float  lower,
float  upper 
)
static

GLSL type smooth step into the range from 0 to 1.

§ smoothStep() [2/2]

static float smoothStep ( float  x,
float  lower,
float  upper,
float  mapLower,
float  mapUpper 
)
static

GLSL type smooth step into a new rage.

§ tan()

static float tan ( float  x)
static

Tangense using degrees.

§ tanh()

static float tanh ( float  x)
static

Hhyperbolic tangense using degrees.


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