public class OBBViewportTransform
- Object
- OBBViewportTransform
ImplementsIViewportTransform
Orientated bounding box viewport transform
Nested types
class OBBViewportTransform.OBB |
Fields
protected final OBBViewportTransform.OBB box |
Constructors
public OBBViewportTransform() |
Methods
Inherited methods
Field details
box
protected final OBBViewportTransform.OBB boxConstructor details
OBBViewportTransform
public OBBViewportTransform()Method details
set
public void set(OBBViewportTransform vpt)setCamera
public 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.
getExtents
public Vec2 getExtents()This is the half-width and half-height.
This should be the actual half-width and
half-height, not anything transformed or scaled.
Not a copy.
See also
setExtents
public void setExtents(Vec2 argExtents)This sets the half-width and half-height.
This should be the actual half-width and
half-height, not anything transformed or scaled.
setExtents
public void setExtents(float argHalfWidth, float argHalfHeight)This sets the half-width and half-height of the
viewport. This should be the actual half-width and
half-height, not anything transformed or scaled.
getCenter
public Vec2 getCenter()center of the viewport. Not a copy.
See also
setCenter
public void setCenter(Vec2 argPos)sets the center of the viewport.
setCenter
public void setCenter(float x, float y)sets the center of the viewport.
getTransform
public Mat22 getTransform()gets the transform of the viewport, transforms around the center. Not a copy.
setTransform
public void setTransform(Mat22 transform)Sets the transform of the viewport. Transforms about the center.
mulByTransform
public void mulByTransform(Mat22 argTransform)Multiplies the obb transform by the given transform
isYFlip
public boolean isYFlip()Returns
if the transform flips the y axis
See also
setYFlip
public void setYFlip(boolean yFlip)Parameters
yFlipboolean- if we flip the y axis when transforming
getScreenVectorToWorld
public void getScreenVectorToWorld(Vec2 argScreen, Vec2 argWorld)Transforms the given directional screen vector back to
the world direction.
getWorldVectorToScreen
public void getWorldVectorToScreen(Vec2 argWorld, Vec2 argScreen)Transforms the given directional vector by the
viewport transform (not positional)
getWorldToScreen
public void getWorldToScreen(Vec2 argWorld, Vec2 argScreen)takes the world coordinate (argWorld) puts the corresponding
screen coordinate in argScreen. It should be safe to give the
same object as both parameters.
getScreenToWorld
public void getScreenToWorld(Vec2 argScreen, Vec2 argWorld)takes the screen coordinates (argScreen) and puts the
corresponding world coordinates in argWorld. It should be safe
to give the same object as both parameters.