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) |
_RS_RUNTIME uint | rsClamp (uint amount, uint low, uint high) |
_RS_RUNTIME int | rsClamp (int amount, int low, int high) |
_RS_RUNTIME ushort | rsClamp (ushort amount, ushort low, ushort high) |
_RS_RUNTIME short | rsClamp (short amount, short low, short high) |
_RS_RUNTIME uchar | rsClamp (uchar amount, uchar low, uchar high) |
_RS_RUNTIME 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) |
_RS_RUNTIME uchar4 | rsPackColorTo8888 (float r, float g, float b) |
_RS_RUNTIME uchar4 | rsPackColorTo8888 (float r, float g, float b, float a) |
_RS_RUNTIME uchar4 | rsPackColorTo8888 (float3 color) |
_RS_RUNTIME 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 |
_RS_RUNTIME 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.
_RS_RUNTIME 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.
_RS_RUNTIME 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.
_RS_RUNTIME 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 |
_RS_RUNTIME 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.