Helper Class for the Mesh object
MeshHelper
A series of methods usually usefull for mesh manipulations
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
|
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
|
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
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
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
public static function compactData(m:Mesh):Mesh
unfinished: to do unique material checks, empty subgemometries & animation
Returns a mesh with its subgeometries reorganized
Parameters
Returns
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
public static function invertContainerFaces(obj:ObjectContainer3D):void
Inverts the faces of all the Meshes into an ObjectContainer3D
Parameters
public static function invertFaces(mesh:Mesh):void
Inverts the faces of a Mesh
Parameters
| mesh:Mesh — Mesh. The Mesh to invert.
|
public static function recenter(mesh:Mesh):void
Recenter geometry, (its pivot is at center of geometry)
Parameters
| mesh:Mesh — Mesh. The Mesh to offset
|