Class Explosion
Extends
JEffect.
Explosion an explosive force effect
This effect has a radius within which it will repel bodies depending on the defined force
and their distance (the closer the object, the stronger the effect).
This effect will only be applied during a single cycle of the PhysicsSystem, imparting a sudden impulse.
This effect can either be placed at an arbitrary location in the scene, or it can be attached to a parent object.
Defined in: explosion.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Explosion(_location, _radius, _force, _parent, _relativity)
|
| Field Attributes | Field Name and Description |
|---|---|
|
the force of the effect at 0 distance (impulse will be force/distance)
|
|
|
initial location of the effect expressed as a 3D vector
|
|
|
optional - a RigidBody that the gravitational field will follow - excluded from the main effect force, but optionally receives relative force
|
|
|
radius of effect - the distance at which the effect's influence will drop to zero
|
|
|
optional - toggle whether or not the parent receives a reactive impulse relative to that delivered to bodies falling within the effect radius
|
- Fields borrowed from class :
- JEffect#_effectEnabled
| Method Attributes | Method Name and Description |
|---|---|
|
Apply()
|
|
|
explode()
|
Class Detail
Explosion(_location, _radius, _force, _parent, _relativity)
Author: Jim Sangwine.
- Parameters:
- {array} _location
- initial location of the effect expressed as a 3D vector
- {number} _radius
- radius of effect
- {number} _force
- the force of the effect at 0 distance
- {RigidBody} _parent
- optional parent body
- {boolean} _relativity
- optional toggle whether or not the parent receives a reactive impulse
- Requires:
- Vector3DUtil
Field Detail
{number}
force
the force of the effect at 0 distance (impulse will be force/distance)
{array}
location
initial location of the effect expressed as a 3D vector
{RigidBody}
parent
optional - a RigidBody that the gravitational field will follow - excluded from the main effect force, but optionally receives relative force
{number}
radius
radius of effect - the distance at which the effect's influence will drop to zero
{boolean}
relativity
optional - toggle whether or not the parent receives a reactive impulse relative to that delivered to bodies falling within the effect radius
Method Detail
{void}
Apply()
- See:
- JEffect.Apply
{void}
explode()