Right now I’m encountering a really strange bug, I add 500 LineSegments to a SegmentSet and as soon as I try to remove one from the Set I get the following error:
[Fault] exception, information=RangeError: Error #1125: The index 16104 is out of range 3000.
Which is very strange about that but aswell is that every line segment should consist out of 44 vertices entries in the _vertices Vector
But if I multiply the last valid index(id:1997) of the indicies vector by 11 as you do in the remove Method I would get a vertex start Index of 21967 - that index is a valid one but if I add now the 44 entries which the line needs I’am at the end index 22011 but the vertices last index is 21999 so this line would only use 32 vertices and not the needed 44.
looking forward for a quick solution
greetings
k.Aaron
P.S.: I added my add and remove functions of the line segments
segmentSet = new SegmentSet();
particles = new Vector.<LineSegment>();
private function removeParticle(i:uint) : void
{
segmentSet.removeSegment(particles[i]);
particles.splice(i, 1);
}
private function initParticle():void
{
var x:Number = Math.random() * _view.width * 2 + _camera.scenePosition.x;
var y:Number = Math.random() * _view.height + _camera.scenePosition.y;
var z:Number = Math.random() * 50 + _camera.lens.near;
var start:Vector3D = new Vector3D(x, y, z);
var end:Vector3D = new Vector3D(x, (y - rainScale * _view.scaleY), z);
var line:LineSegment = new LineSegment(start, end, 0xff0000, 0x00ff00, 10.0);
particles.push(line);
segmentSet.addSegment(line);
}