| 122 | } |
| 123 | |
| 124 | RpCollisionTriangle* 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 | |
| 160 | RpCollisionTriangle* shadowRayModelCB(RpIntersection* isx, RpCollisionTriangle* tri, F32 dist, |
| 161 | void* data) |
no test coverage detected