From MechWarrior: Living Legends Wiki
Jump to: navigation, search


just leaving this here so I don't have to search it in the code again

 float dist = (pClientActor->GetEntity()->GetWorldPos() - explosionInfo.pos).len();
 Vec3 eyeToExplosion = explosionInfo.pos - state.eyePosition;
 bool inFOV = (state.eyeDirection.Dot(eyeToExplosion) > 0.68f);
 if(pActor && pActor->GetLinkedVehicle())
   Vec3 eyeDir = static_cast<CPlayer*>(pActor)->GetVehicleViewDir();
   inFOV = (eyeDir.Dot(eyeToExplosion) > 0.68f);
 if(inFOV && (dist < explosionInfo.radius))
   if (explosionInfo.damage>10.0f || explosionInfo.pressure>100.0f)
     //Add some angular impulse to the client actor depending on distance, direction...
     float dt = (1.0f - dist/explosionInfo.radius);
     dt = dt * dt;
     float angleZ = g_PI*0.15f*dt;
     float angleX = g_PI*0.15f*dt;

there is some additional cry engine black box magic in SimulateExplosion

pressure Explosion impulse pressure at radius distance from epicenter.

min_phys_radius Explosion minimal radius, at this radius full pressure is applied.

max_phys_radius Explosion maximal radius, at this radius impulse pressure will be reaching zero.

and that is the best I could find in the cry engine docs