Packageflare.physics.colliders
Classpublic class MeshCollider
InheritanceMeshCollider Inheritance Collider Inheritance Object

A Mesh 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
  bvh : BVH
[read-only] Gets a reference to the root BVH node.
MeshCollider
 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
 Inheriteddisplacement : Vector3D
The world space object displacement used for correcting the position of overlaping objects.
Collider
 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
  mesh : Mesh3D
[read-only] Reference to the mesh used as a shape.
MeshCollider
 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
  tris : Vector.<Triangle>
[read-only] Gets all the triangle objects of the mesh collider.
MeshCollider
 InheriteduserData : *
An object to store any custom properties, null by default.
Collider
Public Methods
 MethodDefined By
  
Creates a new mesh collider.
MeshCollider
 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
bvhproperty
bvh:BVH  [read-only]

Gets a reference to the root BVH node.


Implementation
    public function get bvh():BVH
meshproperty 
mesh:Mesh3D  [read-only]

Reference to the mesh used as a shape.


Implementation
    public function get mesh():Mesh3D
trisproperty 
tris:Vector.<Triangle>  [read-only]

Gets all the triangle objects of the mesh collider.


Implementation
    public function get tris():Vector.<Triangle>
Constructor Detail
MeshCollider()Constructor
public function MeshCollider(mesh:Mesh3D)

Creates a new mesh collider.

Parameters
mesh:Mesh3D — Mesh to be used as a shape.