Package | org.cove.ape |
Class | public class WheelParticle |
Inheritance | WheelParticle ![]() ![]() ![]() |
Property | Defined by | ||
---|---|---|---|
![]() | alwaysRepaint : Boolean
For performance, fixed Particles and SpringConstraints don't have their
paint()
method called in order to avoid unnecessary redrawing. | AbstractItem | |
angle : Number [read-only]
The rotation of the wheel in degrees.
| WheelParticle | ||
angularVelocity : Number
The angular velocity of the WheelParticle.
| WheelParticle | ||
![]() | center : Vector
Returns A Vector of the current location of the particle
| AbstractParticle | |
![]() | collidable : Boolean
Determines if the particle can collide with other particles or constraints.
| AbstractParticle | |
![]() | elasticity : Number
The elasticity of the particle.
| AbstractParticle | |
![]() | fixed : Boolean
The fixed state of the particle.
| AbstractParticle | |
![]() | friction : Number
The surface friction of the particle.
| AbstractParticle | |
![]() | mass : Number
The mass of the particle.
| AbstractParticle | |
![]() | multisample : int
Determines the number of intermediate position steps checked for collision each
cycle.
| AbstractParticle | |
![]() | position : Vector
The position of the particle.
| AbstractParticle | |
![]() | px : Number
The x position of this particle
| AbstractParticle | |
![]() | py : Number
The y position of this particle
| AbstractParticle | |
radian : Number [read-only]
The rotation of the wheel in radians.
| WheelParticle | ||
![]() | radius : Number
The radius of the particle.
| CircleParticle | |
speed : Number
The speed of the WheelParticle.
| WheelParticle | ||
![]() | sprite : Sprite
Provides a Sprite to use as a container for drawing or adding children.
| AbstractItem | |
traction : Number
The amount of traction during a collision.
| WheelParticle | ||
![]() | velocity : Vector
The velocity of the particle.
| AbstractParticle | |
![]() | visible : Boolean
The visibility of the item.
| AbstractItem |
Method | Defined by | ||
---|---|---|---|
WheelParticle(x:Number, y:Number, radius:Number, fixed:Boolean = false, mass:Number = 1, elasticity:Number = 0.3, friction:Number = 0, traction:Number = 1)
| WheelParticle | ||
![]() |
Adds a force to the particle.
| AbstractParticle | |
![]() |
addMasslessForce(f:Vector):void
Adds a 'massless' force to the particle.
| AbstractParticle | |
![]() |
cleanup():void
This method is called automatically when an item's parent group is removed
from the APEngine.
| AbstractItem | |
init():void
Sets up the visual representation of this particle.
| WheelParticle | ||
paint():void
The default paint method for the particle.
| WheelParticle | ||
![]() |
setDisplay(d:DisplayObject, offsetX:Number = 0, offsetY:Number = 0, rotation:Number = 0):void
Assigns a DisplayObject to be used when painting this particle.
| AbstractParticle | |
![]() |
setFill(color:uint = 0xffffff, alpha:Number = 1):void
Sets the style of the fill for this Item.
| AbstractItem | |
![]() |
setLine(thickness:Number = 0, color:uint = 0x000000, alpha:Number = 1):void
Sets the style of the line for this Item.
| AbstractItem | |
![]() |
setStyle(lineThickness:Number = 0, lineColor:uint = 0x000000, lineAlpha:Number = 1, fillColor:uint = 0xffffff, fillAlpha:Number = 1):void
Sets the line and fill of this Item.
| AbstractItem | |
update(dt:Number):void
| WheelParticle |
angle | property |
angle:Number
[read-only]The rotation of the wheel in degrees.
Implementation public function get angle():Number
angularVelocity | property |
angularVelocity:Number
[read-write]The angular velocity of the WheelParticle. You can alter this value to make the WheelParticle spin.
Implementation public function get angularVelocity():Number
public function set angularVelocity(value:Number):void
radian | property |
radian:Number
[read-only]The rotation of the wheel in radians.
Implementation public function get radian():Number
speed | property |
speed:Number
[read-write]The speed of the WheelParticle. You can alter this value to make the WheelParticle spin.
Implementation public function get speed():Number
public function set speed(value:Number):void
traction | property |
traction:Number
[read-write]The amount of traction during a collision. This property controls how much traction is applied when the WheelParticle is in contact with another particle. If the value is set to 0, there will be no traction and the WheelParticle will behave as if the surface was totally slippery, like ice. Values should be between 0 and 1.
Note that the friction property behaves differently than traction. If the surface friction is set high during a collision, the WheelParticle will move slowly as if the surface was covered in glue.
Implementation public function get traction():Number
public function set traction(value:Number):void
WheelParticle | () | constructor |
public function WheelParticle(x:Number, y:Number, radius:Number, fixed:Boolean = false, mass:Number = 1, elasticity:Number = 0.3, friction:Number = 0, traction:Number = 1)
Parameters
x:Number — The initial x position.
|
|
y:Number — The initial y position.
|
|
radius:Number — The radius of this particle.
|
|
fixed:Boolean (default = false ) — Determines if the particle is fixed or not. Fixed particles
are not affected by forces or collisions and are good to use as surfaces.
Non-fixed particles move freely in response to collision and forces.
|
|
mass:Number (default = 1 ) — The mass of the particle
|
|
elasticity:Number (default = 0.3 ) — The elasticity of the particle. Higher values mean more elasticity.
|
|
friction:Number (default = 0 ) — The surface friction of the particle.
|
|
traction:Number (default = 1 ) — The surface traction of the particle.
Note that WheelParticles can be fixed but rotate freely. |
init | () | method |
public override function init():void
Sets up the visual representation of this particle. This method is automatically called when an particle is added to the engine.
paint | () | method |
public override function paint():void
The default paint method for the particle. Note that you should only use the default painting methods for quick prototyping. For anything beyond that you should always write your own classes that either extend one of the APE particle and constraint classes, or is a composite of them. Then within that class you can define your own custom painting method.
update | () | method |
public override function update(dt:Number):void
Parameters
dt:Number |