- java.lang.Object
-
- be.yildizgames.common.util.BaseRegisterable
-
- be.yildizgames.module.graphic.camera.Camera
-
- All Implemented Interfaces:
be.yildizgames.common.gameobject.Deletable,be.yildizgames.common.gameobject.Movable,be.yildizgames.common.util.Registerable,RayProvider
- Direct Known Subclasses:
DummyCamera
public abstract class Camera extends be.yildizgames.common.util.BaseRegisterable implements be.yildizgames.common.gameobject.Movable, RayProvider
Physical camera representation, contains basic operations to set the position, direction,... to use more precise behavior, see camera behaviors.- Author:
- Grégory Van den Borre
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCamera.CompositorPossible compositor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description be.yildizgames.common.gameobject.MovablegetInternal()be.yildizgames.common.geometry.Point3DgetOffset()be.yildizgames.common.geometry.Point3DgetRelativePosition()abstract be.yildizgames.common.geometry.Point3DgetTargetPosition()abstract voidinitOrigin()The targetNode will move around the camera.abstract voidinitTarget()The camera will follow the targetNode.abstract voidremoveListener(LensFlare listener)Remove a camera listener from this camera.abstract voidrotate(float yaw, float pitch)abstract voidrotateTarget(float yaw, float pitch)abstract voidsetAspectRatio(float ratio)voidsetDirection(be.yildizgames.common.geometry.Point3D direction)abstract CamerasetFarClip(int far)An object further than the provided value will not be rendered.abstract CamerasetNearClip(int near)An object closer than the provided value will not be rendered.voidsetOffset(be.yildizgames.common.geometry.Point3D offset)Set a new position offset to apply when the position is relative to another.voidsetRelativePosition(be.yildizgames.common.geometry.Point3D position)voidsetTargetPosition(float x, float y, float z)abstract voidsetTargetPosition(be.yildizgames.common.geometry.Point3D target)Set the camera targetNode position.-
Methods inherited from class be.yildizgames.common.util.BaseRegisterable
equals, getName, hashCode, toString
-
-
-
-
Constructor Detail
-
Camera
protected Camera(String name)
Simple constructor.- Parameters:
name- Camera unique name.
-
-
Method Detail
-
setFarClip
public abstract Camera setFarClip(int far)
An object further than the provided value will not be rendered.- Parameters:
far- Maximum rendering distance.- Returns:
- This object for chaining.
-
setNearClip
public abstract Camera setNearClip(int near)
An object closer than the provided value will not be rendered.- Parameters:
near- Minimum rendering distance.- Returns:
- This object for chaining.
-
setDirection
public final void setDirection(be.yildizgames.common.geometry.Point3D direction)
- Specified by:
setDirectionin interfacebe.yildizgames.common.gameobject.Movable
-
getInternal
public final be.yildizgames.common.gameobject.Movable getInternal()
- Specified by:
getInternalin interfacebe.yildizgames.common.gameobject.Movable
-
setTargetPosition
public abstract void setTargetPosition(be.yildizgames.common.geometry.Point3D target)
Set the camera targetNode position.- Parameters:
target- Camera targetNode position value.
-
setTargetPosition
public final void setTargetPosition(float x, float y, float z)
-
rotateTarget
public abstract void rotateTarget(float yaw, float pitch)
-
removeListener
public abstract void removeListener(LensFlare listener)
Remove a camera listener from this camera.- Parameters:
listener- Listener to remove.
-
getOffset
public final be.yildizgames.common.geometry.Point3D getOffset()
- Returns:
- The camera offset.
-
setOffset
public final void setOffset(be.yildizgames.common.geometry.Point3D offset)
Set a new position offset to apply when the position is relative to another.- Parameters:
offset- Offset to set.
-
setAspectRatio
public abstract void setAspectRatio(float ratio)
-
getTargetPosition
public abstract be.yildizgames.common.geometry.Point3D getTargetPosition()
-
setRelativePosition
public void setRelativePosition(be.yildizgames.common.geometry.Point3D position)
-
getRelativePosition
public be.yildizgames.common.geometry.Point3D getRelativePosition()
-
initOrigin
public abstract void initOrigin()
The targetNode will move around the camera.
-
initTarget
public abstract void initTarget()
The camera will follow the targetNode.
-
rotate
public abstract void rotate(float yaw, float pitch)
-
-