由用户创建的信息 dallas3d
24 November 2015 14:24
One last thing and I'm all set:
I would like to be able to use the mouse pointer to click-select objects in the same scene. Pointerlock interferes with that. How do I integrate the two 'modes' smoothly? If possible I'd like to have the pointerlock only engaged when the lmb is being held down, or, if not, do this in a way that avoids pointerlock.
To boil it down in simple statements:
- lmb held down -> rotate character/camera
- lmb clicked -> select object in scene
Thanks for all the help, this thing's been a real headache so it'll be nice to put it to bed.
I would like to be able to use the mouse pointer to click-select objects in the same scene. Pointerlock interferes with that. How do I integrate the two 'modes' smoothly? If possible I'd like to have the pointerlock only engaged when the lmb is being held down, or, if not, do this in a way that avoids pointerlock.
To boil it down in simple statements:
- lmb held down -> rotate character/camera
- lmb clicked -> select object in scene
Thanks for all the help, this thing's been a real headache so it'll be nice to put it to bed.
24 November 2015 13:48
24 November 2015 13:22
23 November 2015 20:30
22 November 2015 00:13
Since my last post went in a different (but important) direction, I'm going to shift my big problem over here. I'm also going to explain in another way, hopefully making my problem clearer.
I want to know how to replace the second part of the code with manifolds so that it can be used with the first (I used semi-stiff constraint in my scene, because I want to be able to rotate the camera up and down independently of the character).
code to be replaced:
I can refine the rest after, but this is where I'm still stuck.
I want to know how to replace the second part of the code with manifolds so that it can be used with the first (I used semi-stiff constraint in my scene, because I want to be able to rotate the camera up and down independently of the character).
var rotate_left_right = m_ctl.create_mouse_move_sensor("X");
var rotate_up_down = m_ctl.create_mouse_move_sensor("Y")
code to be replaced:
if (oldX < e.pageX) {
m_phy.character_rotation_inc(_character, -.01, 0);
} else {
m_phy.character_rotation_inc(_character, .01, 0);
}
if (oldY < e.pageY) {
_camang = m_cam.get_camera_angles(_cam);
_camang[1] = _camang[1] - _caminc;
m_cam.rotate_camera(_cam, _camang[0], _camang[1], true, true);
} else {
_camang = m_cam.get_camera_angles(_cam);
_camang[1] = _camang[1] + _caminc;
m_cam.rotate_camera(_cam, _camang[0], _camang[1], true, true);
}
oldX = e.pageX;
oldY = e.pageY;
I can refine the rest after, but this is where I'm still stuck.
21 November 2015 02:50
Evgeny - glad I helped with a fix!
After tweaking my code based on ben's example, I am still having issues with mouse-controlled rotation. I'm sure I'm missing something. I've attached my .js file so that I can finally get this resolved.
Also, I guess the above mouse.js fix gets applied when you compile the engine - is there a way to do this with the existing b4w engine file(s)? If not, what's the easiest way to tie my existing project in with the new management system? I tend to want to get stuff done fast, and up to now it's been convenient to do things the old way. Thanks.
After tweaking my code based on ben's example, I am still having issues with mouse-controlled rotation. I'm sure I'm missing something. I've attached my .js file so that I can finally get this resolved.
Also, I guess the above mouse.js fix gets applied when you compile the engine - is there a way to do this with the existing b4w engine file(s)? If not, what's the easiest way to tie my existing project in with the new management system? I tend to want to get stuff done fast, and up to now it's been convenient to do things the old way. Thanks.
20 November 2015 11:49
So, in other words, when the camera is attached to a character jitter will always result if semi soft cam (or some more complex workaround) isn't used?
Also, does this have any impact on using mouse x-y movement instead of keys? For what I want to do, I need to have that mouse control. Thanks.
Also, does this have any impact on using mouse x-y movement instead of keys? For what I want to do, I need to have that mouse control. Thanks.
20 November 2015 07:51
19 November 2015 23:51