Created
December 7, 2013 21:33
-
-
Save ZachMassia/7849065 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// An alternative to this method is to use a small hierarchy of | |
// nodes with the camera being attached to the deepest child node. | |
// With this alternative method, you would not have to manually place | |
// and rotate your spotlight. It also avoids gimbal lock. | |
// | |
// Here is where I got most of the code for my FPS setup for lab 4: | |
// http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Creating+a+simple+first-person+camera+system | |
void yourUpdateFunc() | |
{ | |
// Ray cast in camera look direction. | |
Ogre::Ray r; | |
r.setDirection(mCamera->getDirection()); | |
r.setOrigin(mCamera->getPosition()); | |
// You could also set your spotlight direction to the ray direction, | |
// and the spotlight position to the ray position. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment