Packageaway3d.tools.commands
Classpublic class Merge
InheritanceMerge Inheritance Object

Class Merge merges two or more static meshes into one.Merge



Public Properties
 PropertyDefined By
  disposeSources : Boolean
Defines if the mesh(es) sources used for the merging are kept or disposed.
Merge
  keepMaterial : Boolean
Defines if mesh2 will be merged using its own material information.
Merge
  objectSpace : Boolean
Defines if mesh2 is merged using its objectSpace.
Merge
Public Methods
 MethodDefined By
  
Merge(keepMaterial:Boolean = false, disposeSources:Boolean = false, objectSpace:Boolean = false)
Merge
  
apply(receiver:Mesh, mesh:Mesh):void
Merge 2 meshes into one.
Merge
  
applyToContainer(receiver:Mesh, objectContainer:ObjectContainer3D):void
Merges all the children of a container into a single Mesh.
Merge
  
applyToMeshes(receiver:Mesh, meshes:Vector.<Mesh>):void
Merges all the meshes found in the Vector.<Mesh> into a single Mesh.
Merge
Property Detail
disposeSourcesproperty
disposeSources:Boolean

Defines if the mesh(es) sources used for the merging are kept or disposed.


Implementation
    public function get disposeSources():Boolean
    public function set disposeSources(value:Boolean):void
keepMaterialproperty 
keepMaterial:Boolean

Defines if mesh2 will be merged using its own material information.


Implementation
    public function get keepMaterial():Boolean
    public function set keepMaterial(value:Boolean):void
objectSpaceproperty 
objectSpace:Boolean

Defines if mesh2 is merged using its objectSpace.


Implementation
    public function get objectSpace():Boolean
    public function set objectSpace(value:Boolean):void
Constructor Detail
Merge()Constructor
public function Merge(keepMaterial:Boolean = false, disposeSources:Boolean = false, objectSpace:Boolean = false)

Parameters
keepMaterial:Boolean (default = false) — [optional] Boolean. Defines if the merged object uses the mesh1 material information or keeps its material(s). Default is false. If set to false and receiver object has multiple materials, the last material found in mesh1 submeshes is applied to mesh2 submeshes.
 
disposeSources:Boolean (default = false) — [optional] Boolean. Defines if mesh2 (or sources meshes in case applyToContainer is used) are kept untouched or disposed. Default is false. If keepMaterial is true, only geometry and eventual ObjectContainers3D are cleared from memory.
 
objectSpace:Boolean (default = false) — [optional] Boolean. Defines if mesh2 is merge using its objectSpace or worldspace. Default is false.
Method Detail
apply()method
public function apply(receiver:Mesh, mesh:Mesh):void

Merge 2 meshes into one. It is recommand to use apply when 2 meshes are to be merged. If more need to be merged, use either applyToMeshes or applyToContainer methods.

Parameters

receiver:Mesh — The Mesh that will receive the merged contents of both meshes.
 
mesh:Mesh — The Mesh that will be merged with the receiver mesh

applyToContainer()method 
public function applyToContainer(receiver:Mesh, objectContainer:ObjectContainer3D):void

Merges all the children of a container into a single Mesh. If no Mesh object is found, method returns the receiver without modification.

Parameters

receiver:Mesh — The Mesh that will receive the merged contents of the container.
 
objectContainer:ObjectContainer3D — The ObjectContainer3D holding meshes to merge as one mesh.

applyToMeshes()method 
public function applyToMeshes(receiver:Mesh, meshes:Vector.<Mesh>):void

Merges all the meshes found in the Vector.<Mesh> into a single Mesh.

Parameters

receiver:Mesh — The Mesh that will receive the merged contents of the meshes.
 
meshes:Vector.<Mesh> — Vector.<Mesh>. A series of Meshes to be merged with the reciever mesh.