Package org.jbox2d.common
Class OBBViewportTransform
java.lang.Object
org.jbox2d.common.OBBViewportTransform
- All Implemented Interfaces:
IViewportTransform
Orientated bounding box viewport transform
- Author:
- Daniel Murphy
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncenter of the viewport.This is the half-width and half-height.voidgetScreenToWorld(Vec2 screen, Vec2 world) takes the screen coordinates (screen) and puts the corresponding world coordinates in world.voidgetScreenVectorToWorld(Vec2 screen, Vec2 world) Transforms the given directional screen vector back to the world direction.Gets the transform of the viewport, transforms around the center.voidgetWorldToScreen(Vec2 world, Vec2 screen) takes the world coordinate (world) puts the corresponding screen coordinate in screen.voidgetWorldVectorToScreen(Vec2 world, Vec2 screen) Transforms the given directional vector by the viewport transform (not positional)booleanisYFlip()voidmulByTransform(Mat22 transform) Multiplies the obb transform by the given transformvoidset(OBBViewportTransform vpt) voidsetCamera(float x, float y, float scale) Sets the transform's center to the given x and y coordinates, and using the given scale.voidsetCenter(float x, float y) sets the center of the viewport.voidsets the center of the viewport.voidsetExtents(float halfWidth, float halfHeight) This sets the half-width and half-height of the viewport.voidsetExtents(Vec2 argExtents) This sets the half-width and half-height.voidsetTransform(Mat22 transform) Sets the transform of the viewport.voidsetYFlip(boolean yFlip)
-
Field Details
-
box
-
-
Constructor Details
-
OBBViewportTransform
public OBBViewportTransform()
-
-
Method Details
-
set
-
setCamera
public void setCamera(float x, float y, float scale) Description copied from interface:IViewportTransformSets the transform's center to the given x and y coordinates, and using the given scale.- Specified by:
setCamerain interfaceIViewportTransform
-
getExtents
Description copied from interface:IViewportTransformThis 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.- Specified by:
getExtentsin interfaceIViewportTransform
-
getMat22Representation
- Specified by:
getMat22Representationin interfaceIViewportTransform
-
setExtents
Description copied from interface:IViewportTransformThis sets the half-width and half-height. This should be the actual half-width and half-height, not anything transformed or scaled.- Specified by:
setExtentsin interfaceIViewportTransform
-
setExtents
public void setExtents(float halfWidth, float halfHeight) Description copied from interface:IViewportTransformThis 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.- Specified by:
setExtentsin interfaceIViewportTransform
-
getCenter
Description copied from interface:IViewportTransformcenter of the viewport. Not a copy.- Specified by:
getCenterin interfaceIViewportTransform
-
setCenter
Description copied from interface:IViewportTransformsets the center of the viewport.- Specified by:
setCenterin interfaceIViewportTransform
-
setCenter
public void setCenter(float x, float y) Description copied from interface:IViewportTransformsets the center of the viewport.- Specified by:
setCenterin interfaceIViewportTransform
-
getTransform
Gets the transform of the viewport, transforms around the center. Not a copy. -
setTransform
Sets the transform of the viewport. Transforms about the center. -
mulByTransform
Multiplies the obb transform by the given transform- Specified by:
mulByTransformin interfaceIViewportTransform
-
isYFlip
public boolean isYFlip()- Specified by:
isYFlipin interfaceIViewportTransform- Returns:
- If the transform flips the y-axis.
-
setYFlip
public void setYFlip(boolean yFlip) - Specified by:
setYFlipin interfaceIViewportTransform- Parameters:
yFlip- If we flip the y-axis when transforming.
-
getScreenVectorToWorld
Description copied from interface:IViewportTransformTransforms the given directional screen vector back to the world direction.- Specified by:
getScreenVectorToWorldin interfaceIViewportTransform
-
getWorldVectorToScreen
Description copied from interface:IViewportTransformTransforms the given directional vector by the viewport transform (not positional)- Specified by:
getWorldVectorToScreenin interfaceIViewportTransform
-
getWorldToScreen
Description copied from interface:IViewportTransformtakes the world coordinate (world) puts the corresponding screen coordinate in screen. It should be safe to give the same object as both parameters.- Specified by:
getWorldToScreenin interfaceIViewportTransform
-
getScreenToWorld
Description copied from interface:IViewportTransformtakes the screen coordinates (screen) and puts the corresponding world coordinates in world. It should be safe to give the same object as both parameters.- Specified by:
getScreenToWorldin interfaceIViewportTransform
-