Package | flare.utils |
Class | public class Mesh3DUtils |
Inheritance | Mesh3DUtils ![]() |
Method | Defined By | ||
---|---|---|---|
cloneMaterials(pivot:Pivot3D):void [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 | ||
[static]
Split the surfaces of the mesh if they exceds the limit of the buffer size. | Mesh3DUtils | ||
[static] | Mesh3DUtils |
cloneMaterials | () | method |
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.
|
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 |