Packageflare.physics.colliders
Classpublic final class RayCollider
InheritanceRayCollider Inheritance Collider Inheritance Object

A Ray collider object. A collider defines the main behavior and shape of each object in the scene. By default, a collider behaves as a kinematic object (with the exception of MeshCollider which is static by default), which means they can be manually moved or be moved by other objects but no forces are generated from these actions, objects simply push each other until there is no overlapping between them. A collider is Kinemaic unless it is set to be static, rigid body or trigger.



Public Properties
 PropertyDefined By
 InheritedangularVelocity : Vector3D
The world space aligned angular velocity (only rigid bodies).
Collider
 InheritedcollectContacts : Boolean = false
When set to true, the object stores the contact data objects after each physics.step() call.
Collider
 InheritedcontactData : Vector.<ContactData>
The contact datas information stored after each physics.step() call.
Collider
 InheritedcontactGroups : uint
Stores the groups in which this collider has been involved during the last physics.step() call.
Collider
  dir : Vector3D
Normalized direction of the ray.
RayCollider
 Inheriteddisplacement : Vector3D
The world space object displacement used for correcting the position of overlaping objects.
Collider
  distance : Number
Maximum distance of the ray.
RayCollider
 Inheritedenabled : Boolean = true
Enable or disable the collider.
Collider
 Inheritedfriction : Number = 1.0
The friction of the collider from 0 - no friction, to 1 - full friction (only rigid bodies).
Collider
 Inheritedgravity : Vector3D
The gravity vector.
Collider
 Inheritedgroups : uint = 1
Sets or gets the collision groups for each collider.
Collider
 InheritedinvInertia : Matrix3D
The world space inverted inertia matrix.
Collider
 InheritedinvLocalInertia : Matrix3D
The inverted local inertia matrix.
Collider
 InheritedinvMass : Number = 1
The inverse mass of the collider.
Collider
 InheritedinvTransform : Matrix3D
The inverse world transform matrix.
Collider
 InheritedisRigidBody : Boolean = false
Sets or gets if the collider behaves as a rigid body.
Collider
 InheritedisStatic : Boolean = false
Sets or gets if the collider behaves as a static object.
Collider
 InheritedisTrigger : Boolean = false
Sets or gets if the collider behaves as a trigger.
Collider
 InheritedlinearVelocity : Vector3D
The world space aligned linear velocity (only rigid bodies).
Collider
 Inheritedmass : Number = 1
The mass of the collider.
Collider
 InheritedmaxX : Number = 0
The maximum position along the Z-Axis in world space.
Collider
 InheritedmaxY : Number = 0
The maximum position along the Z-Axis in world space.
Collider
 InheritedmaxZ : Number = 0
The maximum position along the Z-Axis in world space.
Collider
 InheritedminX : Number = 0
The minimum position along the X-Axis in world space.
Collider
 InheritedminY : Number = 0
The minimum position along the Y-Axis in world space.
Collider
 InheritedminZ : Number = 0
The minimum position along the Z-Axis in world space.
Collider
 InheritedneverSleep : Boolean = false
Gets or sets if the colider is allowed to enter sleeping mode.
Collider
 InheritednumContacts : int
The number of contact datas after each physics.step() call when collectContacts is set to true.
Collider
 Inheritedoffset : Vector3D
Sets or gets an offset position within the parent pivot.
Collider
 Inheritedorientation : Vector3D
The orientation in world space in quaternion form.
Collider
 Inheritedparent : Collider
The parent collider.
Collider
 Inheritedpivot : Pivot3D
The pivot associated to this collider.
Collider
 Inheritedposition : Vector3D
The position in world space.
Collider
 Inheritedrestitution : Number = 0.0
The restitution factor of the collider from 0 - no restitution to 1 - full bouncing (only rigid bodies).
Collider
 InheritedscaledPivot : Boolean = true
When the collider pivot is scaled, set this property to true to properly calculate the collider transforms.
Collider
 Inheritedshape : int
The shape of the collider.
Collider
 Inheritedsleeping : Boolean = false
Gets or sets whatever the collider is in sleeping mode or not.
Collider
 InheritedsleepingFactor : Number = 0.9
A factor property which defines how fast the object will enter in sleeping mode, from 0 to 1.
Collider
 Inheritedtransform : Matrix3D
The world space transform matrix.
Collider
 InheriteduserData : *
An object to store any custom properties, null by default.
Collider
Public Methods
 MethodDefined By
  
RayCollider(dir:Vector3D = null, distance:Number = 1000)
Creates a new ray collider.
RayCollider
 Inherited
addCollisionGroups(... args):void
Adds collision groups to the collider.
Collider
 Inherited
applyImpulse(x:Number, y:Number, z:Number, position:Vector3D = null):void
Applies an impulse force on the collider in world space (only rigid bodies).
Collider
 Inherited
applyLocalImpulse(x:Number, y:Number, z:Number, position:Vector3D = null):void
Applies an impulse force on the collider in local space (only rigid bodies).
Collider
 Inherited
applyLocalTorque(x:Number, y:Number, z:Number):void
Applies a torque force on the collider in local space (only rigid bodies).
Collider
 Inherited
applyTorque(x:Number, y:Number, z:Number):void
Applies a torque force on the collider in world space (only rigid bodies).
Collider
 Inherited
awake():void
Exit spleeing mode.
Collider
 Inherited
Clone this collider.
Collider
 Inherited
constrainLocalRotation(x:Number = 1, y:Number = 1, z:Number = 1):void
Allows for constraining rotation angles (only rigid bodies).
Collider
 Inherited
dispose():void
Disposes all resources used by this collider.
Collider
 Inherited
getSupportPoints(axis:Vector3D, out:Vector.<Vector3D>):int
Get the support points along an arbitraty axis.
Collider
 Inherited
hasGroup(index:int):Boolean
Checks if the collider is in the specified group.
Collider
 Inherited
project(axis:Vector3D, info:AxisInfo):void
Projects the object along an arbitrary axis.
Collider
 Inherited
removeCollisionGroups(... args):void
Removes collision groups from the collider.
Collider
 Inherited
Resets both, linear and angular velocities (only rigid bodies).
Collider
 Inherited
setCollisionGroups(... args):void
Resets and sets the collision groups to the collider.
Collider
 Inherited
setMass(mass:Number):void
Sets the collider mass and inertia for collisions and physics.
Collider
 Inherited
sleep():void
Enters in sleeping mode.
Collider
 Inherited
update(timeStep:Number):void
Updates the state of the collider properties such as its position, orientation, matrices, boundings.
Collider
 Inherited
When multiple colliders are grouped to a parent collider, the parent collider must update its mass and intertia values.
Collider
Public Constants
 ConstantDefined By
 InheritedSHAPE_BOX : int
[static]
Collider
 InheritedSHAPE_MESH : int
[static]
Collider
 InheritedSHAPE_NULL : int
[static]
Collider
 InheritedSHAPE_RAY : int
[static]
Collider
 InheritedSHAPE_SPHERE : int
[static]
Collider
Property Detail
dirproperty
public var dir:Vector3D

Normalized direction of the ray. If the ray collider is linked to a pivot, the pivot direction will be used.

distanceproperty 
public var distance:Number

Maximum distance of the ray.

Constructor Detail
RayCollider()Constructor
public function RayCollider(dir:Vector3D = null, distance:Number = 1000)

Creates a new ray collider.

Parameters
dir:Vector3D (default = null) — Normalized direction of the ray. If the ray collider is linked to a pivot, the pivot direction will be used.
 
distance:Number (default = 1000) — Maximum distance of the ray.