Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry.convertToSeparateBuffers bug #491

Closed
nixxle opened this issue Mar 15, 2013 · 1 comment
Closed

Geometry.convertToSeparateBuffers bug #491

nixxle opened this issue Mar 15, 2013 · 1 comment
Assignees
Labels

Comments

@nixxle
Copy link
Contributor

nixxle commented Mar 15, 2013

convertToSeparateBuffers does not parse the whole subgeometry array. It removes compactSubgeometry elements in the loop, messing with the array order and causing it to skip over certain indices.

proposed solution:

public function convertToSeparateBuffers() : void
    {
        var subGeom : ISubGeometry;
        var numSubGeoms : int = _subGeometries.length;          
        var _removableCompactSubGeometries:Vector.<CompactSubGeometry> =  new Vector.<CompactSubGeometry>;

        for (var i : int = 0; i < numSubGeoms; ++i) {
            subGeom = _subGeometries[i];
            if (subGeom is SubGeometry) continue;
            _removableCompactSubGeometries.push(subGeom);
            addSubGeometry(subGeom.cloneWithSeperateBuffers());
        }

        for each(var s:CompactSubGeometry in _removableCompactSubGeometries) {
            removeSubGeometry(s);
            s.dispose();
        }
    }
@ghost ghost assigned Fabrice3D Mar 22, 2013
rob-bateman added a commit that referenced this issue Apr 24, 2013
@rob-bateman
Copy link
Member

fixed in 58e0b2c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants