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

Function xSphereHitsSphere

src/SB/Core/x/xCollide.cpp:132–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130 coll->flags &= 0xfffffffe;
131 }
132 else
133 {
134 if (isx.contained <= 0.0f)
135 {
136 coll->flags |= 0x10;
137 }
138 coll->dist = a->r + isx.penned;
139 if ((coll->flags & 0x1600) != 0)
140 {
141 if (isx.dist == 0.0f)
142 {
143 xVec3Copy(&coll->tohit, &g_O3);
144 }
145 else
146 {
147 xVec3SMul(&coll->tohit, &isx.norm, -coll->dist / isx.dist);
148 }
149 }
150 if ((coll->flags & 0x800) != 0)
151 {
152 if (isx.dist == 0.0f)
153 {
154 xVec3Copy(&coll->depen, &g_O3);
155 }
156 else
157 {
158 xVec3SMul(&coll->depen, &isx.norm, -isx.penned / isx.dist);
159 }
160 }
161 if ((coll->flags & 0x1200) != 0)
162 {
163 xVec3Normalize(&coll->hdng, &coll->tohit);
164 }
165 if ((coll->flags & 0x200) != 0)
166 {
167 xVec3Inv(&coll->norm, &coll->hdng);
168 }
169 uVar1 = 1;
170 coll->flags |= 1;
171 }
172 return uVar1;
173}
174
175U32 xSphereHitsBox(const xSphere* a, const xBox* b, xCollis* coll)
176{
177 U32 uVar1;
178
179 xIsect isx;
180
181 iBoxIsectSphere(b, a, &isx);
182
183 if (!(isx.penned <= 0.0f))
184 {
185 uVar1 = 0;
186 coll->flags &= 0xfffffffe;
187 }
188 else
189 {

Callers 1

xSphereHitsBoundFunction · 0.70

Calls 5

iSphereIsectSphereFunction · 0.85
xVec3CopyFunction · 0.85
xVec3SMulFunction · 0.85
xVec3InvFunction · 0.85
xVec3NormalizeFunction · 0.70

Tested by

no test coverage detected