#include "sgl.h"
ANGLE ang;
FIXED slSin( ang )
ANGLE ang - Angle.
FIXED - Sine value for the given angle.
slCos | slTan | slAtan | slSquart |
slSquartFX | slMulFX | slDivFX |
#include "sgl.h"
ANGLE ang;
FIXED slCos( ang )
ANGLE ang - Angle.
FIXED - Cosine value for the given angle.
slSin | slTan | slAtan | slSquart |
slSquartFX | slMulFX | slDivFX |
#include "sgl.h"
ANGLE ang;
FIXED slTan( ang )
ANGLE ang - Angle.
FIXED - Tangent value for the given angle.
slSin | slCos | slAtan | slSquart |
slSquartFX | slMulFX | slDivFX |
#include "sgl.h"
FIXED x_pos, y_pos;
ANGLE slAtan( x_pos, y_pos )
FIXED x_pos - X coordinate value
FIXED y_pos - Y coordinate value
FIXED - Arctangent value for the given vector.
slSin | slCos | slTan | slSquart |
slSquartFX | slMulFX | slDivFX |
#include "sgl.h"
Uint32 val;
Uint16 slSquart( val )
Uint32 val - value.
Uint16 The square root value of the given value, rounded down to the nearest whole number.
slSin | slCos | slTan | slAtan |
slSquartFX | slMulFX | slDivFX |
#include "sgl.h"
FIXED val;
FIXED slSquartFX( val )
FIXED val - value.
FIXED Square root value of the given value.
slSin | slCos | slTan | slAtan |
slSquart | slMulFX | slDivFX |
#include "sgl.h"
FIXED val_a, val_b;
FIXED slMulFX( val_a, val_b )
FIXED val_a, val_b - Fixed decimal values used for multiplication.
FIXED - The result of multiplying the two numbers given as arguments.
slSin | slCos | slTan | slAtan |
slSquart | slSquartFX | slDivFX |
#include "sgl.h"
FIXED val_a, val_b;
FIXED slDivFX( val_a, val_b )
FIXED val_a, val_b - Fixed decimal values used for division.
FIXED - The result of dividing the two numbers given as arguments.
slSin | slCos | slTan | slAtan |
slSquart | slSquartFX | slMulFX |
#include "sgl.h"
VECTOR vct_a, vct_b;
FIXED slInnerProduct( vct_a, vct_b )
VECTOR vct_a, vct_b - Vector used for dot product operation.
FIXED - The result of the dot product operation.
if( slInnerProduct ( normal, eye ) > toFIXED ( 0.0 ) ) {
slPutPolygonX ( ... );
}
slNormal Vector |
#include "sgl.h"
VECTOR vct_a, vct_b, vct_c;
VECTOR ans;
void slNormalVector( vct_a, vct_b, vct_c, ans )
VECTOR vct_a, vct_b, vct_c - 3 points that make up the plane.
VECTOR ans - VECTOR structure for storing calculation results.
void - returns nothing. (However, the normal vector of the calculation result is returned to the ans argument.)
slInnerProduct |
#include "sgl.h"
FIXED slRandom( void )
void - gives nothing.
FIXED - Random value.
FIXED x, y;
x = slMulFX ( slRandom (), toFIXED ( 320 ) );
y = slMulFX ( slRandom (), toFIXED ( 240 ) );
slInitSystem | RandWork |
#include "sgl.h"
VECTOR pnt_a, pnt_b, pnt_c, pnt_d;
VECTOR time;
VECTOR ans;
void slBezier( pnt_a, pnt_b, pnt_c, pnt_d, time, ans )
VECTOR pnt_a, pnt_b, pnt_c, pnt_d - 4 points that make up the Bezier curve.
VECTOR time - When pnt_a is 0.0 and pnt_d is 1.0,
A point whose function value you want to know.
VECTOR ans; - VECTOR structure for storing calculation results.
void - returns nothing. (However, the vector of calculation results is returned to the ans argument.)
#include "sgl.h"
FIXED obj_a[ XYZ ];
FIXED size_a;
FIXED obj_b[ XYZ ];
FIXED size_b;
FIXED slBallCollision( obj_a, size_a, obj_b, size_b )
FIXED obj_a[ XYZ ] - Center coordinates of object A.
FIXED size_a - radius of object A.
FIXED obj_b[ XYZ ] - Center coordinates of object B.
FIXED size_b - radius of object B.
FIXED - If it is correct, returns the distance between the two, otherwise returns a negative number.
FIXED Orig[ XYZ ] = { toFIXED ( 0.0 ), toFIXED ( 0.0 ), toFIXED ( 0.0 ) }
slPushMatrix ();
{
:
slPushMatrix ();
{
:
slConvert3Dto2DFX ( Orig, ans );
if ( slBallCollision ( ans, radius1, obj, radius2 ) < toFIXED ( 0.0 ) ) {
Not Collide
:
} else {
Collide!!
}
#include "sgl.h"
void ( *func )() func;
void *para;
void slSlaveFunc( func, para );
void ( *func )() - the function you want to run on the slave.
void *para - Arguments to give to the function executed on the slave.
void - returns nothing.
void foo() {
:
}
slSlaveFunc ( foo, NULL );