ok, ive had this problem for a while, but i never got a chance to actually look into it. and today i gave it a try, but i just cant get a clue…
i set up a collision detection method by using ray.
the first click always result in a ray direction of (0,0,1) which is not correct. and after that, everything works fine.
whats the problem here.
heres a part of the code
Vector3f mouseWorldCoords = this.display.getWorldCoordinates(mouseScreenCoords, 0);
Vector3f mouseWorldCoords2 = this.display.getWorldCoordinates(mouseScreenCoords, 1);
Vector3f direction = mouseWorldCoords2.subtractLocal(mouseWorldCoords).normalizeLocal();
Ray ray = new Ray(mouseWorldCoords, direction);
i have another problem, my character cant move to a position when the camera is facing one direction, but it works fine if the camera rotates to another direction.
i think there might be some problems with the getWorldCoordinates() method.
Not sure this is related to the second problem, but getModelViewMatrix initializes the needed matrix when called the first time. Probably there's a bug in the initialization causing the first problem, but I have no time to debug that.
Not sure this is related to the second problem, but getModelViewMatrix initializes the needed matrix when called the first time. Probably there's a bug in the initialization causing the first problem, but I have no time to debug that.
thx for the info, ill c if i can debug it.
and since im not an expert...still need help on this~ :lol:
Confirmed and hot-fixed: instead of calling onFrameChange, doFrameChange is called (with lwjgl calls) now. In multi-threaded (or multi-context) apps this means getWorld/ScreenCoordinates must be called in the correct thread/context the first time it is called.