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
Determines if the mesh and geometry source(s) used for the merging are disposed.
Merge
  keepMaterial : Boolean
Determines if the material source(s) used for the merging are disposed.
Merge
  objectSpace : Boolean
Determines if source mesh(es) is/are merged using objectSpace or worldspace.
Merge
Public Methods
 MethodDefined By
  
Merge(keepMaterial:Boolean = false, disposeSources:Boolean = false, objectSpace:Boolean = false)
Merge
  
apply(receiver:Mesh, mesh:Mesh):void
Merges 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

Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false.


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

Determines if the material source(s) used for the merging are disposed. Defaults to false.


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

Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false.


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] Determines if the merged object uses the recevier mesh material information or keeps its source material(s). Defaults to false. If false and receiver object has multiple materials, the last material found in receiver submeshes is applied to the merged submesh(es).
 
disposeSources:Boolean (default = false) — [optional] Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. If true, only receiver geometry and resulting mesh are kept in memory.
 
objectSpace:Boolean (default = false) — [optional] Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false.
Method Detail
apply()method
public function apply(receiver:Mesh, mesh:Mesh):void

Merges 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 to receive the merged contents of both meshes.
 
mesh:Mesh — The Mesh to 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 to receive the merged contents of the container.
 
objectContainer:ObjectContainer3D — The ObjectContainer3D holding the meshes to be mergd.

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 to receive the merged contents of the meshes.
 
meshes:Vector.<Mesh> — A series of Meshes to be merged with the reciever mesh.