Created
April 29, 2014 14:46
-
-
Save jrenner/11402525 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector3 forwardInRest = Vector3.Z; // object's front is facing Z | |
Vector3 target = tmp.set(Input.worldMouse); // object should face mouse | |
q.setFromCross(forwardInRest, target.sub(pos).nor()); | |
gameObj.transform.set(q); | |
gameObj.transform.setTranslation(pos); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment