brlrt / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

PathAlignModifier.duplicateMesh() does not clone vertices #112

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a yUp=false Plane primitive
2. Create a new instance of PathAlignModifier and pass it the Plane at 
instantiation

What is the expected output? What do you see instead?

PathAlignModifier seems to be written specifically for TextField3D 
alignment, but with a minor adjustment I think it can be used to align any 
Mesh

What version of the product are you using? On what operating system?
3.5.0 Away3D / WinXP

Please provide any additional information below.

Here's the fix I'm using right now:

private function duplicateMesh(mesh:Mesh):void 
{ 
    _activeMesh = mesh; 
    _originalMesh = new Mesh(); 
    for each(var face:Face in mesh.faces) 
    { 
        //duplicate the vertices 
        var clone:Face = face.clone(); 
        if(face.v0 != null) { 
            clone.v0 = face.v0.clone(); 
            clone.v1 = face.v1.clone(); 
            clone.v2 = face.v2.clone(); 
        } 
        _originalMesh.addFace(clone); 
    } 
}

Original issue reported on code.google.com by kle...@gmail.com on 2 May 2010 at 11:33