MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / shadowRayCB

Function shadowRayCB

src/SB/Core/x/xShadowSimple.cpp:124–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124RpCollisionTriangle* shadowRayCB(RpIntersection*, RpWorldSector*, RpCollisionTriangle* tri,
125 F32 dist, void* data)
126{
127 xVec3 xformnorm;
128 xVec3* norm = NULL;
129 F32* testdist;
130 xShadowSimpleCache* cache = (xShadowSimpleCache*)data;
131
132 if (sModelMat)
133 {
134 testdist = &cache->shadowHeight;
135 xMat3x3RMulVec(&xformnorm, (xMat3x3*)sModelMat, (xVec3*)&tri->normal);
136 xVec3Normalize(&xformnorm, &xformnorm);
137 norm = &xformnorm;
138 }
139 else
140 {
141 testdist = &cache->envHeight;
142 norm = (xVec3*)&tri->normal;
143 }
144
145 if (dist >= *testdist || (norm->y < 0.0871557f))
146 {
147 return tri;
148 }
149
150 *testdist = dist;
151
152 cache->poly.vert[0] = *((xVec3*)tri->vertices[0]);
153 cache->poly.vert[1] = *((xVec3*)tri->vertices[1]);
154 cache->poly.vert[2] = *((xVec3*)tri->vertices[2]);
155 cache->poly.norm = *((xVec3*)&tri->normal);
156
157 return tri;
158}
159
160RpCollisionTriangle* shadowRayModelCB(RpIntersection* isx, RpCollisionTriangle* tri, F32 dist,
161 void* data)

Callers 1

shadowRayModelCBFunction · 0.70

Calls 2

xMat3x3RMulVecFunction · 0.70
xVec3NormalizeFunction · 0.70

Tested by

no test coverage detected