Packageaway3d.tools
Classpublic class Grid

Class Grid snaps vertexes/objects according to a given grid unit.Grid

Public Properties
 PropertyDefined by
  objectSpace : Boolean
Grid
  unit : Number
Grid
Public Methods
 MethodDefined by
  
Grid
(unit:Number = 1, objectSpace:Boolean = false)
Grid snaps vertexes according to a given grid unit
Grid
  
snapObject(object3d:Object3D, dovert:Boolean = false):void
Apply the grid code to a given object3D.
Grid
  
snapVertices(vertices:Vector):void
Apply the grid code to a given set of vertexes.
Grid
Property detail
objectSpaceproperty
objectSpace:Boolean  [read-write]Implementation
    public function get objectSpace():Boolean
    public function set objectSpace(value:Boolean):void
unitproperty 
unit:Number  [read-write]Implementation
    public function get unit():Number
    public function set unit(value:Number):void
Constructor detail
Grid()constructor
public function Grid(unit:Number = 1, objectSpace:Boolean = false)Parameters
unit:Number (default = 1) — unit [optional] Number. The grid unit. Default is 1.
 
objectSpace:Boolean (default = false) — objectSpace [optional] Boolean. Apply only to vertexes in geometry objectspace when Object3D are considered. Default is false.
Init Parameters
Method detail
snapObject()method
public function snapObject(object3d:Object3D, dovert:Boolean = false):void

Apply the grid code to a given object3D. If type ObjectContainer3D, all children Mesh vertices will be affected.

Parameters
object3d:Object3D — object3d Object3D. The Object3d to snap to grid.
 
dovert:Boolean (default = false) — dovert [optional]. If the vertices must be handled or not. When false only object position is snapped to grid. Default is false.
snapVertices()method 
public function snapVertices(vertices:Vector):void

Apply the grid code to a given set of vertexes.

Parameters
vertices:Vector — vertices Array. An array of Vertex objects
Wiki link
Click to go to the wiki page for 'away3d.tools.Grid'

Code examples

Comments