Package com.ijurnove.cpu3d
Class Camera
java.lang.Object
com.ijurnove.cpu3d.Camera
- All Implemented Interfaces:
Rotatable,Scalable,Translatable
Camera objects define a viewpoint from which a Scene can be rendered.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetFov()Returns the field of view.protected Matrixprotected MatrixReturns the parentScene.doublegetPhi()Returns the vertical rotation, in radians.getPos()Returns the position.protected Matrixprotected MatrixdoublegetTheta()Returns the horizontal rotation, in radians.protected MatrixvoidReturns the direction theCamerais looking as aVector3d.protected Matrixprotected MatrixvoidRotates this object about a given point on a specified axis.voidScales this object by a given amount from a point.voidsetFOV(double fov) Sets the field of view.voidSets the parentScene.voidsetPhi(double phi) Sets the vertical rotation.voidSets the position.voidsetTheta(double theta) Sets the horizontal rotation.protected voidtick()voidtranslate(double x, double y, double z) Shifts this object's X, Y, and Z position by the given values.protected voidprotected voidupdateOrthoMatrix(double l, double r, double b, double t, double n, double f) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ijurnove.cpu3d.Translatable
translate
-
Constructor Details
-
Camera
-
Camera
Constructs aCamerawith specified pos, phi, theta, and FOV.- Parameters:
pos- the starting positionphi- vertical rotation, in radianstheta- horizontal rotation, in radiansfov- field of view
-
-
Method Details
-
getPos
Returns the position.- Returns:
- the position of this Camera
-
getPhi
public double getPhi()Returns the vertical rotation, in radians.- Returns:
- the vertical rotation of this Camera
-
getTheta
public double getTheta()Returns the horizontal rotation, in radians.- Returns:
- the horizontal rotation of this Camera
-
getFov
public double getFov()Returns the field of view.- Returns:
- the field of view of this Camera
-
getParent
Returns the parentScene.- Returns:
- the parent Scene of this Camera
-
getVertRotMatrix
-
getHorRotMatrix
-
getPosOffsetMatrix
-
getOrthoMatrix
-
getPosMatrix
-
setPhi
public void setPhi(double phi) Sets the vertical rotation. (In radians)- Parameters:
phi- the vertical rotation to set, in radians
-
setTheta
public void setTheta(double theta) Sets the horizontal rotation. (In radians)- Parameters:
theta- the horizontal rotation to set, in radians
-
setParent
Sets the parentScene.- Parameters:
parent- the scene to set
-
setFOV
public void setFOV(double fov) Sets the field of view.- Parameters:
fov- the field of view to set
-
setPos
Sets the position.- Parameters:
pos- the position to set
-
lineOfSight
Returns the direction theCamerais looking as aVector3d.- Returns:
- the direction the Camera is looking
-
updateLineOfSight
protected void updateLineOfSight() -
updateOrthoMatrix
protected void updateOrthoMatrix(double l, double r, double b, double t, double n, double f) -
tick
protected void tick() -
lookAtWithLineOfSight
-
lookAtMatrixToOrigin
-
inputTick
public void inputTick() -
translate
public void translate(double x, double y, double z) Description copied from interface:TranslatableShifts this object's X, Y, and Z position by the given values.- Specified by:
translatein interfaceTranslatable- Parameters:
x- how far the object should be translated along the X axisy- how far the object should be translated along the Y axisz- how far the object should be translated along the Z axis
-
rotate
Description copied from interface:RotatableRotates this object about a given point on a specified axis. 0 corresponds to the X axis, 1 corresponds to the Y axis, and 2 corresponds to the Z axis. -
scale
Description copied from interface:ScalableScales this object by a given amount from a point.
-