public class Camera extends java.lang.Object implements Manipulatable
Modifier and Type | Field and Description |
---|---|
protected int |
mAxisSystem |
protected RectF |
mBounds |
protected PointF |
mCenter |
protected boolean |
mClipping |
protected PointF |
mHalfSize |
protected boolean |
mInvalidated |
protected java.util.ArrayList<Manipulator> |
mManipulators |
protected int |
mNumManipulators |
protected float |
mRotation |
protected Scene |
mScene |
protected static float[] |
mScratch |
protected PointF |
mSize |
protected PointF |
mZoom |
protected RectF |
mZoomRect |
Constructor and Description |
---|
Camera(float width,
float height) |
Camera(PointF size) |
Camera(PointF center,
PointF size) |
Modifier and Type | Method and Description |
---|---|
boolean |
addManipulator(Manipulator manipulator) |
void |
apply(GLState glState) |
RectF |
getBounds() |
float |
getHeight() |
PointF |
getPosition() |
float |
getRotation() |
PointF |
getScale() |
Scene |
getScene() |
PointF |
getSize() |
float |
getWidth() |
float |
getX() |
float |
getY() |
PointF |
getZoom() |
RectF |
getZoomRect() |
void |
globalToLocal(float worldX,
float worldY,
PointF result)
Find the local coordinates of a point relative to the TL corner of the Camera's Rect.
|
void |
globalToLocal(RectF globalRect,
RectF result)
Find the local coordinates of a Rectangle relative to the TL corner of the Camera's Rect.
|
boolean |
intersects(RectF rect) |
void |
invalidate() |
boolean |
isClipping() |
boolean |
isInvalidated() |
boolean |
isViewable(Manipulatable obj) |
boolean |
isViewable(RectF rect) |
void |
localToGlobal(float cameraX,
float cameraY,
PointF result)
Find the world coordinates of a point relative to the TL corner of the Camera's Rect.
|
void |
move(float x,
float y) |
void |
moveTo(float x,
float y) |
int |
removeAllManipulators() |
boolean |
removeManipulator(Manipulator manipulator) |
void |
rotate(float degreeDelta) |
void |
setClipping(boolean clipping) |
void |
setPosition(float x,
float y) |
void |
setPosition(PointF center) |
void |
setRotation(float degree) |
void |
setScale(float scale) |
void |
setScale(float sx,
float sy) |
void |
setScene(Scene scene) |
void |
setSize(float w,
float h) |
void |
setSize(PointF size) |
void |
setX(float x) |
void |
setY(float y) |
void |
setZoom(float zoom) |
void |
unapply(GLState glState) |
boolean |
update(int deltaTime) |
protected void |
validate() |
void |
zoomBy(float delta) |
protected static final float[] mScratch
protected PointF mCenter
protected PointF mSize
protected float mRotation
protected PointF mZoom
protected Scene mScene
protected int mAxisSystem
protected RectF mZoomRect
protected PointF mHalfSize
protected boolean mInvalidated
protected java.util.ArrayList<Manipulator> mManipulators
protected int mNumManipulators
protected boolean mClipping
protected RectF mBounds
public Camera(PointF size)
public Camera(float width, float height)
public Camera(PointF center, PointF size)
public PointF getPosition()
getPosition
in interface Manipulatable
public final void setPosition(PointF center)
setPosition
in interface Manipulatable
center
- the Center to setpublic void setPosition(float x, float y)
setPosition
in interface Manipulatable
Center
- the Center to setpublic void setX(float x)
setX
in interface Manipulatable
public final float getX()
getX
in interface Manipulatable
public void setY(float y)
setY
in interface Manipulatable
public final float getY()
getY
in interface Manipulatable
public void moveTo(float x, float y)
moveTo
in interface Manipulatable
public void move(float x, float y)
move
in interface Manipulatable
public PointF getSize()
getSize
in interface Manipulatable
public final void setSize(PointF size)
setSize
in interface Manipulatable
size
- the size to setpublic void setSize(float w, float h)
setSize
in interface Manipulatable
size
- the size to setpublic final float getWidth()
getWidth
in interface Manipulatable
public final float getHeight()
getHeight
in interface Manipulatable
public void setRotation(float degree)
setRotation
in interface Manipulatable
public float getRotation()
getRotation
in interface Manipulatable
public void rotate(float degreeDelta)
rotate
in interface Manipulatable
public PointF getZoom()
public void setZoom(float zoom)
zoom
- the zoom to setpublic void zoomBy(float delta)
public void setScale(float sx, float sy)
setScale
in interface Manipulatable
public void setScale(float scale)
setScale
in interface Manipulatable
public PointF getScale()
getScale
in interface Manipulatable
public RectF getZoomRect()
public Scene getScene()
public void setScene(Scene scene)
scene
- the scene to setpublic void invalidate()
public boolean update(int deltaTime)
protected void validate()
public void apply(GLState glState)
public void unapply(GLState glState)
public boolean isInvalidated()
public boolean isViewable(Manipulatable obj)
public boolean isViewable(RectF rect)
public boolean intersects(RectF rect)
public boolean isClipping()
public void setClipping(boolean clipping)
Clipping
- the Clipping to setpublic RectF getBounds()
getBounds
in interface Manipulatable
public void localToGlobal(float cameraX, float cameraY, PointF result)
cameraX
- cameraY
- result
- public void globalToLocal(float worldX, float worldY, PointF result)
worldX
- worldY
- result
- public void globalToLocal(RectF globalRect, RectF result)
globalRect
- result
- public boolean addManipulator(Manipulator manipulator)
public boolean removeManipulator(Manipulator manipulator)
public int removeAllManipulators()