by cursor's relative position.
To understand my question, you might need to know what I am doing.
I implemented my camera in 2 mode..
1) walking(move front/back/strafe)
and panning(look up/down,turn left/right)
--> this is simply FPS mode without keyboard.
2) drag and drop mode
(you can pick up some stuff and move)
--> disabled FPS mode(Camera will be in the same position)
# Note: I cannot use keyboard, so I am switching two mode by clicking
mouse RButton. and my cursor is not locked in the middle of the screen.
OK!!!! Here goes my question.
Let's say...there is an object(box) in the room(bigger box).
it will look like this..
--------------------------------------
^
room
____ x <--- mouse pointer
|___|\
|___| |
|___|/
^
object(box)
--------------------------------------
Can I detect if mouse cursor is on the object..??
This is how I navigate and pan only with mouse.
Code: Select all
// navigate and pan by mouse(cursor) position
// +----------------------+
// | | 10 | |
// |---+--------------+---|
// | | 1 | 2 | 3 | |
// | |--------------| |
// | 11| 4 | 5 | 6 | 12|
// | |--------------| |
// | | 7 | 8 | 9 | |
// |---+--------------+---|
// | | 13 | |
// +----------------------+
// navigation (area 1~9)
// 1 : move_forward + strafe_left
// 2 : move_forward
// 3 : move_forward + strafe_right
// 4 : strafe_left
// 5 : stop
// 6 : strafe_right
// 7 : move_backward + strafe_left
// 8 : move_backward
// 9 : move_backward + strafe_right
// panning (area 10 ~ 13)
// 10 / 13 : look up /down (until 90 degree and come back after panning mode)
// 11 / 12 : turn left / right (it will turn and stay)