src/system/system_matrix.c
The 3D transform, its stack, the look-at matrix and the projection. More…
Included by system.c.
Macros
| Name | Description | |
|---|---|---|
#define | MATRIX_DMA (DMA_COPY_WORDS(MATRIX_WORDS)) | one matrix |
#define | RECIPROCAL_SHIFT 15 | syMatrixBuildLookAt's reciprocals divide toFIXED(1) << RECIPROCAL_SHIFT, 2^31, the most a Uint32 holds: the quotient shifted right by RECIPROCAL_SHIFT is toFIXED(1) over a whole-number divisor, and doubled it is the 16.16 reciprocal of a 16.16 divisor. |
#define | PROJECTION_DEPTH_SHIFT 11 | syConvert3Dto2D's depth drops its low PROJECTION_DEPTH_SHIFT bits, and the focal length gains the rest of toFIXED(1)'s, so that the focal length over the depth comes out in 16.16 within 32 bits. |
#define | COS (a) sySin((a) + DEGtoANG(90)) | The cosine: the sine a quarter turn on. |
#define | sySquartFX (v) (sySquartIWRAM(v) << 8) | sySquartFX written in place, as syMatrixBuildLookAt takes it. |
Typedefs
| Name | Description | |
|---|---|---|
typedef Sint32 (* | DOT_PRODUCT_ROUTINE )( Sint32 ax, Sint32 bx, Sint32 ay, Sint32 by, Sint32 az, Sint32 bz); | The dot product of (ax, ay, az) and (bx, by, bz), in 16.16 (RelocatedInnerProduct, run from a copy on the stack). |
Functions
| Name | Description | |
|---|---|---|
void | syRenderNoOperationHook (void) | An empty function. |
void | syInitMatrix (void) | Allocates the one-level save area (heap slot HEAP_SLOT_MATRIX_STACK), clears MatrixStackDepth and resets CurrentMatrix to the unit matrix. |
void | syMatrixRewindStack (void) | Empties the matrix stack: the next syPushMatrix saves at the start of its save area again. |
void | syPushMatrix (void) | Saves CurrentMatrix into the save area (one level deep; a second save is ignored). |
void | syGetMatrix (MATRIX dest) | Copies CurrentMatrix to dest. |
void | syLoadMatrix (const MATRIX src) | Copies the matrix at src into CurrentMatrix. |
void | syPopMatrix (void) | Restores CurrentMatrix from the save area, if syPushMatrix saved it. |
void | syUnitMatrixCurrent (void) | Resets CurrentMatrix to the unit matrix. |
void | syMatrixRotate (Sint32 *angles) | Rotates CurrentMatrix by angles[0], angles[1] and angles[2] about the X, Y and Z axes, in that order, with one combined matrix. |
void | syRotX (ANGLE angle) | Rotates CurrentMatrix about the X axis by angle. |
void | syRotY (ANGLE angle) | Rotates CurrentMatrix about the Y axis by angle. |
void | syMatrixSetRotateY (ANGLE angle) | Makes CurrentMatrix a rotation about the Y axis by angle. |
void | syRotZ (ANGLE angle) | Rotates CurrentMatrix about the Z axis by angle. |
void | syMatrixTranslateVector (const POINT pos) | Translates CurrentMatrix by pos (x, y, z in 16.16). |
void | syTranslate (FIXED x, FIXED y, FIXED z) | Translates CurrentMatrix by x, y and z in 16.16. |
void | syMatrixSetTranslation (const POINT pos) | Sets CurrentMatrix's translation to pos. |
void | syMatrixScaleVector (const VECTOR scale) | Scales CurrentMatrix by scale (x, y, z factors in 16.16). |
void | syScale (FIXED x, FIXED y, FIXED z) | Scales CurrentMatrix by x, y and z in 16.16. |
void | syMatrixScaleUniform (FIXED scale) | Scales CurrentMatrix by scale on all three axes. |
void | syMatrixRotateTranslate (Sint32 *angles, POINT pos) | Rotates CurrentMatrix by angles and translates it by pos in one matrix. |
void | syMatrixRotateTranslateScale (Sint32 *angles, POINT pos, VECTOR scale) | Rotates by angles, scales each rotation row by scale and translates by pos, in one matrix. |
void | syMatrixBuildLookAt (POINT eye, POINT target, MATRIX out) | Builds in out the camera matrix of an eye at eye looking at target. |
void | syLookAtLoad (POINT eye, POINT target) | Makes the camera at eye looking at target the whole of CurrentMatrix. |
void | syLookAt (POINT eye, POINT target) | Multiplies the camera at eye looking at target into CurrentMatrix. |
void | syPerspective (Sint32 fieldOfView, FIXED nearDepth, FIXED farDepth) | Sets the projection from a vertical field of view (1/65536 turns): the focal length, in 16.16 pixels, is half the screen's height over the tangent of half the angle. |
void | sySetScreenDist (Uint32 focal, Uint32 nearDepth, Uint32 farDepth) | Sets the projection's focal length and depth range directly. |
Sint32 | syConvert3Dto2D (const POINT point, PROJECTED_POINT *screen) | Transforms point by CurrentMatrix and projects it onto the screen into screen, returning the scale at its depth; a point outside the near and far depths keeps its view coordinates and returns 0. |
Description
The 3D transform, its stack, the look-at matrix and the projection. Part of
system.c.
Macros in detail
MATRIX_DMA
#define MATRIX_DMA (DMA_COPY_WORDS(MATRIX_WORDS))
one matrix
Referenced by syGetMatrix(), syLoadMatrix(), syPopMatrix() and syPushMatrix().
Definition at line 9 of file system_matrix.c.
RECIPROCAL_SHIFT
#define RECIPROCAL_SHIFT 15
syMatrixBuildLookAt's reciprocals divide toFIXED(1) << RECIPROCAL_SHIFT,
2^31, the most a Uint32 holds: the quotient shifted right by RECIPROCAL_SHIFT
is toFIXED(1) over a whole-number divisor, and doubled it is the 16.16
reciprocal of a 16.16 divisor.
Referenced by syMatrixBuildLookAt().
Definition at line 15 of file system_matrix.c.
PROJECTION_DEPTH_SHIFT
#define PROJECTION_DEPTH_SHIFT 11
syConvert3Dto2D's depth drops its low PROJECTION_DEPTH_SHIFT bits, and the
focal length gains the rest of toFIXED(1)'s, so that the focal length over
the depth comes out in 16.16 within 32 bits.
Referenced by syConvert3Dto2D().
Definition at line 20 of file system_matrix.c.
COS
#define COS(a) sySin((a) + DEGtoANG(90))
The cosine: the sine a quarter turn on.
Referenced by syMatrixRotate(), syMatrixRotateTranslate(), syMatrixRotateTranslateScale(), syMatrixSetRotateY(), syPerspective(), syRotX(), syRotY() and syRotZ().
Definition at line 23 of file system_matrix.c.
sySquartFX
#define sySquartFX(v) (sySquartIWRAM(v) << 8)
sySquartFX written in place, as syMatrixBuildLookAt takes it.
Referenced by btElementGlowUpdateStarField(), fdActorFlyOnWorldMap(), fdActorMoveAsSand(), fdActorMoveAsSandOnWorldMap(), fdActorMoveOnWorldMap(), fdActorSailOnMap(), fdActorSailOnWorldMap(), fdActorSetMoveTarget(), fdActorUpdateAllOnField(), fdActorUpdatePlayerControl(), fdCameraFollowLeaderInBounds(), fdCameraFollowWatchedInBounds(), fdMapScreenUpdateMarkers(), fdMapScreenUpdateScroll(), fdParticleUpdateMotion() and syMatrixBuildLookAt().
Definition at line 327 of file system_matrix.c.
Typedefs in detail
DOT_PRODUCT_ROUTINE
typedef Sint32 (*DOT_PRODUCT_ROUTINE)( Sint32 ax, Sint32 bx, Sint32 ay, Sint32 by, Sint32 az, Sint32 bz);
The dot product of (ax, ay, az) and (bx, by, bz), in 16.16
(RelocatedInnerProduct, run from a copy on the stack).
Referenced by syMatrixBuildLookAt().
Definition at line 6 of file system_matrix.c.
Functions in detail
syRenderNoOperationHook
void syRenderNoOperationHook(void)
An empty function.
Definition at line 26 of file system_matrix.c.
syInitMatrix
void syInitMatrix(void)
Allocates the one-level save area (heap slot HEAP_SLOT_MATRIX_STACK), clears
MatrixStackDepth and resets CurrentMatrix to the unit matrix.
References CurrentMatrix, MatrixStackDepth, MatrixStackTop, syHeapSlotAllocateEWRAM() and syUnitMatrixCurrentInline().
Referenced by btCameraApplyTransform(), btCameraSetCommandView(), btCameraSetDefaultView(), btCameraSetView(), btCameraSetViewAtDepth(), btEffectDrawStreaks(), btEffectRunAtalanta(), btEffectRunAzul(), btEffectRunBallLightning(), btEffectRunBind(), btEffectRunBoreas(), btEffectRunBreaths(), btEffectRunBurstShower(), btEffectRunCards(), btEffectRunCastingImpact(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCriticalHit(), btEffectRunCruelRuin(), btEffectRunCrystal(), btEffectRunDaedalus(), btEffectRunDaedalusStrike(), btEffectRunDeathPlunge(), btEffectRunDiamondBerg(), btEffectRunDjinnHeal(), btEffectRunDjinniCharge(), btEffectRunDjinniEntrance(), btEffectRunDjinniSign(), btEffectRunDragonCloud(), btEffectRunEclipse(), btEffectRunElementCards(), btEffectRunElementPillar(), btEffectRunFirePuppet(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunFrost(), btEffectRunFume(), btEffectRunGaspFamily(), btEffectRunGeode(), btEffectRunGeyser(), btEffectRunHaures(), btEffectRunHealingMotes(), btEffectRunHeavyBlow(), btEffectRunIris(), btEffectRunJudgment(), btEffectRunJuggle(), btEffectRunLeapingStrike(), btEffectRunLegend(), btEffectRunLifeShear() and 45 more.
Definition at line 32 of file system_matrix.c.
syMatrixRewindStack
void syMatrixRewindStack(void)
Empties the matrix stack: the next syPushMatrix saves at the start of its
save area again.
References MatrixStackDepth and MatrixStackTop.
Referenced by btCameraUpdate() and fdActorSystemProjectSprites().
Definition at line 42 of file system_matrix.c.
syPushMatrix
void syPushMatrix(void)
Saves CurrentMatrix into the save area (one level deep; a second save is
ignored).
References CurrentMatrix, MatrixStackDepth, MatrixStackTop and syDMAXCopy().
Referenced by btEffectRunAstralBlast(), btEffectRunCatastrophe(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunGaspFamily(), btEffectRunLifeShear(), btEffectRunNirvana(), btEffectRunRisingDragonEnemy(), btEffectRunSerac(), btEffectRunStarSwarm(), btEffectRunSwirlingStars() and btEffectRunTwistingColumn().
Definition at line 50 of file system_matrix.c.
syGetMatrix
void syGetMatrix(MATRIX dest)
Copies CurrentMatrix to dest.
References CurrentMatrix and syDMAXCopy().
Referenced by btEffectRunAtalanta().
Definition at line 61 of file system_matrix.c.
syLoadMatrix
void syLoadMatrix(const MATRIX src)
Copies the matrix at src into CurrentMatrix.
References CurrentMatrix and syDMAXCopy().
Referenced by btEffectRunAtalanta().
Definition at line 67 of file system_matrix.c.
syPopMatrix
void syPopMatrix(void)
Restores CurrentMatrix from the save area, if syPushMatrix saved it.
References CurrentMatrix, MatrixStackDepth, MatrixStackTop and syDMAXCopy().
Referenced by btEffectRunAstralBlast(), btEffectRunCatastrophe(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunGaspFamily(), btEffectRunLifeShear(), btEffectRunNirvana(), btEffectRunRisingDragonEnemy(), btEffectRunSerac(), btEffectRunStarSwarm(), btEffectRunSwirlingStars() and btEffectRunTwistingColumn().
Definition at line 73 of file system_matrix.c.
syUnitMatrixCurrent
void syUnitMatrixCurrent(void)
Resets CurrentMatrix to the unit matrix. Reached through the stub call table.
References syUnitMatrixCurrentInline().
Referenced by btEffectRunIris().
Definition at line 84 of file system_matrix.c.
syMatrixRotate
void syMatrixRotate(Sint32 *angles)
Rotates CurrentMatrix by angles[0], angles[1] and angles[2] about the X, Y
and Z axes, in that order, with one combined matrix.
References Sint32, syMultiMatrix() and sySin().
Definition at line 91 of file system_matrix.c.
syRotX
void syRotX(ANGLE angle)
Rotates CurrentMatrix about the X axis by angle.
References syMatrixStoreUnit(), syMultiMatrix() and sySin().
Referenced by btCameraSetCommandView(), btCameraSetDefaultView(), btCameraSetView(), btCameraSetViewAtDepth(), btCameraUpdate(), btEffectDrawStreaks(), btEffectRunAtalanta(), btEffectRunAzul(), btEffectRunBreaths(), btEffectRunCards(), btEffectRunCastingImpact(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCriticalHit(), btEffectRunCruelRuin(), btEffectRunCrystal(), btEffectRunDaedalus(), btEffectRunDeathPlunge(), btEffectRunDiamondBerg(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunDjinniSign(), btEffectRunEclipse(), btEffectRunElementCards(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunGaspFamily(), btEffectRunGeode(), btEffectRunGeyser(), btEffectRunHaunt(), btEffectRunHaures(), btEffectRunHealingMotes(), btEffectRunJudgment(), btEffectRunJuggle(), btEffectRunLeapingStrike(), btEffectRunLegend(), btEffectRunLiquifier(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunMoloch(), btEffectRunNirvana(), btEffectRunOdyssey(), btEffectRunRadiantFire(), btEffectRunRagingHeat(), btEffectRunSerac(), btEffectRunStarSwarm(), btEffectRunStatBoost(), btEffectRunSwirlingStars(), btEffectRunTargetMotes() and 15 more.
Definition at line 121 of file system_matrix.c.
syRotY
void syRotY(ANGLE angle)
Rotates CurrentMatrix about the Y axis by angle.
References syMatrixStoreUnit(), syMultiMatrix() and sySin().
Referenced by btCameraSetCommandView(), btCameraSetDefaultView(), btCameraSetView(), btCameraSetViewAtDepth(), btEffectDrawStreaks(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunAzul(), btEffectRunBind(), btEffectRunBreaths(), btEffectRunCards(), btEffectRunCastingImpact(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCriticalHit(), btEffectRunCruelRuin(), btEffectRunCrystal(), btEffectRunDiamondBerg(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunDjinniSign(), btEffectRunEclipse(), btEffectRunElementCards(), btEffectRunFirePuppet(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunFume(), btEffectRunGaspFamily(), btEffectRunGeode(), btEffectRunHaures(), btEffectRunHealingMotes(), btEffectRunHeavyBlow(), btEffectRunJudgment(), btEffectRunJuggle(), btEffectRunLeapingStrike(), btEffectRunLegend(), btEffectRunLifeShear(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunOdyssey(), btEffectRunProcne(), btEffectRunRagingHeat(), btEffectRunRisingDragon(), btEffectRunRisingDragonEnemy(), btEffectRunRushingStrike(), btEffectRunStarfieldFall(), btEffectRunStarSwarm(), btEffectRunStatBoost(), btEffectRunSwirlingStars(), btEffectRunTargetMotes() and 12 more.
Definition at line 138 of file system_matrix.c.
syMatrixSetRotateY
void syMatrixSetRotateY(ANGLE angle)
Makes CurrentMatrix a rotation about the Y axis by angle.
References CurrentMatrix, syMatrixStoreUnit() and sySin().
Referenced by btCameraUpdate().
Definition at line 155 of file system_matrix.c.
syRotZ
void syRotZ(ANGLE angle)
Rotates CurrentMatrix about the Z axis by angle.
References syMatrixStoreUnit(), syMultiMatrix() and sySin().
Referenced by btEffectDrawStreaks(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunAzul(), btEffectRunBallLightning(), btEffectRunBind(), btEffectRunBreaths(), btEffectRunCards(), btEffectRunCastingImpact(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCriticalHit(), btEffectRunCruelRuin(), btEffectRunDaedalus(), btEffectRunDaedalusStrike(), btEffectRunDeathPlunge(), btEffectRunDiamondBerg(), btEffectRunDjinnHeal(), btEffectRunDjinniCharge(), btEffectRunDjinniEntrance(), btEffectRunEclipse(), btEffectRunElementCards(), btEffectRunFirePuppet(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunFume(), btEffectRunGaspFamily(), btEffectRunHaures(), btEffectRunHealingMotes(), btEffectRunHeavyBlow(), btEffectRunIris(), btEffectRunJudgment(), btEffectRunJuggle(), btEffectRunLeapingStrike(), btEffectRunLegend(), btEffectRunLifeShear(), btEffectRunLiquifier(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunNirvana(), btEffectRunProcne(), btEffectRunRadiantFire(), btEffectRunRisingDragon(), btEffectRunRisingDragonEnemy(), btEffectRunSabreDance(), btEffectRunSerac(), btEffectRunStarfieldFall(), btEffectRunStarSwarm(), btEffectRunStatBoost() and 9 more.
Definition at line 171 of file system_matrix.c.
syMatrixTranslateVector
void syMatrixTranslateVector(const POINT pos)
Translates CurrentMatrix by pos (x, y, z in 16.16).
References syMatrixStoreUnit() and syMultiMatrix().
Referenced by btCameraSetCommandView(), btCameraSetDefaultView(), btCameraSetView(), btCameraSetViewAtDepth(), btEffectRunAstralBlast(), btEffectRunDjinnBeams(), btEffectRunDjinnHeal(), btEffectRunDjinniCharge(), btEffectRunDjinniEntrance(), btEffectRunFrost(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunIris(), btEffectRunMeteorBlow(), btEffectRunProcne(), btEffectRunSleep(), btEffectRunStarfieldFall(), btEffectRunStarSwarm(), btEffectRunStatBoost(), btEffectRunStatReduction(), btEffectRunSwirlingStars(), btEffectRunTargetBursts(), btEffectRunTargetMotes(), btEffectRunThor(), btEffectRunTwistingColumn(), btIrisDrawPillar(), fdCameraResetViewDefaults(), fdSuperLuckyDiceResetViewDefaults(), fdWorldMapInitPerspective() and fdWorldMapUpdateView().
Definition at line 188 of file system_matrix.c.
syTranslate
void syTranslate(FIXED x, FIXED y, FIXED z)
Translates CurrentMatrix by x, y and z in 16.16.
References syMatrixStoreUnit() and syMultiMatrix().
Referenced by btEffectRunAzul(), btEffectRunBallLightning(), btEffectRunBreaths(), btEffectRunCards(), btEffectRunCastingImpact(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCruelRuin(), btEffectRunCrystal(), btEffectRunDaedalus(), btEffectRunDaedalusStrike(), btEffectRunDeathPlunge(), btEffectRunDiamondBerg(), btEffectRunDjinniCharge(), btEffectRunDjinniSign(), btEffectRunEclipse(), btEffectRunElementCards(), btEffectRunFirePuppet(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunFume(), btEffectRunGaspFamily(), btEffectRunGeode(), btEffectRunGeyser(), btEffectRunHaures(), btEffectRunHeavyBlow(), btEffectRunJudgment(), btEffectRunJuggle(), btEffectRunLeapingStrike(), btEffectRunLegend(), btEffectRunLifeShear(), btEffectRunLightSurge(), btEffectRunLiquifier(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunMirroredWall(), btEffectRunMoloch(), btEffectRunNirvana(), btEffectRunOdyssey(), btEffectRunRadiantFire(), btEffectRunRagingHeat(), btEffectRunRisingDragon(), btEffectRunRisingDragonEnemy(), btEffectRunRushingStrike(), btEffectRunSabreDance(), btEffectRunSerac(), btEffectRunTargetStrike(), btEffectRunTrident(), btEffectRunTripleChomp() and 7 more.
Definition at line 200 of file system_matrix.c.
syMatrixSetTranslation
void syMatrixSetTranslation(const POINT pos)
Sets CurrentMatrix's translation to pos.
References CurrentMatrix.
Referenced by btCameraUpdate().
Definition at line 212 of file system_matrix.c.
syMatrixScaleVector
void syMatrixScaleVector(const VECTOR scale)
Scales CurrentMatrix by scale (x, y, z factors in 16.16).
References syMatrixStoreUnit() and syMultiMatrix().
Referenced by btEffectRunAstralBlast(), btEffectRunBind(), btEffectRunIris(), btEffectRunThor() and btEffectRunUnusedTriangleStrike().
Definition at line 220 of file system_matrix.c.
syScale
void syScale(FIXED x, FIXED y, FIXED z)
Scales CurrentMatrix by x, y and z in 16.16.
References syMatrixStoreUnit() and syMultiMatrix().
Referenced by btEffectRunAzul(), btEffectRunBallLightning(), btEffectRunBreaths(), btEffectRunCards(), btEffectRunCastingImpact(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCruelRuin(), btEffectRunDaedalusStrike(), btEffectRunDeathPlunge(), btEffectRunDiamondBerg(), btEffectRunDjinniCharge(), btEffectRunDjinniSign(), btEffectRunEclipse(), btEffectRunElementCards(), btEffectRunFirePuppet(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunFume(), btEffectRunGaspFamily(), btEffectRunGeode(), btEffectRunGeyser(), btEffectRunHaures(), btEffectRunHeavyBlow(), btEffectRunLeapingStrike(), btEffectRunLegend(), btEffectRunLifeShear(), btEffectRunLightSurge(), btEffectRunLiquifier(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunMoloch(), btEffectRunOdyssey(), btEffectRunRagingHeat(), btEffectRunRisingDragon(), btEffectRunRisingDragonEnemy(), btEffectRunRushingStrike(), btEffectRunSerac(), btEffectRunTargetStrike(), btEffectRunTrident(), btEffectRunTripleChomp(), btEffectRunTumblingQuads(), btEffectRunTwistingColumn(), btEffectRunWaterSheet(), btEffectRunWindFunnel(), btEffectRunWyrdCurse() and btEffectRunZagan().
Definition at line 232 of file system_matrix.c.
syMatrixScaleUniform
void syMatrixScaleUniform(FIXED scale)
Scales CurrentMatrix by scale on all three axes.
References syMatrixStoreUnit() and syMultiMatrix().
Referenced by btEffectRunAzul(), btEffectRunCards(), btEffectRunCastingImpact(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCrystal(), btEffectRunDaedalus(), btEffectRunDiamondBerg(), btEffectRunDjinniCharge(), btEffectRunEclipse(), btEffectRunElementCards(), btEffectRunFirePuppet(), btEffectRunFlora(), btEffectRunFume(), btEffectRunGaspFamily(), btEffectRunHaures(), btEffectRunJudgment(), btEffectRunLeapingStrike(), btEffectRunLegend(), btEffectRunLifeShear(), btEffectRunMegiddo(), btEffectRunMirroredWall(), btEffectRunRadiantFire(), btEffectRunRagingHeat(), btEffectRunRisingDragon(), btEffectRunRisingDragonEnemy(), btEffectRunSabreDance(), btEffectRunSerac(), btEffectRunTripleChomp(), btEffectRunTwistingColumn(), btEffectRunUlysses() and btEffectRunWaterSheet().
Definition at line 244 of file system_matrix.c.
syMatrixRotateTranslate
void syMatrixRotateTranslate(Sint32 *angles, POINT pos)
Rotates CurrentMatrix by angles and translates it by pos in one matrix.
Reached through the stub table.
References Sint32, syMultiMatrix() and sySin().
Definition at line 257 of file system_matrix.c.
syMatrixRotateTranslateScale
void syMatrixRotateTranslateScale(Sint32 *angles, POINT pos, VECTOR scale)
Rotates by angles, scales each rotation row by scale and translates by
pos, in one matrix.
References Sint32, syMultiMatrix() and sySin().
Definition at line 288 of file system_matrix.c.
syMatrixBuildLookAt
void syMatrixBuildLookAt(POINT eye, POINT target, MATRIX out)
Builds in out the camera matrix of an eye at eye looking at target. The
camera's sideways axis is kept level (no Y component).
References RelocatedInnerProduct, Sint32, syDMAXCopy(), sySquartFX() and sySquartIWRAM().
Referenced by syLookAt() and syLookAtLoad().
Definition at line 331 of file system_matrix.c.
syLookAtLoad
void syLookAtLoad(POINT eye, POINT target)
Makes the camera at eye looking at target the whole of CurrentMatrix.
References CurrentMatrix and syMatrixBuildLookAt().
Referenced by btCameraApplyTransform(), btCameraSetView(), btCameraSetViewAtDepth(), btEffectRunBind(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCrystal(), btEffectRunDjinnHeal(), btEffectRunDjinniCharge(), btEffectRunDjinniEntrance(), btEffectRunDragonCloud(), btEffectRunElementPillar(), btEffectRunGaspFamily(), btEffectRunHealingMotes(), btEffectRunLightSurge(), btEffectRunNirvana(), btEffectRunProjectileVolley(), btEffectRunRadiantFire(), btEffectRunRushingStrike(), btEffectRunSerac(), btEffectRunSleep(), btEffectRunSoulShatter(), btEffectRunStarSwarm(), btEffectRunTargetMotes(), btEffectRunTargetStrike(), btEffectRunTwistingColumn(), btEffectRunUnusedTriangleStrike(), btEffectRunVoidBeam(), btEffectRunWindFunnel(), btStagingDispatchAction(), fdActorSystemProjectSprites(), fdLuckyDiceRun(), fdSuperLuckyDiceRun(), fdWorldMapInitPerspective() and fdWorldMapUpdateView().
Definition at line 412 of file system_matrix.c.
syLookAt
void syLookAt(POINT eye, POINT target)
Multiplies the camera at eye looking at target into CurrentMatrix.
References syMatrixBuildLookAt() and syMultiMatrix().
Referenced by btCameraApplyTransform() and fdActorSystemProjectSprites().
Definition at line 418 of file system_matrix.c.
syPerspective
void syPerspective(Sint32 fieldOfView, FIXED nearDepth, FIXED farDepth)
Sets the projection from a vertical field of view (1/65536 turns): the focal length, in 16.16 pixels, is half the screen's height over the tangent of half the angle.
References ProjectionWork, Sint32, syDivFX() and sySin().
Definition at line 429 of file system_matrix.c.
sySetScreenDist
void sySetScreenDist(Uint32 focal, Uint32 nearDepth, Uint32 farDepth)
Sets the projection's focal length and depth range directly.
References ProjectionWork.
Referenced by btCameraSetCommandView(), btCameraSetView(), btCameraSetViewAtDepth(), btEffectRunThor(), btStagingDispatchAction(), fdCameraResetViewDefaults(), fdSuperLuckyDiceResetViewDefaults(), fdWorldMapInitPerspective() and fdWorldMapUpdateView().
Definition at line 444 of file system_matrix.c.
syConvert3Dto2D
Sint32 syConvert3Dto2D(const POINT point, PROJECTED_POINT *screen)
Transforms point by CurrentMatrix and projects it onto the screen into
screen, returning the scale at its depth; a point outside the near and far
depths keeps its view coordinates and returns 0.
References ProjectionWork, Sint32, syCalcPoint() and syIntegerDivideUnsigned().
Referenced by btCameraSetView(), btCameraSetViewAtDepth(), btEffectPosProjectPoint(), btEffectRunAttackSlash(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunSerac(), btMotionProjectCursorPoint(), btMotionProjectPos(), btMotionProjectScaledPos(), btRenderProjectVertices(), btUnitProjectToScreen(), fdActorGetSpriteDepth(), fdCameraWorldToScreen(), fdLuckyDiceRun(), fdMessageShowAtActor(), fdRenderPlaceProjectedSprite(), fdSuperLuckyDiceRun() and scGaugeUpdate().
Definition at line 456 of file system_matrix.c.