Packageaway3d.tools
Classpublic class MeshHelper

Helper Class for the Mesh object MeshHelper A series of methods usually usefull for mesh manipulations

Public Methods
 MethodDefined by
  
applyPosition(mesh:Mesh, dx:Number, dy:Number, dz:Number):void
[static] Applys an offset to a mesh at vertices level
MeshHelper
  
applyRotations(mesh:Mesh):void
[static] Applys the rotation values of a mesh in object space and resets rotations to zero.
MeshHelper
  
boundingRadius(mesh:Mesh):Number
[static] Returns the boundingRadius of an Entity of a Mesh.
MeshHelper
  
[static] Returns the boundingRadius of a ObjectContainer3D
MeshHelper
  
build(vertices:Vector, indices:Vector, uvs:Vector, name:String = "", material:MaterialBase = null):Mesh
[static] Build a Mesh from Vectors
MeshHelper
  
[static] unfinished: to do unique material checks, empty subgemometries & animation Returns a mesh with its subgeometries reorganized
MeshHelper
  
duplicate(mesh:Mesh, newName:String = ""):Mesh
[static] Duplicates a Mesh
MeshHelper
  
[static] Inverts the faces of all the Meshes into an ObjectContainer3D
MeshHelper
  
invertFaces(mesh:Mesh):void
[static] Inverts the faces of a Mesh
MeshHelper
  
recenter(mesh:Mesh):void
[static] Recenter geometry, (its pivot is at center of geometry)
MeshHelper
Method detail
applyPosition()method
public static function applyPosition(mesh:Mesh, dx:Number, dy:Number, dz:Number):void

Applys an offset to a mesh at vertices level

Parameters
mesh:Mesh — Mesh. The Mesh to offset
 
dx:Number — Number. The offset along the x axis
 
dy:Number — Number. The offset along the y axis
 
dz:Number — Number. The offset along the z axis
applyRotations()method 
public static function applyRotations(mesh:Mesh):void

Applys the rotation values of a mesh in object space and resets rotations to zero.

Parameters
mesh:Mesh — Mesh. The Mesh to alter
boundingRadius()method 
public static function boundingRadius(mesh:Mesh):Number

Returns the boundingRadius of an Entity of a Mesh.

Parameters
mesh:Mesh — Mesh. The mesh to get the boundingRadius from.

Returns
Number
boundingRadiusContainer()method 
public static function boundingRadiusContainer(container:ObjectContainer3D):Number

Returns the boundingRadius of a ObjectContainer3D

Parameters
container:ObjectContainer3D — ObjectContainer3D. The ObjectContainer3D and its children to get the boundingRadius from.

Returns
Number
build()method 
public static function build(vertices:Vector, indices:Vector, uvs:Vector, name:String = "", material:MaterialBase = null):Mesh

Build a Mesh from Vectors

Parameters
vertices:Vector — Vector., the vertices Vector
 
indices:Vector — Vector., the indices Vector
 
uvs:Vector — Vector., the uvs Vector
 
name:String (default = "") — [optional] String. new name for the gnerated mesh. Default = "";
 
material:MaterialBase (default = null) — [optional] MaterialBase. new name for the duplicated mesh. Default = null;

Returns
Mesh
compactData()method 
public static function compactData(m:Mesh):Mesh

unfinished: to do unique material checks, empty subgemometries & animation Returns a mesh with its subgeometries reorganized

Parameters
m:Mesh

Returns
Mesh
duplicate()method 
public static function duplicate(mesh:Mesh, newName:String = ""):Mesh

Duplicates a Mesh

Parameters
mesh:Mesh — Mesh. The mesh to duplicate
 
newName:String (default = "") — [optional] String. new name for the duplicated mesh. Default = "";

Returns
Mesh
invertContainerFaces()method 
public static function invertContainerFaces(obj:ObjectContainer3D):void

Inverts the faces of all the Meshes into an ObjectContainer3D

Parameters
obj:ObjectContainer3D — ObjectContainer3D. The ObjectContainer3D to invert.
invertFaces()method 
public static function invertFaces(mesh:Mesh):void

Inverts the faces of a Mesh

Parameters
mesh:Mesh — Mesh. The Mesh to invert.
recenter()method 
public static function recenter(mesh:Mesh):void

Recenter geometry, (its pivot is at center of geometry)

Parameters
mesh:Mesh — Mesh. The Mesh to offset
Wiki link
Click to go to the wiki page for 'away3d.tools.MeshHelper'

Code examples

Comments