我的个人项目使用Away3D作为3D引擎,使用Jiglib作为物理引擎。 Jiglib支持Away3D作为插件,就像PaperVision3D一样。基本上,我设法创建了立方体互相碰撞和碰撞。但是,每当用户按下多维数据集时,我需要更多的用户交互,更具体的术语:当用户按住多维数据集时,能够丢弃或拖动多维数据集。在Jiglib与PaperVision3D的结合中,有些人通过使用:
成功实现了这一目标mesh.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, objectPressHandler);
private function objectPressHandler(event:InteractiveScene3DEvent):void
{
//get ref.
pActive = event.displayObject3D;
//create constriant
jMouseConstraint = new MouseConstraint(pActive, new Number3D(0, 0, 1), camera, viewport);
//add listener for mouse up.
stage.addEventListener(MouseEvent.MOUSE_UP, removeMouseConstraint);
}
private function removeMouseConstraint(e:MouseEvent):void
{
//kill listener
stage.removeEventListener(MouseEvent.MOUSE_UP, removeMouseConstraint);
//kill the contraint
jMouseConstraint.destroy();
//garbage
jMouseConstraint = null;
}
但是我不知道如何使用Jiglib和Away3D实现相同的目标。有什么帮助吗?