Class Grid snaps vertexes or meshes according to a given grid unit.
Grid
objectSpace:Boolean
[read-write]Implementation
public function get objectSpace():Boolean
public function set objectSpace(value:Boolean):void
unit:Number
[read-write]Implementation
public function get unit():Number
public function set unit(value:Number):void
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
public function snapMesh(mesh:Mesh):void
Apply the grid code to a single mesh
Parameters
| mesh:Mesh — mesh Mesh. The mesh to snap to grid. Vertices are affected by default. Mesh position is snapped if grid.objectSpace is true;
|
public function snapObject(object3d:ObjectContainer3D, dovert:Boolean = false):void
Apply the grid code to a given object3D. If type ObjectContainer3D, all children Mesh vertices will be affected.
Parameters
| object3d:ObjectContainer3D — 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.
|
public function snapVertices(vertices:Vector):Vector
Snaps to grid a given Vector. of vertices
Parameters
| vertices:Vector — vertices Vector.. The vertices vector
|
Returns