Packagealternativa.engine3d.physics
Classpublic class EllipsoidCollider

The class implements continuous collision detection algorithm for ellipsoid and convex polygons.



Public Properties
 PropertyDefined by
  collisionSet : Set
A set of objects which are involved in collision detection procedure.
EllipsoidCollider
  collisionSetMode : int
The property determines how collisionSet is used in collision detection procedure.
EllipsoidCollider
  offsetThreshold : Number = 0.0001
Distance threshold.
EllipsoidCollider
  radiusX : Number
X radius of the ellipsoid.
EllipsoidCollider
  radiusY : Number
Y radius of the ellipsoid
EllipsoidCollider
  radiusZ : Number
Z radius of the ellipsoid.
EllipsoidCollider
  scene : Scene3D
The scene for collision detection.
EllipsoidCollider
Public Methods
 MethodDefined by
  
EllipsoidCollider(scene:Scene3D = null, radiusX:Number = 100, radiusY:Number = 100, radiusZ:Number = 100)
Creates a new instance of the class.
EllipsoidCollider
  
calculateDestination(sourcePoint:Point3D, displacementVector:Point3D, destinationPoint:Point3D):void
The method calculates new position of the ellipsoid.
EllipsoidCollider
  
getCollision(sourcePoint:Point3D, displacementVector:Point3D, collision:Collision):Boolean
The method determines if there is a collision when ellipsoid moves from given point along given displacement vector, taking into account collisionSet and collisionSetMode.
EllipsoidCollider
Property detail
collisionSetproperty
public var collisionSet:Set

A set of objects which are involved in collision detection procedure. The objects in the set must be instances of Mesh or Surface classes. The collisionSetMode property determines how exactly the set is used in collision detection. Null is equivalent to an empty set.

See also

collisionSetModeproperty 
collisionSetMode:int  [read-write]

The property determines how collisionSet is used in collision detection procedure.

The default value is CollisionSetMode.EXCLUDE.

Implementation
    public function get collisionSetMode():int
    public function set collisionSetMode(value:int):void

Throws
ArgumentError — throws when a wrong value have been specified

See also

offsetThresholdproperty 
public var offsetThreshold:Number = 0.0001

Distance threshold. Two points are considered to be the same if absolute difference between any corresponding coordinates of the points is not greater than given threshold.

radiusXproperty 
radiusX:Number  [read-write]

X radius of the ellipsoid.

The default value is 100.

Implementation
    public function get radiusX():Number
    public function set radiusX(value:Number):void
radiusYproperty 
radiusY:Number  [read-write]

Y radius of the ellipsoid

The default value is 100.

Implementation
    public function get radiusY():Number
    public function set radiusY(value:Number):void
radiusZproperty 
radiusZ:Number  [read-write]

Z radius of the ellipsoid.

The default value is 100.

Implementation
    public function get radiusZ():Number
    public function set radiusZ(value:Number):void
sceneproperty 
public var scene:Scene3D

The scene for collision detection.

Constructor detail
EllipsoidCollider()constructor
public function EllipsoidCollider(scene:Scene3D = null, radiusX:Number = 100, radiusY:Number = 100, radiusZ:Number = 100)

Creates a new instance of the class.

Parameters
scene:Scene3D (default = null)scene for collision detection
 
radiusX:Number (default = 100)X radius of the ellipsoid
 
radiusY:Number (default = 100)Y radius of the ellipsoid
 
radiusZ:Number (default = 100)Z radius of the ellipsoid
Method detail
calculateDestination()method
public function calculateDestination(sourcePoint:Point3D, displacementVector:Point3D, destinationPoint:Point3D):void

The method calculates new position of the ellipsoid. If scene is specified then collisions with the scene's objects are taken into account.

Parameters
sourcePoint:Point3Dthe starting position of the ellipsoid in the scene's root object's coordinate system
 
displacementVector:Point3Dthe displacement vector in the scene's root object's coordinate system. If absolute value of each vector component doesn't exceed offsetThreshold, then the ellipsoid doesn't change it's position.
 
destinationPoint:Point3Dthe new calculated position in the scene's root object's coordinates system is stored here

See also

getCollision()method 
public function getCollision(sourcePoint:Point3D, displacementVector:Point3D, collision:Collision):Boolean

The method determines if there is a collision when ellipsoid moves from given point along given displacement vector, taking into account collisionSet and collisionSetMode.

Parameters
sourcePoint:Point3Dstarting coordinates of the ellipsoid's center in the scene's root object's coordinate system
 
displacementVector:Point3Ddisplacement vector in the scene's root object's coordinate system
 
collision:Collisioncollision parameters will be stored here

Returns
Booleantrue if collision detected, otherwise false

See also