Hi, i found bug with SegmentSet in last Away3D release. If i once created SegmentSet it works normal, but if I dynamically add segments, SegmentSet is not shown.
For example, this code works:
private function init():void
{
_lineSet = new SegmentSet();
_view.scene.addChild(_lineSet);
for(var i:uint; i < 3; ++i)
{
var start:Vector3D = new Vector3D(Math.random() * 500, Math.random() * 500, Math.random() * 500);
var end:Vector3D = new Vector3D(Math.random() * 500, Math.random() * 500, Math.random() * 500);
var line:LineSegment = new LineSegment(start, end, 0xFFFFFF * Math.random());
_lineSet.addSegment(line);
}
stage.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
private function handleEnterFrame(event:Event):void
{
_view.render();
}
This code not works:
private function onMouseUp(event:MouseEvent3D):void
{
var start:Vector3D = new Vector3D(Math.random() * 500, Math.random() * 500, Math.random() * 500);
var end:Vector3D = new Vector3D(Math.random() * 500, Math.random() * 500, Math.random() * 500);
var line:LineSegment = new LineSegment(start, end, 0xFFFFFF * Math.random());
_lineSet.addSegment(line);
}
And this code too:
private function handleEnterFrame(event:Event):void
{
var start:Vector3D = new Vector3D(Math.random() * 500, Math.random() * 500, Math.random() * 500);
var end:Vector3D = new Vector3D(Math.random() * 500, Math.random() * 500, Math.random() * 500);
var line:LineSegment = new LineSegment(start, end, 0xFFFFFF * Math.random());
_lineSet.addSegment(line);
_view.render();
}
P.S. due to this bug, DebugDraw doesn’t work in AwayPhysics.