-
-
Parameters:
- Inherited From:
- Source:
Returns:
-
Type
-
Grape2D.Shape
-
-
Gets the particle acceleration.
- Source:
Returns:
Particle acceleration.
-
Type
-
Grape2D.Vector
-
getLifeTime() → {number}
-
Gets the particle remaining life time.
- Source:
Returns:
Particle life time.
-
Type
-
number
-
-
Gets the position of the object.
- Inherited From:
- Source:
Returns:
The center position of the shape.
-
Type
-
Grape2D.Vector
-
getStaticType() → {string}
-
Gets teh static type of the shape. This method must be overriden,
for specific shapes.
- Inherited From:
- Source:
Returns:
The type of the shape.
-
Type
-
string
-
-
Gets the particle velocity.
- Source:
Returns:
Particle velocity.
-
Type
-
Grape2D.Vector
-
isAlive() → {boolean}
-
Checks if the particle is in the alive state.
- Source:
Returns:
True if it's alive.
-
Type
-
boolean
-
isDead() → {boolean}
-
Checks if the particle is in the dead state.
- Source:
Returns:
True if it's dead.
-
Type
-
boolean
-
render()
-
- Source:
-
revive(position, velocity, lifeTime)
-
Revives the particle according to a set of properties.
Parameters:
Name |
Type |
Description |
position |
Grape2D.Vector
|
Position of the particle. |
velocity |
Grape2D.Vector
|
Velocity of the particle. |
lifeTime |
number
|
Remaining life time of the particle. |
- Source:
-
setAcceleration(acceleration)
-
Sets the particle acceleration.
Parameters:
Name |
Type |
Description |
acceleration |
Grape2D.Vector
|
Acceleration of the particle. |
- Source:
-
setLifeTime(lifeTime)
-
Sets the particle remaining life time.
Parameters:
Name |
Type |
Description |
lifeTime |
number
|
Remaining life time of the particle. |
- Source:
-
setPosition(position)
-
Set the position of the shape.
Parameters:
Name |
Type |
Description |
position |
Grape2D.Vector
|
The new position of the shape. |
- Inherited From:
- Source:
-
setVelocity(velocity)
-
Sets the particle velocity.
Parameters:
Name |
Type |
Description |
velocity |
Grape2D.Vector
|
Velocity of the particle. |
- Source:
-
submitToFields(fields)
-
Submits the particle to the force of fields.
Parameters:
Name |
Type |
Description |
fields |
!Array.<!Grape2D.Field>
|
Fields to submit. |
- Source:
-
update(dt, scene)
-
Updates the particle.
Parameters:
Name |
Type |
Description |
dt |
number
|
Time elapsed since the last update. |
scene |
Grape2D.Scene
|
Scene where the particle is. |
- Source: