User:Monster Iestyn/Source Code Documentation/tables.h
Appearance
![]() |
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article. |
Online link | GitHub entry |
---|---|
File type | C header file |
#include guard | __TABLES__
|
Includes
Externs
Data name | Data type | Non-extern location(s) | Description |
---|---|---|---|
finesine[5*FINEANGLES/4]
|
fixed_t
|
t_fsin.c
|
The fine angle-to-sine array used by FINESINE .
|
*finecosine
|
fixed_t
|
tables.c
|
The fine angle-to-cosine array used by FINECOSINE . This is actually used as a pointer to &finesine[FINEANGLES/4] , as it uses the same values as finesine but shifted.
|
finetangent[FINEANGLES/2]
|
fixed_t
|
t_ftan.c
|
The fine angle-to-tangent array used by FINETANGENT .
|
tantoangle[SLOPERANGE+1]
|
angle_t
|
t_tan2a.c
|
The tan/slope value-to-angle array. |
The angle_t type
typedef UINT32 angle_t;
|
|
Fine angles
Macro | Defined as | Description |
---|---|---|
FINEANGLES
|
8192 | The number of fine angles in a full circle. |
FINEMASK
|
FINEANGLES -1
(8191) |
Used to limit integers representing fine angles to values between 0 and 8191.
e.g. |
ANGLETOFINESHIFT
|
19 | The number of bits to shift angle_t down to fine angles, or vice versa.
|
FINEANGLE_C(x)
|
((FixedAngle((x)*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK)
|
Converts an angle in degrees to fine angles |
FINE_FRACBITS
|
16 | The number of fractional bits used by the tables' values in tables.c . This macro is used particularly by the trig function macro definitions in case FRACBITS is not 16.
|
Tangent (slope) values
Macro | Defined as | Description |
---|---|---|
SLOPERANGE
|
2048 | The maximum value a slope value can have. |
SLOPEBITS
|
11 | The number of bits in a slope value. |
DBITS
|
FRACBITS -SLOPEBITS
(5) |
The number of bits to shift fixed_t down to slope values, or vice versa.
|
Trigonometric function macros
Macro | Defined as | Description |
---|---|---|
FINESINE(n)
|
(finesine[n]>>(FINE_FRACBITS-FRACBITS))
|
Returns the sine of the given fine angle, as a fixed_t value
|
FINECOSINE(n)
|
(finecosine[n]>>(FINE_FRACBITS-FRACBITS))
|
Returns the cosine of the given fine angle, as a fixed_t value
|
FINETANGENT(n)
|
(finetangent[n]>>(FINE_FRACBITS-FRACBITS))
|
Returns the tangent (note: shifted forward by 90°) of the given fine angle, as a fixed_t value
|
Functions
Prototypes
Function name | Return type | Params | Defined in | Attributes | Description |
---|---|---|---|---|---|
SlopeDiv
|
unsigned | unsigned num ,unsigned den
|
tables.c
|
FUNCMATH
|
|
SlopeDivEx
|
UINT64 | unsigned int num ,unsigned int den
|
tables.c
|
Only called by R_PointToAngleEx .
| |
AngleFixed
|
fixed_t
|
angle_t af
|
tables.c
|
FUNCMATH
|
|
FixedAngle
|
angle_t
|
fixed_t fa
|
tables.c
|
FUNCMATH
|
|
FixedAngleC
|
angle_t
|
fixed_t fa ,fixed_t factor
|
tables.c
|
FUNCMATH
|
|
FixedAcos
|
angle_t
|
fixed_t x
|
tables.c
|
FUNCMATH
|
|
Fixed point vector functions | |||||
FV2_AngleBetweenVectors
|
angle_t
|
const vector2_t *Vector1 ,const vector2_t *Vector2
|
tables.c
|
Returns the angle between two vectors | |
FV3_AngleBetweenVectors
|
angle_t
|
const vector3_t *Vector1 ,const vector3_t *Vector2
|
tables.c
|
Returns the angle between two vectors | |
FV2_InsidePolygon
|
boolean | const vector2_t *vIntersection ,const vector2_t *Poly ,const INT32 vertexCount
|
tables.c
|
Checks if a point is inside a polygon | |
FV3_InsidePolygon
|
boolean | const vector3_t *vIntersection ,const vector3_t *Poly ,const INT32 vertexCount
|
tables.c
|
Checks if a point is inside a polygon | |
FV3_IntersectedPolygon
|
boolean | const vector3_t *vPoly ,const vector3_t *vLine ,const INT32 vertexCount ,vector3_t *collisionPoint
|
tables.c
|
Checks if a line is intersecting a polygon | |
FV3_Rotate
|
void | vector3_t *rotVec ,const vector3_t *axisVec ,const angle_t angle
|
tables.c
|
Rotates a vector around another vector | |
Fixed point matrix functions | |||||
FM_Rotate
|
void | matrix_t *dest ,angle_t angle ,fixed_t x ,fixed_t y ,fixed_t z
|
tables.c
|
Inline functions
Function name | Return type | Params | Attributes | Description |
---|---|---|---|---|
InvAngle
|
angle_t
|
angle_t a
|
FUNCMATH ,FUNCINLINE ,static ,ATTRINLINE
|