| Package | alternativa.engine3d.physics |
| Class | public class EllipsoidCollider |
| Property | Defined 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 | ||
| Method | Defined 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 | ||
|
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 | ||
| collisionSet | property |
public var collisionSet:SetA 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
| collisionSetMode | property |
collisionSetMode:int [read-write]The property determines how collisionSet is used in collision detection procedure.
The default value is CollisionSetMode.EXCLUDE.
public function get collisionSetMode():int
public function set collisionSetMode(value:int):void
ArgumentError — throws when a wrong value have been specified |
See also
| offsetThreshold | property |
public var offsetThreshold:Number = 0.0001Distance 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.
| radiusX | property |
radiusX:Number [read-write]X radius of the ellipsoid.
The default value is 100.
public function get radiusX():Number
public function set radiusX(value:Number):void
| radiusY | property |
radiusY:Number [read-write]Y radius of the ellipsoid
The default value is 100.
public function get radiusY():Number
public function set radiusY(value:Number):void
| radiusZ | property |
radiusZ:Number [read-write]Z radius of the ellipsoid.
The default value is 100.
public function get radiusZ():Number
public function set radiusZ(value:Number):void
| scene | property |
public var scene:Scene3DThe scene for collision detection.
| EllipsoidCollider | () | constructor |
public function EllipsoidCollider(scene:Scene3D = null, radiusX:Number = 100, radiusY:Number = 100, radiusZ:Number = 100)Creates a new instance of the class.
Parametersscene: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 |
| calculateDestination | () | method |
public function calculateDestination(sourcePoint:Point3D, displacementVector:Point3D, destinationPoint:Point3D):voidThe method calculates new position of the ellipsoid. If scene is specified then collisions with the scene's objects are taken into account.
ParameterssourcePoint:Point3D — the starting position of the ellipsoid in the scene's root object's coordinate system |
|
displacementVector:Point3D — the 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:Point3D — the 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):BooleanThe method determines if there is a collision when ellipsoid moves from given point along given displacement vector, taking into account collisionSet and collisionSetMode.
sourcePoint:Point3D — starting coordinates of the ellipsoid's center in the scene's root object's coordinate system |
|
displacementVector:Point3D — displacement vector in the scene's root object's coordinate system |
|
collision:Collision — collision parameters will be stored here |
Boolean — true if collision detected, otherwise false |
See also