RemoveSegment Error

Software: Away3D 4.x

k.Aaron, Newbie
Posted: 08 November 2011 11:00 AM   Total Posts: 4

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(i1);
}

private function initParticle():void

 
var x:Number Math.random() * _view.width +   _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(xyz);
 var 
end:Vector3D = new Vector3D(x, (rainScale _view.scaleY), z);
   
 var 
line:LineSegment = new LineSegment(startend0xff00000x00ff0010.0);
   
 
particles.push(line);
 
segmentSet.addSegment(line);

 

   

k.Aaron, Newbie
Posted: 08 November 2011 02:29 PM   Total Posts: 4   [ # 1 ]

nobody has the same problem or a solution for that problem :/?

   

k.Aaron, Newbie
Posted: 09 November 2011 08:53 AM   Total Posts: 4   [ # 2 ]

would be nice if someone could help me with that problem because I still can’t find a solution

   

k.Aaron, Newbie
Posted: 14 November 2011 09:53 AM   Total Posts: 4   [ # 3 ]

still not solved this issue

   

raybit, Newbie
Posted: 06 December 2011 01:57 AM   Total Posts: 1   [ # 4 ]

Hi, I encounter this problem this afternoon.
And I found there is chain-like bug in the SegmentSet:
private function remove(index : uint) : void
public function removeSegment(segment : Segment) : void
———
I do some hack as following code, but I just test the draw and remove of line (by lineSegment) not curve.

In public function removeSegment(segment : Segment) : void
else {
    _segments.index = index;
    //index += 6; +6 is not correct
    index += 44;
  }

And in private function remove(index : uint) : void
//their formula mess up… just try my fix
//and there are many methods to hack, off course
//var indVert : uint = _indices[index] * 11;
//_indices.splice(index, 6);
//_vertices.splice(indVert, 44);
 
  var indVert : uint = index/44*6;
  _indices.splice(indVert, 6);
  _vertices.splice(index, 44);

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X