Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/src/game/behaviors/break_particles.inc.c
7861 views
1
// break_particles.c.inc
2
3
void spawn_triangle_break_particles(s16 numTris, s16 triModel, f32 triSize, s16 triAnimState) {
4
struct Object *triangle;
5
s32 i;
6
for (i = 0; i < numTris; i++) {
7
triangle = spawn_object(o, triModel, bhvBreakBoxTriangle);
8
triangle->oAnimState = triAnimState;
9
triangle->oPosY += 100.0f;
10
triangle->oMoveAngleYaw = random_u16();
11
triangle->oFaceAngleYaw = triangle->oMoveAngleYaw;
12
triangle->oFaceAnglePitch = random_u16();
13
triangle->oVelY = random_f32_around_zero(50.0f);
14
if (triModel == MODEL_DIRT_ANIMATION || triModel == MODEL_SL_CRACKED_ICE_CHUNK) {
15
triangle->oAngleVelPitch = 0xF00;
16
triangle->oAngleVelYaw = 0x500;
17
triangle->oForwardVel = 30.0f;
18
} else {
19
triangle->oAngleVelPitch = 0x80 * (s32)(random_float() + 50.0f);
20
triangle->oForwardVel = 30.0f;
21
}
22
obj_scale(triangle, triSize);
23
}
24
}
25
26