public abstract class Camera
extends be.yildizgames.common.util.BaseRegisterable
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Camera.Compositor |
Possible compositor.
|
| Modifier | Constructor | Description |
|---|---|---|
protected |
Camera(String name) |
Simple constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addListener(CameraListener listener) |
Add a listener to this camera.
|
abstract void |
autoTrack(be.yildizgames.common.geometry.Point3D position) |
Auto track a given position, camera will always target that position.
|
void |
autoTrack(Node e) |
Auto track a given entity, camera will always target that entity.
|
protected abstract void |
autoTrackImpl(Node node) |
Implementation specific auto track.
|
abstract be.yildizgames.common.geometry.Point3D |
computeMoveDestination(int x,
int y) |
Compute a point from a click on the screen.
|
be.yildizgames.common.geometry.Point3D |
getDirection() |
|
protected abstract be.yildizgames.common.geometry.Point3D |
getDirectionImpl() |
|
be.yildizgames.common.geometry.Point3D |
getOffset() |
|
be.yildizgames.common.geometry.Point3D |
getPosition() |
|
be.yildizgames.common.geometry.Point3D |
getTrackPosition() |
|
boolean |
isAutoTrack() |
|
void |
lookAt(be.yildizgames.common.geometry.Point3D target) |
Set the camera target position.
|
void |
lookAt(be.yildizgames.common.geometry.Point3D pos,
be.yildizgames.common.geometry.Point3D target) |
Set the camera position and target position.
|
protected abstract be.yildizgames.common.geometry.Point3D |
lookAtImpl(be.yildizgames.common.geometry.Point3D target) |
Set looking at in implementation.
|
void |
move(float moveX,
float moveY,
float moveZ) |
Move the camera following the camera implementation.
|
void |
move(be.yildizgames.common.geometry.Point3D moveVector) |
Move the camera following the camera implementation.
|
protected abstract be.yildizgames.common.geometry.Point3D |
moveImpl(float moveX,
float moveY,
float moveZ) |
Call the move in implementation.
|
void |
moveXZ(float x,
float z) |
Move the camera on 2 axis only, Y value is kept unchanged.
|
abstract void |
removeListener(LensFlare listener) |
Remove a camera listener from this camera.
|
void |
rotate(float yaw,
float pitch) |
Rotate the camera following X and Y coordinates.
|
void |
rotate(be.yildizgames.common.geometry.Point2D rotation) |
Rotate the camera following a point coordinates.
|
protected abstract be.yildizgames.common.geometry.Point3D |
rotateImpl(float yaw,
float pitch) |
Call the rotation in implementation.
|
void |
setDirection(float dirX,
float dirY,
float dirZ) |
Set the camera direction.
|
void |
setDirection(be.yildizgames.common.geometry.Point3D newDirection) |
Set the camera direction.
|
void |
setOffset(be.yildizgames.common.geometry.Point3D offset) |
Set a new position offset to apply when the position is relative to another.
|
protected abstract be.yildizgames.common.geometry.Point3D |
setOrientationImpl(float x,
float y,
float z) |
Call implementation to set the direction.
|
void |
setPosition(float posX,
float posY,
float posZ) |
Set the camera position.
|
void |
setPosition(int newPositionX,
int newPositionY,
be.yildizgames.common.geometry.Axis axis) |
Set the position from 2D coordinates.
|
void |
setPosition(be.yildizgames.common.geometry.Point2D newPosition,
be.yildizgames.common.geometry.Axis axis) |
Set the position from 2D coordinates.
|
void |
setPosition(be.yildizgames.common.geometry.Point3D newPosition) |
Set the camera position.
|
protected abstract void |
setPositionImpl(float posX,
float posY,
float posZ) |
Call implementation to set the position.
|
protected abstract be.yildizgames.common.geometry.Point3D |
setPositionImpl(int x,
int y,
be.yildizgames.common.geometry.Axis axis) |
Call implementation to set the position.
|
void |
setRelativePosition(be.yildizgames.common.geometry.Point3D p) |
Set the camera relative position, this is used to set given a position as the base.
|
be.yildizgames.common.geometry.Point3D |
setXZPosition(be.yildizgames.common.geometry.Point3D newPosition) |
Set the camera position without modifying Y value.
|
void |
stopAutoTrack() |
Stop auto tracking an entity or a position.
|
void |
stopAutoTrack(Node node) |
Stop auto tracking an entity.
|
protected abstract void |
stopAutoTrackImpl() |
Implementation specific stop auto track.
|
abstract List<be.yildizgames.common.model.EntityId> |
throwPlaneRay(be.yildizgames.common.geometry.Rectangle rectangle) |
Throw a rectangle and return all entity id contained in it.
|
abstract Optional<be.yildizgames.common.model.EntityId> |
throwRay(int x,
int y) |
|
Optional<be.yildizgames.common.model.EntityId> |
throwRay(be.yildizgames.common.geometry.Point2D coordinate) |
Throw a ray to get the id of the first entity hit.
|
protected abstract void |
yaw(float angle) |
Rotate the camera along its X axis.
|
protected Camera(String name)
name - Camera unique name.public final void setRelativePosition(be.yildizgames.common.geometry.Point3D p)
p - Position to set.public final void addListener(CameraListener listener)
listener - Listener to add.public final be.yildizgames.common.geometry.Point3D getDirection()
public final void setDirection(be.yildizgames.common.geometry.Point3D newDirection)
newDirection - New direction.public final be.yildizgames.common.geometry.Point3D getPosition()
public final void setPosition(be.yildizgames.common.geometry.Point3D newPosition)
newPosition - Camera new position.public final void lookAt(be.yildizgames.common.geometry.Point3D target)
target - Camera target position value.public final void setPosition(float posX,
float posY,
float posZ)
posX - Camera position x value.posY - Camera position y value.posZ - Camera position z value.public final be.yildizgames.common.geometry.Point3D setXZPosition(be.yildizgames.common.geometry.Point3D newPosition)
newPosition - Camera new position.public final void setPosition(be.yildizgames.common.geometry.Point2D newPosition,
be.yildizgames.common.geometry.Axis axis)
newPosition - 2D position.axis - Axis to use to retrieve 3D position.public final void setPosition(int newPositionX,
int newPositionY,
be.yildizgames.common.geometry.Axis axis)
newPositionX - 2D position X.newPositionY - 2D position Y.axis - Axis to use to retrieve 3D position.public final void move(be.yildizgames.common.geometry.Point3D moveVector)
moveVector - Vector used to move the camera.public final void move(float moveX,
float moveY,
float moveZ)
moveX - X value to move the camera.moveY - Y value to move the camera.moveZ - Z value to move the camera.public final void moveXZ(float x,
float z)
x - X value to move the camera.z - Z value to move the camera.public final void setDirection(float dirX,
float dirY,
float dirZ)
dirX - Direction X value.dirY - Direction Y value.dirZ - Direction Z value.public final void lookAt(be.yildizgames.common.geometry.Point3D pos,
be.yildizgames.common.geometry.Point3D target)
pos - Camera position.target - Camera target position.public final void rotate(be.yildizgames.common.geometry.Point2D rotation)
rotation - Coordinates to use to rotate.public final void rotate(float yaw,
float pitch)
yaw - X rotation value.pitch - Y rotation value.public abstract be.yildizgames.common.geometry.Point3D computeMoveDestination(int x,
int y)
x - Screen coordinates X.y - Screen coordinates Y.public abstract List<be.yildizgames.common.model.EntityId> throwPlaneRay(be.yildizgames.common.geometry.Rectangle rectangle)
rectangle - Rectangle to throw.public final Optional<be.yildizgames.common.model.EntityId> throwRay(be.yildizgames.common.geometry.Point2D coordinate)
coordinate - Coordinates to send the ray.public abstract Optional<be.yildizgames.common.model.EntityId> throwRay(int x, int y)
protected abstract void yaw(float angle)
angle - Angle to rotate, in radian.protected abstract be.yildizgames.common.geometry.Point3D rotateImpl(float yaw,
float pitch)
yaw - Rotation X coordinates.pitch - Rotation Y coordinates.protected abstract be.yildizgames.common.geometry.Point3D lookAtImpl(be.yildizgames.common.geometry.Point3D target)
target - Target positionprotected abstract be.yildizgames.common.geometry.Point3D moveImpl(float moveX,
float moveY,
float moveZ)
moveX - X value to move.moveY - Y value to move.moveZ - Z value to move.protected abstract be.yildizgames.common.geometry.Point3D setOrientationImpl(float x,
float y,
float z)
x - New direction X value.y - New direction Y value.z - New direction Z value.protected abstract be.yildizgames.common.geometry.Point3D setPositionImpl(int x,
int y,
be.yildizgames.common.geometry.Axis axis)
x - 2D position X.y - 2D position Y.axis - Axis to retrieve 3D position.protected abstract void setPositionImpl(float posX,
float posY,
float posZ)
posX - New x position for the camera.posY - New y position for the camera.posZ - New z position for the camera.protected abstract be.yildizgames.common.geometry.Point3D getDirectionImpl()
public abstract void removeListener(LensFlare listener)
listener - Listener to remove.public final void stopAutoTrack()
protected abstract void stopAutoTrackImpl()
public final void autoTrack(Node e)
e - Entity to track.protected abstract void autoTrackImpl(Node node)
node - Node to track.public abstract void autoTrack(be.yildizgames.common.geometry.Point3D position)
position - Position to target.public final void stopAutoTrack(Node node)
node - Node to stop to track.public final be.yildizgames.common.geometry.Point3D getOffset()
public final void setOffset(be.yildizgames.common.geometry.Point3D offset)
offset - Offset to set.public final boolean isAutoTrack()
true if camera is tracking an entity.public final be.yildizgames.common.geometry.Point3D getTrackPosition()
Copyright © 2014–2018. All rights reserved.