GetRay
Introduction
Code Example
void CustomInitialize()
{
// Add a circle for reference:
Circle circle = ShapeManager.AddCircle();
circle.Radius = 64;
// so we can see the cursor:
FlatRedBallServices.Game.IsMouseVisible = true;
}
void CustomActivity(bool firstTimeCalled)
{
var ray = GuiManager.Cursor.GetRay();
FlatRedBall.Debugging.Debugger.Write(
"Ray Position: " + ray.Position + "\n" +
"Ray Direction: " + ray.Direction);
// let's move the camera around too to make sure this works:
const float velocity = 50;
InputManager.Keyboard.ControlPositionedObject(Camera.Main, velocity);
}
Community Code
Last updated
Was this helpful?