public interface IViewportTransform
| Modifier and Type | Method and Description |
|---|---|
Vec2 |
getCenter()
center of the viewport.
|
Vec2 |
getExtents()
This is the half-width and half-height.
|
Mat22 |
getMat22Representation() |
void |
getScreenToWorld(Vec2 screen,
Vec2 world)
takes the screen coordinates (screen) and puts the corresponding world coordinates in world.
|
void |
getScreenVectorToWorld(Vec2 screen,
Vec2 world)
Transforms the given directional screen vector back to the world direction.
|
void |
getWorldToScreen(Vec2 world,
Vec2 screen)
takes the world coordinate (world) puts the corresponding screen coordinate in screen.
|
void |
getWorldVectorToScreen(Vec2 world,
Vec2 screen)
Transforms the given directional vector by the viewport transform (not positional)
|
boolean |
isYFlip() |
void |
mulByTransform(Mat22 transform)
Multiplies the viewport transform by the given Mat22
|
void |
setCamera(float x,
float y,
float scale)
Sets the transform's center to the given x and y coordinates, and using the given scale.
|
void |
setCenter(float x,
float y)
sets the center of the viewport.
|
void |
setCenter(Vec2 pos)
sets the center of the viewport.
|
void |
setExtents(float halfWidth,
float halfHeight)
This sets the half-width and half-height of the viewport.
|
void |
setExtents(Vec2 extents)
This sets the half-width and half-height.
|
void |
setYFlip(boolean yFlip) |
boolean isYFlip()
void setYFlip(boolean yFlip)
yFlip - if we flip the y axis when transformingVec2 getExtents()
void setExtents(Vec2 extents)
void setExtents(float halfWidth,
float halfHeight)
Vec2 getCenter()
void setCenter(Vec2 pos)
void setCenter(float x,
float y)
void setCamera(float x,
float y,
float scale)
void getWorldVectorToScreen(Vec2 world, Vec2 screen)
void getScreenVectorToWorld(Vec2 screen, Vec2 world)
Mat22 getMat22Representation()
void getWorldToScreen(Vec2 world, Vec2 screen)
void getScreenToWorld(Vec2 screen, Vec2 world)
void mulByTransform(Mat22 transform)
Copyright © 2018. All rights reserved.