Jump to content

[Closed] Mesh.lookAt rotates mesh, but not really..


aWeirdo
 Share

Recommended Posts

Hi, i notised this bug a while ago, but never got around to reporting it before now,

As shown in the following PG, the mesh.lookAt appears to rotate the mesh and the mesh "looks" at the object, but it doesn't actually update the mesh.rotation.

the lookAt target is a sphere aproximately 45* from starting point.

PG controls:

left mouse click: lookAt & move based on mesh.rotation.y.

mouse wheel click: rotate 90* and move based on mesh.rotation.y.

right mouse click: move based on starting mesh.rotation.y.

http://www.babylonjs-playground.com/#BJZC6#3

 

The lookAt method also seems to lock the target on 0 rotation.y, any new changes are completely ignored / overwritten.

Console.log's of before and after each action (right-click only log's one line).

1 left mouse click(LookAt) & 2 mouse wheel clicks(+90*):

VM379:45 Box.rotation.y Before lookAt: 0
VM379:48 Box.rotation.y After lookAt: 0
VM379:50 Box.rotation.y Before 90* rotation: 0
VM379:53 Box.rotation.y After 90* rotation: 1.5707963267948966
VM379:50 Box.rotation.y Before 90* rotation: 0
VM379:53 Box.rotation.y After 90* rotation: 1.5707963267948966

 

1 mouse wheel click(+90*) & 1 left mouse click(lookAt) & another mouse wheel click.

VM385:50 Box.rotation.y Before 90* rotation: 0
VM385:53 Box.rotation.y After 90* rotation: 1.5707963267948966
VM385:45 Box.rotation.y Before lookAt: 1.5707963267948966
VM385:48 Box.rotation.y After lookAt: 0 //reset to 0..?
VM385:50 Box.rotation.y Before 90* rotation: 0
VM385:53 Box.rotation.y After 90* rotation: 1.5707963267948966 //This doesn't effect anything.

 

4 mouse wheel clicks(+90*):

VM378:50 Box.rotation.y Before 90* rotation: 0
VM378:53 Box.rotation.y After 90* rotation: 1.5707963267948966
VM378:50 Box.rotation.y Before 90* rotation: 1.5707963267948966
VM378:53 Box.rotation.y After 90* rotation: 3.141592653589793
VM378:50 Box.rotation.y Before 90* rotation: 3.141592653589793
VM378:53 Box.rotation.y After 90* rotation: 4.71238898038469
VM378:50 Box.rotation.y Before 90* rotation: 4.71238898038469
VM378:53 Box.rotation.y After 90* rotation: 6.283185307179586

 

1 right-mouse click(no rotation altering) & 2 mouse wheel clicks(+90*) & 1 right-mouse click again:

VM380:55 Right-click, No rotation altering: 0
VM380:50 Box.rotation.y Before 90* rotation: 0
VM380:53 Box.rotation.y After 90* rotation: 1.5707963267948966
VM380:50 Box.rotation.y Before 90* rotation: 1.5707963267948966
VM380:53 Box.rotation.y After 90* rotation: 3.141592653589793
VM380:55 Right-click, No rotation altering: 3.141592653589793

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...