Class FirstPersonShooterCamera

java.lang.Object
boofcv.gui.mesh.FirstPersonShooterCamera

public class FirstPersonShooterCamera extends Object
Contains the math for adjusting a camera using first person shooting inspired keyboard and mouse controls.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    How much it will move in a single translation step
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    mouseDragPanTilt(double x0, double y0, double x1, double y1)
    Performs a pan tilt motion given a mouse that has been dragged between the two provided points
    void
    mouseDragRoll(double x0, double y0, double x1, double y1)
    Performs a roll motion given a mouse that has been dragged between the two provided points.
    void
     
    void
    translateKey(int dx, int dy, int dz, double scale)
    Translation from a keyboard press.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • motionUnit

      public double motionUnit
      How much it will move in a single translation step
  • Constructor Details

    • FirstPersonShooterCamera

      public FirstPersonShooterCamera()
  • Method Details

    • resetView

      public void resetView()
    • translateKey

      public void translateKey(int dx, int dy, int dz, double scale)
      Translation from a keyboard press. Directions are assumed to be -1,0,1. Scale is used to increase the amount of motion or decrease it.
      Parameters:
      dx - Motion along the x-axis. Expected value of -1, 0, 1
      dy - Motion along the y-axis. Expected value of -1, 0, 1
      dz - Motion along the z-axis. Expected value of -1, 0, 1
      scale - Scale factor applied to nominal motion
    • mouseDragPanTilt

      public void mouseDragPanTilt(double x0, double y0, double x1, double y1)
      Performs a pan tilt motion given a mouse that has been dragged between the two provided points
    • mouseDragRoll

      public void mouseDragRoll(double x0, double y0, double x1, double y1)
      Performs a roll motion given a mouse that has been dragged between the two provided points.