Package | cc.cote.airbag |
Class | public class Collision |
Inheritance | Collision ![]() |
Collision
class contains information about a collision that occured between
two DisplayObject
s. For instance, the AirBag.detect()
method
returns a vector of such objects when performing collision detection.
See also
Property | Defined By | ||
---|---|---|---|
angle : Number [read-only]
The angle of the collision (in radians) between the two DisplayObjects. | Collision | ||
angleInDegrees : Number [read-only]
Returns the angle (in degrees) of the collision between the two
DisplayObjects. | Collision | ||
objects : Vector.<DisplayObject> [read-only]
A vector of the two DisplayObjects that collided. | Collision | ||
overlapping : Vector.<Point> [read-only]
A vector of all the overlapping points during the collision (in stage coordinates). | Collision |
Method | Defined By | ||
---|---|---|---|
Collision(objects:Vector.<DisplayObject>, angle:Number, overlapping:Vector.<Point> = null)
Creates a Collision object. | Collision | ||
toString():String
Returns a string representation of the object. | Collision |
angle | property |
angle:Number
[read-only]
The angle of the collision (in radians) between the two DisplayObject
s. It
will return NaN
if the angle calculation was not performed (for performance
reasons).
If you need the angle in degrees, you can use the angleInDegrees
property.
public function get angle():Number
angleInDegrees | property |
angleInDegrees:Number
[read-only]
Returns the angle (in degrees) of the collision between the two
DisplayObject
s. If you need the angle in radians, simply use the
angle
property.
public function get angleInDegrees():Number
objects | property |
objects:Vector.<DisplayObject>
[read-only]
A vector of the two DisplayObject
s that collided. Note: the
AirBag
class will always put the singleTarget
(if one has been
defined) at index 0.
public function get objects():Vector.<DisplayObject>
overlapping | property |
overlapping:Vector.<Point>
[read-only]
A vector of all the overlapping points during the collision (in stage coordinates). This
could be null
if the calculation was not performed (for performance
reasons).
public function get overlapping():Vector.<Point>
Collision | () | Constructor |
public function Collision(objects:Vector.<DisplayObject>, angle:Number, overlapping:Vector.<Point> = null)
Creates a Collision
object. This object contains properties describing a
collision that was detected between two objects (typically by the AirBag
class).
objects:Vector.<DisplayObject> — A vector of the objects that collided.
| |
angle:Number (default = NaN ) — The angle of collision (in radians)
| |
overlapping:Vector.<Point> (default = null ) — A vector of all overlapping points between the colliding objects
|
toString | () | method |
public function toString():String
Returns a string representation of the object. Useful mostly for debugging purposes.
ReturnsString |