MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / g3_ProjectPoint

Function g3_ProjectPoint

renderer/HardwarePoints.cpp:79–87  ·  view source on GitHub ↗

projects a point

Source from the content-addressed store, hash-verified

77
78// projects a point
79void g3_ProjectPoint(g3Point *p) {
80 if (p->p3_flags & PF_PROJECTED || p->p3_codes & CC_BEHIND)
81 return;
82
83 float one_over_z = 1.0 / p->p3_z;
84 p->p3_sx = Window_w2 + (p->p3_x * (Window_w2 * one_over_z));
85 p->p3_sy = Window_h2 - (p->p3_y * (Window_h2 * one_over_z));
86 p->p3_flags |= PF_PROJECTED;
87}
88
89// from a 2d point, compute the vector through that point
90void g3_Point2Vec(vector *v, int16_t sx, int16_t sy) {

Callers 15

g3_DrawLineFunction · 0.85
g3_DrawSpecialLineFunction · 0.85
g3_DrawSphereFunction · 0.85
g3_DrawBoxFunction · 0.85
rend_DrawPolygon3DFunction · 0.85
DrawRadiosityPolyFunction · 0.85
DrawTerrainPointsFunction · 0.85
CheckRoomFunction · 0.85
DrawVertBoxFunction · 0.85
DrawNumberFunction · 0.85
GetCenterPointFunction · 0.85
DrawNumberFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected