sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

break_particles.inc.c (978B)


      1 // break_particles.inc.c
      2 
      3 void spawn_triangle_break_particles(s16 numTris, s16 triModel, f32 triSize, s16 triAnimState) {
      4     struct Object *triangle;
      5     s32 i;
      6 
      7     for (i = 0; i < numTris; i++) {
      8         triangle = spawn_object(o, triModel, bhvBreakBoxTriangle);
      9         triangle->oAnimState = triAnimState;
     10         triangle->oPosY += 100.0f;
     11         triangle->oMoveAngleYaw = random_u16();
     12         triangle->oFaceAngleYaw = triangle->oMoveAngleYaw;
     13         triangle->oFaceAnglePitch = random_u16();
     14         triangle->oVelY = random_f32_around_zero(50.0f);
     15 
     16         if (triModel == MODEL_DIRT_ANIMATION || triModel == MODEL_SL_CRACKED_ICE_CHUNK) {
     17             triangle->oAngleVelPitch = 0xF00;
     18             triangle->oAngleVelYaw = 0x500;
     19             triangle->oForwardVel = 30.0f;
     20         } else {
     21             triangle->oAngleVelPitch = 0x80 * (s32)(random_float() + 50.0f);
     22             triangle->oForwardVel = 30.0f;
     23         }
     24 
     25         obj_scale(triangle, triSize);
     26     }
     27 }