Hi.

I'm pretty sure there's a bug in the javax.media.j3d.PickCylinderSegment

class of J3D 1.2.1 beta1. I couldn't find anything related in the bug
database.

I encountered some strange problems with my collision detection picking
and after a lot of wondering and some testing I found out that the

PickCylinderSegment.set( Point3d start, Point3d end, double radius)

method does not set the internal end value whereas the constructor does.

Try the attached piece of code and you should see.
For me it's output looks like this:

    start in: 1.0/1.0/1.0
    end in: 2.0/2.0/2.0

    end out after set method: 0.0/0.0/0.0

    end out after constructor: 2.0/2.0/2.0


I think the last two lines should look the same ... ;)

Bye,

Hendrik
import javax.vecmath.*;
import javax.media.j3d.*;

public class PickBug{

    public static void main( String[] args ){

        Point3d startIn = new Point3d( 1f, 1f, 1f );
        Point3d endIn = new Point3d( 2f, 2f, 2f );

        System.out.println( "start in: " + startIn.x + "/" + startIn.y + "/" + 
startIn.z + "" );
        System.out.println( "end in: " + endIn.x + "/" + endIn.y + "/" + endIn.z + "" 
);

        PickCylinderSegment seg = new PickCylinderSegment();

        seg.set( startIn, endIn, 1d ); // DOES NOT SEEM TO SET "END"

        Point3d endOut = new Point3d();
        seg.getEnd( endOut );
        System.out.println( "end out after set method: " + endOut.x + "/" + endOut.y + 
"/" + endOut.z + "\n" );


        seg = new PickCylinderSegment( startIn, endIn, 1d); // SETS "END"

        endOut = new Point3d();
        seg.getEnd( endOut );
        System.out.println( "end out after constructor: " + endOut.x + "/" + endOut.y 
+ "/" + endOut.z + "\n" );

    }
}

Reply via email to