Packageflare.utils
Classpublic class Mesh3DUtils
InheritanceMesh3DUtils Inheritance Object

The Mesh3DUtils class contains help tools to work with Mesh3D-type objects.



Public Methods
 MethodDefined By
  
[static]
Mesh3DUtils
  
merge(vector:Vector.<Pivot3D>, removeOiriginal:Boolean = true, material:Material3D = null, includeChildren:Boolean = false):Mesh3D
[static] Merges a collection of objects into a static single one to reduce draw calls.
Mesh3DUtils
  
split(mesh:Mesh3D):void
[static] Split the surfaces of the mesh if they exceds the limit of the buffer size.
Mesh3DUtils
  
transform(mesh:Mesh3D, matrix:Matrix3D):void
[static]
Mesh3DUtils
Method Detail
cloneMaterials()method
public static function cloneMaterials(pivot:Pivot3D):void

Parameters

pivot:Pivot3D

merge()method 
public static function merge(vector:Vector.<Pivot3D>, removeOiriginal:Boolean = true, material:Material3D = null, includeChildren:Boolean = false):Mesh3D

Merges a collection of objects into a static single one to reduce draw calls. The amount of draw calls / surfaces of the resulted mesh, depends directly on the amount of materials of the source mesh. Only surfaces with the same material can be marged to draw them together. If the surfaces reaches the limit of buffer sizes, they are also splited in different surfaces.

Parameters

vector:Vector.<Pivot3D> — A source vector containting all pivots you want to merge.
 
removeOiriginal:Boolean (default = true) — If the original objects should be removed from the scene once they are merged.
 
material:Material3D (default = null) — A material fitler used to only merge surfaces with a specific material.
 
includeChildren:Boolean (default = false) — if true, all pivot hierqarchy is included for each pivot in the collection of objects.

Returns
Mesh3D — A new single mesh contating all the resulted surfaces. You need to add this mesh to the scene to be displayed.
split()method 
public static function split(mesh:Mesh3D):void

Split the surfaces of the mesh if they exceds the limit of the buffer size.

Parameters

mesh:Mesh3D — The mess to be splited.

transform()method 
public static function transform(mesh:Mesh3D, matrix:Matrix3D):void

Parameters

mesh:Mesh3D
 
matrix:Matrix3D