I’m afraid that this is a bugger about SegmentSet Class

Software: Away3D 4.x

happy3d, Newbie
Posted: 22 March 2012 03:22 AM   Total Posts: 6
lines = new SegmentSet();
_view.scene.addChild(lines);
var 
line:LineSegment = new LineSegment(new Vector3D(0,0,0),new Vector3D(100,0,0),0x8cb1d6,0x8cb1d6,2);
var 
line1:LineSegment = new LineSegment(new Vector3D(100,0,0),new Vector3D(0,0,0),0x8cb1d6,0x8cb1d6,2);
lines.addSegment(line);
lines.addSegment(line1);
lines.removeSegment(line1); 

The FlashPlayer shows Error that out of index.

I tracked the removeSegment method of SegmentSet Class

public function removeSegmentsegment:Segment ):void {
 
//to do, add support curve indices/offset
 
var index:uint;
 for( var 
i:uint 0_segments.length; ++{
  
if( _segments[i] == segment {
   _segments
.splicei);
   
removeSegmentByIndexsegment.index );
   
_lineCount--;
  
else {
   _segments[i]
.index index;
   
index += 6;
  
}
 }
 _vertexBufferDirty 
true;
 
_indexBufferDirty true;

After I add a new code between _segments.splice(i, 1); and remove(segment.index); then ,it works…

_segments.splice(i1);
segment.index index;
remove(segment.index); 
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X