Packageaway3d.tools
Classpublic class Merge

Class Merge merges two or more meshes into one.Merge Doesn't support Animation Merging (yet)

Public Properties
 PropertyDefined by
  disposeSources : Boolean
Merge
  keepmaterial : Boolean
[write-only] Defines if mesh2 will be merged using its own material information.
Merge
  keepMaterial : Boolean
[read-only]
Merge
  objectspace : Boolean
Merge
Public Methods
 MethodDefined by
  
Merge
(objectspace:Boolean = false, keepMaterial:Boolean = false, disposeSources:Boolean = false)
Merge
  
apply(mesh1:Mesh, mesh2:Mesh):void
Merge 2 meshes into one
Merge
  
Merges all the children of a container as one single Mesh.
Merge
Property detail
disposeSourcesproperty
disposeSources:Boolean  [read-write]Implementation
    public function get disposeSources():Boolean
    public function set disposeSources(value:Boolean):void
keepmaterialproperty 
keepmaterial:Boolean  [write-only]

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

Implementation
    public function set keepmaterial(value:Boolean):void
keepMaterialproperty 
keepMaterial:Boolean  [read-only]Implementation
    public function get keepMaterial():Boolean
objectspaceproperty 
objectspace:Boolean  [read-write]Implementation
    public function get objectspace():Boolean
    public function set objectspace(value:Boolean):void
Constructor detail
Merge()constructor
public function Merge(objectspace:Boolean = false, keepMaterial:Boolean = false, disposeSources:Boolean = false)Parameters
objectspace:Boolean (default = false) — objectspace [optional] Boolean. Defines if mesh2 is merge using its objectspace or worldspace. Default is false.
 
keepMaterial:Boolean (default = false) — keepMaterial [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 reciever object has multiple materials, the last material found in mesh1 submeshes is applied to mesh2 submeshes.
 
disposeSources:Boolean (default = false) — disposeSources [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.
Init Parameters
Method detail
apply()method
public function apply(mesh1:Mesh, mesh2:Mesh):void

Merge 2 meshes into one

Parameters
mesh1:Mesh — mesh1 Mesh. The receiver object that will hold both meshes information.
 
mesh2:Mesh — mesh2 Mesh. The Mesh object to be merge with mesh1.
applyToContainer()method 
public function applyToContainer(object:ObjectContainer3D):Mesh

Merges all the children of a container as one single Mesh. The first Mesh child encountered becomes the reciever. This is mesh that is returned. If no Mesh object is found, class returns null.

Parameters
object:ObjectContainer3D — objectContainer

Returns
Mesh — The merged Mesh instance
Wiki link
Click to go to the wiki page for 'away3d.tools.Merge'

Code examples

Comments