Jump to content

Clamp lookAt rotation


bma73
 Share

Recommended Posts

Hi,

I'm working on a tank game and want to clamp the turret's rotation to a specific angle.
The turret is a child of the tank body and rotates with the body. It shall automatically rotate towards a target and should stop after an offset e.g. +/-45° from the body's forward vector is reached.

b1ESXK5.jpg

http://babylonjs-playground.com/#TIXAM#6

Does anybody know how to achieve that?

Thank you!

 

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...