Created
March 7, 2013 11:48
-
-
Save kenpower/5107513 to your computer and use it in GitHub Desktop.
Orient a missile
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
public override void Draw(GameTime gametime, Camera camera) | |
{ | |
Matrix orientation = Matrix.CreateFromYawPitchRoll(yawAngle, 0, 0); | |
Matrix world = orientation * Matrix.CreateTranslation(position); | |
foreach (ModelMesh m in model.Meshes) | |
{ | |
foreach (BasicEffect e in m.Effects) | |
{ | |
e.EnableDefaultLighting(); | |
e.World = world; | |
e.Projection = camera.Projection; | |
e.View = camera.View; | |
} | |
m.Draw(); | |
} | |
base.Draw(gametime, camera); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment