Class: AliasingCamera

Grape2D. AliasingCamera

new AliasingCamera(options)

An aliasing camera avoid drawing objects in "half-points", for example an object to be drawn in the viewport at x=0.5 this camera will draw the object at floor(x).
Parameters:
Name Type Description
options Object Setup options. See Grape2D.Camera constructor for more details.
Source:

Extends

Members

<private> cM :Grape2D.Matrix

Computed matrix
Type:
Inherited From:
Source:

<private> icM :Grape2D.Matrix

Inverse of the computed matrix
Type:
Inherited From:
Source:

<private> lookAt :Grape2D.Vector

The position to where the camera is looking at.
Type:
Inherited From:
Source:

<private> scale :Grape2D.Vector

Scale set by the user, should be defined in the matrix.
Type:
Inherited From:
Source:

<private> transformation :Grape2D.Matrix

The transformation matrix to aply to the object coordinates.
Type:
Inherited From:
Source:

Methods

<protected> computeMatrix()

Computes the matrix for better performances.
Inherited From:
Source:

computeShape(renderer) → {Grape2D.Shape}

Creates a shape, based on the camera transformation and renderer properties.
Parameters:
Name Type Description
renderer Grape2D.Renderer The renderer.
Inherited From:
Source:
Returns:
A bounding volume representing the camera view region.
Type
Grape2D.Shape

getLookAt() → {Grape2D.Vector}

Gets the look at property.
Inherited From:
Source:
Returns:
The look at.
Type
Grape2D.Vector

getScale() → {Grape2D.Vector}

Gets the current scale. Scale defined in the transformation is not taken into account.
Inherited From:
Source:
Returns:
Scale
Type
Grape2D.Vector

rescale(scale)

Sets a new scale.
Parameters:
Name Type Description
scale Grape2D.Vector The new scale.
Inherited From:
Source:

setLookAt(position)

Sets the center position to where the camera is looking at.
Parameters:
Name Type Description
position Grape2D.Vector The new look at.
Inherited From:
Source:

viewportToWcs(renderer, vector) → {Grape2D.Vector}

Applies the transformation, on a vector in the Viewport Coordinate System (VCS), to get a vector in the World Coordinate System (WSC).
Parameters:
Name Type Description
renderer Grape2D.Renderer The viewport.
vector Grape2D.Vector Vector in the VCS.
Inherited From:
Source:
Returns:
A vector in the WCS
Type
Grape2D.Vector

wcsToViewport()

Floors the components of the result of the Grape2D.Camera.wcsToViewport to avoid anti-aliasing by the renderer. However this method is more specific for the Grape2D.CanvasRenderer.
Source: