Package boofcv.gui.mesh
Class FirstPersonShooterCamera
java.lang.Object
boofcv.gui.mesh.FirstPersonShooterCamera
Contains the math for adjusting a camera using first person shooting inspired keyboard and mouse controls.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleHow much it will move in a single translation step -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidmouseDragPanTilt(double x0, double y0, double x1, double y1) Performs a pan tilt motion given a mouse that has been dragged between the two provided pointsvoidmouseDragRoll(double x0, double y0, double x1, double y1) Performs a roll motion given a mouse that has been dragged between the two provided points.voidvoidtranslateKey(int dx, int dy, int dz, double scale) Translation from a keyboard press.
-
Field Details
-
motionUnit
public double motionUnitHow 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, 1dy- Motion along the y-axis. Expected value of -1, 0, 1dz- Motion along the z-axis. Expected value of -1, 0, 1scale- 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.
-