public class TransformContext extends TraversalContext
A transform context maintains transforms for converting coordinates among five different coordinate systems:
When traversing the scenegraph, the world-to-view, view-to-cube, and
cube-to-pixel transforms do not change. However, nodes that transform
coordinates will push, modify, and pop the local-to-world transform,
using the methods pushLocalToWorld(Matrix44)
and
popLocalToWorld()
.
Constructor and Description |
---|
TransformContext(ViewCanvas canvas)
Constructs a transform context for the specified view canvas.
|
Modifier and Type | Method and Description |
---|---|
Matrix44 |
getCubeToLocal()
Gets the cube-to-local transform.
|
Matrix44 |
getCubeToPixel()
Gets the cube-to-pixel transform.
|
Matrix44 |
getCubeToView()
Gets the cube-to-view transform.
|
Matrix44 |
getCubeToWorld()
Gets the cube-to-world transform.
|
Matrix44 |
getLocalToCube()
Gets the local-to-cube transform.
|
Matrix44 |
getLocalToPixel()
Gets the local-to-pixel transform.
|
Matrix44 |
getLocalToView()
Gets the local-to-view transform.
|
Matrix44 |
getLocalToWorld()
Gets the local-to-world transform.
|
Matrix44 |
getPixelToCube()
Gets the pixel-to-cube transform.
|
Matrix44 |
getPixelToLocal()
Gets the pixel-to-local transform.
|
Matrix44 |
getPixelToView()
Gets the pixel-to-view transform.
|
Matrix44 |
getPixelToWorld()
Gets the pixel-to-world transform.
|
View |
getView()
Gets the view for which this transform context was constructed.
|
ViewCanvas |
getViewCanvas()
Gets the canvas for which this transform context was constructed.
|
Matrix44 |
getViewToCube()
Gets the view-to-cube transform.
|
Matrix44 |
getViewToLocal()
Gets the view-to-local transform.
|
Matrix44 |
getViewToPixel()
Gets the view-to-pixel transform.
|
Matrix44 |
getViewToWorld()
Gets the view-to-world transform.
|
World |
getWorld()
Gets the world for which this transform context was constructed.
|
Matrix44 |
getWorldToCube()
Gets the world-to-cube transform.
|
Matrix44 |
getWorldToLocal()
Gets the world-to-local transform.
|
Matrix44 |
getWorldToPixel()
Gets the world-to-pixel transform.
|
Matrix44 |
getWorldToView()
Gets the world-to-view transform.
|
void |
popLocalToWorld()
Restores the most recently saved (pushed) local-to-world transform.
|
void |
pushLocalToWorld(Matrix44 transform)
Saves the local-to-world transform before appending a transform.
|
countNodes, getNode, getNode, getNodes, popNode, pushNode
public TransformContext(ViewCanvas canvas)
canvas
- the view canvas.public ViewCanvas getViewCanvas()
public View getView()
public World getWorld()
public Matrix44 getLocalToWorld()
public Matrix44 getWorldToLocal()
public Matrix44 getLocalToView()
public Matrix44 getViewToLocal()
public Matrix44 getLocalToCube()
public Matrix44 getCubeToLocal()
public Matrix44 getLocalToPixel()
public Matrix44 getPixelToLocal()
public Matrix44 getWorldToView()
public Matrix44 getViewToWorld()
public Matrix44 getWorldToCube()
public Matrix44 getCubeToWorld()
public Matrix44 getWorldToPixel()
public Matrix44 getPixelToWorld()
public Matrix44 getViewToCube()
public Matrix44 getCubeToView()
public Matrix44 getViewToPixel()
public Matrix44 getPixelToView()
public Matrix44 getCubeToPixel()
public Matrix44 getPixelToCube()
public void pushLocalToWorld(Matrix44 transform)
transform
- the transform to append.public void popLocalToWorld()