C# Class FarseerPhysics.Common.PhysicsLogic.SimpleExplosion

Creates a simple explosion that ignores other bodies hiding behind static bodies.
Inheritance: PhysicsLogic
Show file Open project: prime31/Nez

Public Properties

Property Type Description
power float

Public Methods

Method Description
SimpleExplosion ( World world ) : System
activate ( Vector2 pos, float radius, float force, float maxForce = float.MaxValue ) : Vector2>.Dictionary

Activate the explosion at the specified position.

Private Methods

Method Description
GetPercent ( float distance, float radius ) : float
applyImpulse ( Vector2 pos, float radius, float force, float maxForce, HashSet overlappingBodies ) : Vector2>.Dictionary

Method Details

SimpleExplosion() public method

public SimpleExplosion ( World world ) : System
world FarseerPhysics.Dynamics.World
return System

activate() public method

Activate the explosion at the specified position.
public activate ( Vector2 pos, float radius, float force, float maxForce = float.MaxValue ) : Vector2>.Dictionary
pos Vector2 The position (center) of the explosion.
radius float The radius of the explosion.
force float The force applied
maxForce float A maximum amount of force. When force gets over this value, it will be equal to maxForce
return Vector2>.Dictionary

Property Details

power public property

This is the power used in the power function. A value of 1 means the force applied to bodies in the explosion is linear. A value of 2 means it is exponential.
public float power
return float