# Class OBBViewportTransform

java.lang.Object
com.codename1.gaming.physics.box2d.common.OBBViewportTransform

All Implemented Interfaces:
  `IViewportTransform`

public class OBBViewportTransform extends Object implements IViewportTransform
Orientated bounding box viewport transform

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `OBBViewportTransform.OBB`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final OBBViewportTransform.OBB`
  `box`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OBBViewportTransform()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Vec2`
  `getCenter()`
  center of the viewport.
  `Vec2`
  `getExtents()`
  This is the half-width and half-height.
  `void`
  `getScreenToWorld(Vec2 argScreen, Vec2 argWorld)`
  takes the screen coordinates (argScreen) and puts the corresponding world coordinates in argWorld.
  `void`
  `getScreenVectorToWorld(Vec2 argScreen, Vec2 argWorld)`
  Transforms the given directional screen vector back to the world direction.
  `Mat22`
  `getTransform()`
  gets the transform of the viewport, transforms around the center.
  `void`
  `getWorldToScreen(Vec2 argWorld, Vec2 argScreen)`
  takes the world coordinate (argWorld) puts the corresponding screen coordinate in argScreen.
  `void`
  `getWorldVectorToScreen(Vec2 argWorld, Vec2 argScreen)`
  Transforms the given directional vector by the viewport transform (not positional)
  `boolean`
  `isYFlip()`
  `void`
  `mulByTransform(Mat22 argTransform)`
  Multiplies the obb transform by the given transform
  `void`
  `set(OBBViewportTransform vpt)`
  `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 argPos)`
  sets the center of the viewport.
  `void`
  `setExtents(float argHalfWidth, float argHalfHeight)`
  This sets the half-width and half-height of the viewport.
  `void`
  `setExtents(Vec2 argExtents)`
  This sets the half-width and half-height.
  `void`
  `setTransform(Mat22 transform)`
  Sets the transform of the viewport.
  `void`
  `setYFlip(boolean yFlip)`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### box

    protected final OBBViewportTransform.OBB box

- ## Constructor Details

  - ### OBBViewportTransform

    public OBBViewportTransform()

- ## Method Details

  - ### set

    public void set(OBBViewportTransform vpt)

  - ### setCamera

    public void setCamera(float x, float y, float scale)
    Description copied from interface: `IViewportTransform`
    Sets the transform's center to the given x and y coordinates, and using the given scale.
    Specified by:
      `setCamera` in interface `IViewportTransform`
    Parameters:
      `x` -
      `y` -
      `scale` -
    See Also:
      - `IViewportTransform.setCamera(float, float, float)`

  - ### getExtents

    public Vec2 getExtents()
    Description copied from interface: `IViewportTransform`
    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.
    Specified by:
      `getExtents` in interface `IViewportTransform`
    Returns:
    See Also:
      - `IViewportTransform.getExtents()`

  - ### setExtents

    public void setExtents(Vec2 argExtents)
    Description copied from interface: `IViewportTransform`
    This sets the half-width and half-height. This should be the actual half-width and half-height, not anything transformed or scaled.
    Specified by:
      `setExtents` in interface `IViewportTransform`
    Parameters:
      `argExtents` -
    See Also:
      - `IViewportTransform.setExtents(Vec2)`

  - ### setExtents

    public void setExtents(float argHalfWidth, float argHalfHeight)
    Description copied from interface: `IViewportTransform`
    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.
    Specified by:
      `setExtents` in interface `IViewportTransform`
    Parameters:
      `argHalfWidth` -
      `argHalfHeight` -
    See Also:
      - `IViewportTransform.setExtents(float, float)`

  - ### getCenter

    public Vec2 getCenter()
    Description copied from interface: `IViewportTransform`
    center of the viewport. Not a copy.
    Specified by:
      `getCenter` in interface `IViewportTransform`
    Returns:
    See Also:
      - `IViewportTransform.getCenter()`

  - ### setCenter

    public void setCenter(Vec2 argPos)
    Description copied from interface: `IViewportTransform`
    sets the center of the viewport.
    Specified by:
      `setCenter` in interface `IViewportTransform`
    Parameters:
      `argPos` -
    See Also:
      - `IViewportTransform.setCenter(Vec2)`

  - ### setCenter

    public void setCenter(float x, float y)
    Description copied from interface: `IViewportTransform`
    sets the center of the viewport.
    Specified by:
      `setCenter` in interface `IViewportTransform`
    Parameters:
      `x` -
      `y` -
    See Also:
      - `IViewportTransform.setCenter(float, float)`

  - ### getTransform

    public Mat22 getTransform()
    gets the transform of the viewport, transforms around the center. Not a copy.
    Returns:

  - ### setTransform

    public void setTransform(Mat22 transform)
    Sets the transform of the viewport. Transforms about the center.
    Parameters:
      `transform` -

  - ### mulByTransform

    public void mulByTransform(Mat22 argTransform)
    Multiplies the obb transform by the given transform
    Parameters:
      `argTransform` -

  - ### isYFlip

    public boolean isYFlip()
    Specified by:
      `isYFlip` in interface `IViewportTransform`
    Returns:
      if the transform flips the y axis
    See Also:
      - `IViewportTransform.isYFlip()`

  - ### setYFlip

    public void setYFlip(boolean yFlip)
    Specified by:
      `setYFlip` in interface `IViewportTransform`
    Parameters:
      `yFlip` - if we flip the y axis when transforming
    See Also:
      - `IViewportTransform.setYFlip(boolean)`

  - ### getScreenVectorToWorld

    public void getScreenVectorToWorld(Vec2 argScreen, Vec2 argWorld)
    Description copied from interface: `IViewportTransform`
    Transforms the given directional screen vector back to the world direction.
    Specified by:
      `getScreenVectorToWorld` in interface `IViewportTransform`
    See Also:
      - `IViewportTransform.getScreenVectorToWorld(Vec2, Vec2)`

  - ### getWorldVectorToScreen

    public void getWorldVectorToScreen(Vec2 argWorld, Vec2 argScreen)
    Description copied from interface: `IViewportTransform`
    Transforms the given directional vector by the viewport transform (not positional)
    Specified by:
      `getWorldVectorToScreen` in interface `IViewportTransform`
    See Also:
      - `IViewportTransform.getWorldVectorToScreen(Vec2, Vec2)`

  - ### getWorldToScreen

    public void getWorldToScreen(Vec2 argWorld, Vec2 argScreen)
    Description copied from interface: `IViewportTransform`
    takes the world coordinate (argWorld) puts the corresponding screen coordinate in argScreen. It should be safe to give the same object as both parameters.
    Specified by:
      `getWorldToScreen` in interface `IViewportTransform`
    Parameters:
      `argWorld` -
      `argScreen` -

  - ### getScreenToWorld

    public void getScreenToWorld(Vec2 argScreen, Vec2 argWorld)
    Description copied from interface: `IViewportTransform`
    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.
    Specified by:
      `getScreenToWorld` in interface `IViewportTransform`
    Parameters:
      `argScreen` -
      `argWorld` -
    See Also:
      - `IViewportTransform.getScreenToWorld(Vec2, Vec2)`