Pathwalker (pathwalker) wrote,
Pathwalker
pathwalker

  • Mood:

Screenshots coming soon...

void break_up_player(struct player* aPlayer, float force)
{
  int x;
  for (x=0; x< aPlayer->poly_count; x++)
    {
        struct player* newPlayer;
        struct player_node * newNode;
        union fvec3 aVector; /* Array | Struct */

        newPlayer = (struct player*) malloc(sizeof(struct player));

        aVector = center_of_triangle(aPlayer->polys[x]);

        VEC_SUM(newPlayer->position.a, aVector.a, aPlayer->position.a);
        VEC_COPY(newPlayer->xyzvel.a,aPlayer->xyzvel.a);
        VEC_NORMALIZE(aVector.a);
        VEC_ACCUM(newPlayer->xyzvel.a,force, aVector.a);

        newPlayer->tilt=0;
        newPlayer->angle=0;
        newPlayer->poly_count=1;
        newPlayer->polys = (struct triangle **) malloc(sizeof(struct triangle *));
        newPlayer->polys[0]=aPlayer->polys[x];

        aPlayer->polys[x]=NULL;

        newNode = insert_player_node(&NODELISTS[NODE_fragment],
                                     create_player_node(newPlayer));
        newNode->misc=15; /* Frames fragment lives */

        newNode = insert_player_node(&NODELISTS[NODE_global],
                                     create_player_node(newPlayer));

    }

  destroy_player(aPlayer);
}
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment