Packageaway3d.tools.commands
Classpublic class Align
InheritanceAlign Inheritance Object

Class Aligns an arrays of Object3Ds, Vector3D's or Vertexes compaired to each other.Align



Public Methods
 MethodDefined By
  
align(aObjs:Array, axis:String, condition:String):void
[static] Applies to array elements the alignment according to axis, x, y or z and a condition.
Align
  
alignMeshes(meshes:Vector.<Mesh>, axis:String, condition:String):void
[static] Aligns a series of meshes to their bounds along a given axis.
Align
  
alignToFloor(meshes:Vector.<Mesh>):void
[static] Place one or more meshes at y 0 using their min bounds
Align
  
distribute(aObjs:Array, axis:String):void
[static] Applies to array elements a distributed alignment according to axis, x,y or z.
Align
Public Constants
 ConstantDefined By
  AVERAGE : String = av
[static]
Align
  NEGATIVE : String = -
[static]
Align
  POSITIVE : String = +
[static]
Align
  X_AXIS : String = x
[static]
Align
  Y_AXIS : String = y
[static]
Align
  Z_AXIS : String = z
[static]
Align
Method Detail
align()method
public static function align(aObjs:Array, axis:String, condition:String):void

Applies to array elements the alignment according to axis, x, y or z and a condition. each element must have public x,y and z properties. In case elements are meshes only their positions is affected. Method doesn't take in account their respective bounds String condition: "+" align to highest value on a given axis "-" align to lowest value on a given axis "" align to a given axis on 0; This is the default. "av" align to average of all values on a given axis

Parameters

aObjs:Array — Array. An array with elements with x,y and z public properties such as Mesh, Object3D, ObjectContainer3D,Vector3D or Vertex
 
axis:String — String. Represent the axis to align on.
 
condition:String — [optional]. String. Can be '+", "-", "av" or "", Default is "", aligns to given axis at 0.

alignMeshes()method 
public static function alignMeshes(meshes:Vector.<Mesh>, axis:String, condition:String):void

Aligns a series of meshes to their bounds along a given axis.

Parameters

meshes:Vector.<Mesh> — A Vector of Mesh objects
 
axis:String — Represent the axis to align on.
 
condition:String (default = NaN) — Can be POSITIVE ('+') or NEGATIVE ('-'), Default is POSITIVE ('+')

alignToFloor()method 
public static function alignToFloor(meshes:Vector.<Mesh>):void

Place one or more meshes at y 0 using their min bounds

Parameters

meshes:Vector.<Mesh>

distribute()method 
public static function distribute(aObjs:Array, axis:String):void

Applies to array elements a distributed alignment according to axis, x,y or z. In case elements are meshes only their positions is affected. Method doesn't take in account their respective bounds each element must have public x,y and z properties

Parameters

aObjs:Array — Array. An array with elements with x,y and z public properties such as Mesh, Object3D, ObjectContainer3D,Vector3D or Vertex
 
axis:String — String. Represent the axis to align on.

Constant Detail
AVERAGEConstant
public static const AVERAGE:String = av

NEGATIVEConstant 
public static const NEGATIVE:String = -

POSITIVEConstant 
public static const POSITIVE:String = +

X_AXISConstant 
public static const X_AXIS:String = x

Y_AXISConstant 
public static const Y_AXIS:String = y

Z_AXISConstant 
public static const Z_AXIS:String = z