mmm, I don't know what you exactly do, but as I've did the update, I've runned
a few tests.
results are identical per class:
intersect ray: Vector3D(0, 10, 20)
intersect rayThreeSix: Vector3D(0, 10, 20)
rayThreeSix == 3.6 class with updated imports
the rayDebugger class, is a private class of mine, dedicated to ray traces.
the two functions used here, are simply, 1 tracing a segment and the other
adding a cube at intersection if any.
------------
testcode
------------
private function testRay() : void
{
_rd = new RayDebugger(_view.scene);
var rayThreeSix:RayThreeSix = new RayThreeSix();
var ray:Ray = new Ray();
var v0:Vector3D = new Vector3D(-200, 100, 20);
var v1:Vector3D = new Vector3D(200, 100, 20);
var v2:Vector3D = new Vector3D(0, -200, 20);
//display the target face
_rd.traceRay(v0, v1, 0xFFFFFF);
_rd.traceRay(v1, v2, 0xFFFFFF);
_rd.traceRay(v2, v0, 0xFFFFFF);
//some destination point
var dest: Vector3D = new Vector3D(0, 10, 10);
// we trace trajectory
_rd.traceRay(_view.camera.position, dest, 0x00FF00);
var intersect:Vector3D;
intersect = ray.getIntersect(_view.camera.position,
dest, v0, v1, v2 );
trace("intersect ray: "+intersect);
//if not null --> lets add a cube at the intersect
vector
if(intersect)_rd.addPointer(intersect, 20);
intersect =
rayThreeSix.getIntersect(_view.camera.position, dest, v0, v1, v2 );
trace("intersect rayThreeSix: "+intersect);
//if not null --> lets add a cube at the intersect
vector
if(intersect)_rd.addPointer(intersect, 20);
var trident:Trident = new Trident(250, true);
_view.scene.addChild(trident);
}
here's what the above code does and looks like in Broomstickland.
http://www.closier.nl/broomstick/hit.jpg
In short both class getIntersect methods return correct and same results in
both 3.6 and 4.0.
Played with few different values and never were the results different from a
class to the other or incorrect on display/debug.
Note that it would be very strange unless a typo would have been made, because
the new one simply replace the Vector3D native methods to avoid these stupid
new construct returns.
Fabrice
On Jun 9, 2011, at 1:19 PM, John Brookes wrote:
>
> Just playing with ray.getIntersect and its not returning the right values.
>
> Just swapped the Function getIntersect from the 3.6 version into Broomstick
> and now it works.