Functions | |
int | rsRand (int max_value) |
int | rsRand (int min_value, int max_value) |
float | rsRand (float max_value) |
float | rsRand (float min_value, float max_value) |
float | rsFrac (float) |
uint | rsClamp (uint amount, uint low, uint high) |
int | rsClamp (int amount, int low, int high) |
ushort | rsClamp (ushort amount, ushort low, ushort high) |
short | rsClamp (short amount, short low, short high) |
uchar | rsClamp (uchar amount, uchar low, uchar high) |
char | rsClamp (char amount, char low, char high) |
static __inline__ void | rsExtractFrustumPlanes (const rs_matrix4x4 *viewProj, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far) |
static __inline__ bool | rsIsSphereInFrustum (float4 *sphere, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far) |
uchar4 | rsPackColorTo8888 (float r, float g, float b) |
uchar4 | rsPackColorTo8888 (float r, float g, float b, float a) |
uchar4 | rsPackColorTo8888 (float3 color) |
float4 | rsUnpackColor8888 (uchar4 c) |
todo-jsams
Definition in file rs_math.rsh.
Clamp the value amount between low and high.
amount | The value to clamp |
low | |
high |
int rsClamp | ( | int | amount, |
int | low, | ||
int | high | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
short rsClamp | ( | short | amount, |
short | low, | ||
short | high | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
char rsClamp | ( | char | amount, |
char | low, | ||
char | high | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
static __inline__ void rsExtractFrustumPlanes | ( | const rs_matrix4x4 * | viewProj, |
float4 * | left, | ||
float4 * | right, | ||
float4 * | top, | ||
float4 * | bottom, | ||
float4 * | near, | ||
float4 * | far | ||
) | [static] |
Computes 6 frustum planes from the view projection matrix
viewProj | matrix to extract planes from |
left | plane |
right | plane |
top | plane |
bottom | plane |
near | plane |
far | plane |
Definition at line 102 of file rs_math.rsh.
float rsFrac | ( | float | ) |
Returns the fractional part of a float
static __inline__ bool rsIsSphereInFrustum | ( | float4 * | sphere, |
float4 * | left, | ||
float4 * | right, | ||
float4 * | top, | ||
float4 * | bottom, | ||
float4 * | near, | ||
float4 * | far | ||
) | [static] |
Checks if a sphere is withing the 6 frustum planes
sphere | float4 representing the sphere |
left | plane |
right | plane |
top | plane |
bottom | plane |
near | plane |
far | plane |
Definition at line 162 of file rs_math.rsh.
uchar4 rsPackColorTo8888 | ( | float | r, |
float | g, | ||
float | b | ||
) |
Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).
r | |
g | |
b |
uchar4 rsPackColorTo8888 | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Pack floating point (0-1) RGBA values into a uchar4.
r | |
g | |
b | |
a |
Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).
color |
Pack floating point (0-1) RGBA values into a uchar4.
color |
int rsRand | ( | int | max_value | ) |
Return a random value between 0 (or min_value) and max_malue.
int rsRand | ( | int | min_value, |
int | max_value | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
float rsRand | ( | float | max_value | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
float rsRand | ( | float | min_value, |
float | max_value | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.