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

Function xBoulderGenerator_Launch

src/SB/Core/x/xEntBoulder.cpp:1200–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1198}
1199
1200void xBoulderGenerator_Launch(xBoulderGenerator* bg, xVec3* pnt, F32 t)
1201{
1202 S32 i = GetBoulderForGenerating(bg);
1203 xEntBoulder* b = bg->boulderList[i];
1204 F32 invTime;
1205
1206 if ((b != (xEntBoulder*)bg->objectPtr) || (!xEntIsVisible(b)))
1207 {
1208 xEntBoulder_Reset(b, globals.sceneCur);
1209 zEntEvent(b, eEventBorn);
1210 b->update = (xEntUpdateCallback)xEntBoulder_Update;
1211 if (bg->isMarker)
1212 {
1213 xVec3Copy((xVec3*)(&b->model->Mat->pos), &((xMarkerAsset*)(bg->objectPtr))->pos);
1214 }
1215 else
1216 {
1217 xVec3Copy((xVec3*)(&b->model->Mat->pos),
1218 (xVec3*)(&((xEnt*)(bg->objectPtr))->model->Mat->pos));
1219 }
1220 xVec3AddTo((xVec3*)(&b->model->Mat->pos), &bg->bgasset->offset);
1221 xVec3Copy(&b->rotVec, &bg->bgasset->initaxis);
1222 b->angVel = bg->bgasset->angvel;
1223 }
1224
1225 invTime = (1.0f / t);
1226 b->vel.x = invTime * (pnt[0].x - b->model->Mat->pos.x);
1227 b->vel.z = invTime * (pnt[0].z - b->model->Mat->pos.z);
1228 b->vel.y = invTime * (pnt[0].y - b->model->Mat->pos.y) + b->basset->gravity * t * 0.5f;
1229 BoulderGen_GiveBirth(bg, i);
1230}
1231
1232void xBoulderGenerator_GenBoulder(xBoulderGenerator*);
1233

Callers 1

Calls 7

xEntIsVisibleFunction · 0.85
xEntBoulder_ResetFunction · 0.85
xVec3CopyFunction · 0.85
xVec3AddToFunction · 0.85
BoulderGen_GiveBirthFunction · 0.85
GetBoulderForGeneratingFunction · 0.70
zEntEventFunction · 0.70

Tested by

no test coverage detected