Creates a subobject debris piece that goes off in a random direction
| 961 | } |
| 962 | // Creates a subobject debris piece that goes off in a random direction |
| 963 | object *CreateSubobjectDebris(object *parent, int subobj_num, float explosion_mag, int death_flags) { |
| 964 | vector rand_vec; |
| 965 | // Set physics data for this object |
| 966 | rand_vec.x = (float)(D3_RAND_MAX / 2 - ps_rand()); |
| 967 | rand_vec.y = (float)(D3_RAND_MAX / 2 - ps_rand()) + .2f * D3_RAND_MAX; // a habit of moving upwards |
| 968 | rand_vec.z = (float)(D3_RAND_MAX / 2 - ps_rand()); |
| 969 | |
| 970 | vm_NormalizeVectorFast(&rand_vec); |
| 971 | explosion_mag *= 1.0f + ((float)(D3_RAND_MAX / 2 - ps_rand()) / (float)(D3_RAND_MAX / 2) * 0.05); // +5/-5 percent |
| 972 | return CreateSubobjectDebrisDirected(parent, subobj_num, &rand_vec, explosion_mag, death_flags); |
| 973 | } |
| 974 | // Create extra fireballs for an exploding object |
| 975 | void CreateExtraFireballs(object *obj, float size_scale) { |
| 976 | // Create some extra explosions to start later |
no test coverage detected