I'm new to papervision 3d and I created two display objects in basic view.
Here's a part of the code :
...
_stick = new Cube(materials, 50, 5, 500);
_ball = new Sphere(new ColorMaterial(0xfc0000), 80);
In the onRenderTick
method, I tried to check whether two objects are hitted
override protected function onRenderTick(event:Event=null):void {
super.onRenderTick(event);
_stick.rotationY = stage.mouseX / stage.width * 360;
_stick.rotationX = stage.mouseY / stage.height * 360;
if (stick.hitTestObject(this.ball)) {
trace ("hit");
}
}
However, stick.hitTestObject
always returns false even if the stick really hits the ball as I see in the flash.
Any help is appreciated ~ Thanks!