|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gzz.vob.VobCoorder
A set of coordinate systems for vobs. In the new Vob APIs, the keys that were formerly inside the Vob objects are associated with coordinate systems, each of which may contain any number of vobs. This allows us to easily animate connections between two coordinate systems etc.
Coordinate systems are recursive; the coordinate system 0
represents the root coordinate system (i.e., the whole vob scene).
Warn about setXParams!
The transform functions (transformPoints3, inverseTransformPoints3, transformPoint, transformPoints2) can be used to transform points into coordinate systems. The functions take an array of original points, an (optional) destination array, and return either the destination array, or, if the coordinate system is not rendered in the current configuration (e.g. culled out), null.
Constructor Summary | |
VobCoorder()
|
Method Summary | |
abstract void |
activate(int CS)
Cause the given coordinate system to be considered when getCSAt() is called. |
int |
box(int into,
float w,
float h)
|
int |
cull(int parent,
int clip)
Creates a CullingCoordSys using the parent also as the test coordinate system. |
int |
cull(int parent,
int test,
int clip)
Creates a CullingCoordSys with distinct parent and test coordinate systems. |
abstract void |
dump()
|
abstract int |
getCSAt(int parent,
float x,
float y,
float[] targetcoords)
Get the topmost activated coordinate system which has parent as a primary ancestor. |
abstract Vob.RenderInfo |
getRenderInfo(int csind)
|
abstract void |
getSqSize(int cs,
float[] into)
Get the size of the "unit square" of the given coordinate system. |
float[] |
inverseTransformPoints3(int withCS,
float[] pt,
float[] into)
|
abstract boolean |
needInterp(VobCoorder interpTo,
int[] interpList)
|
abstract int |
ortho(int into,
float depth,
float x,
float y,
float sx,
float sy)
Create a new coordinate system. |
abstract int |
orthoBox(int into,
float z,
float x,
float y,
float sx,
float sy,
float w,
float h)
|
int |
scale(int into,
float sx,
float sy)
|
void |
setBoxParams(int cs,
float w,
float h)
|
abstract void |
setOrthoBoxParams(int cs,
float z,
float x,
float y,
float sx,
float sy,
float w,
float h)
|
abstract void |
setOrthoParams(int into,
float depth,
float x,
float y,
float sx,
float sy)
|
void |
setScaleParams(int into,
float sx,
float sy)
|
void |
setTranslateParams(int into,
float x,
float y)
|
void |
setTranslateParams(int into,
float x,
float y,
float z)
|
java.awt.Point |
transformPoint(int cs,
float x,
float y,
java.awt.Point into)
|
java.awt.Point[] |
transformPoints2(int cs,
float[] coords,
java.awt.Point[] into)
|
float[] |
transformPoints3(int withCS,
float[] pt,
float[] into)
Transform a point to screen coordinates from the given cs. |
int |
translate(int into,
float x,
float y)
|
int |
translate(int into,
float x,
float y,
float z)
|
int |
unitSq(int into)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VobCoorder()
Method Detail |
public abstract int ortho(int into, float depth, float x, float y, float sx, float sy)
into
- The coord system to place the new coordinate
system into, 0
for the root
coordinate system.public int translate(int into, float x, float y)
public int translate(int into, float x, float y, float z)
public int scale(int into, float sx, float sy)
public abstract void setOrthoParams(int into, float depth, float x, float y, float sx, float sy)
public void setTranslateParams(int into, float x, float y)
public void setTranslateParams(int into, float x, float y, float z)
public void setScaleParams(int into, float sx, float sy)
public int box(int into, float w, float h)
public void setBoxParams(int cs, float w, float h)
public int unitSq(int into)
public abstract int orthoBox(int into, float z, float x, float y, float sx, float sy, float w, float h)
public abstract void setOrthoBoxParams(int cs, float z, float x, float y, float sx, float sy, float w, float h)
public int cull(int parent, int test, int clip)
This coordsys will not necessarily be drawn if the boxes of the test and clip coordinate systems do not intersect. However, this is not guaranteed; the only thing guaranteed is that if the boxes of the test and clip coordinate systems *do* intersect, the CullingCoordsys will be drawn.
The default implementation (although this may change in the future) in VobCoorder is to simply return parent.
parent
- ID of the coordinate system which points
will be transformed, if CullingCoordSys
is showntest
- ID of the coordinate system whose box is tested
against the clip coordinate system.clip
- ID of the coordinate system whose box is tested
against the test coordinate system.public int cull(int parent, int clip)
public abstract void getSqSize(int cs, float[] into)
public abstract boolean needInterp(VobCoorder interpTo, int[] interpList)
public abstract Vob.RenderInfo getRenderInfo(int csind)
public abstract void dump()
public abstract void activate(int CS)
public abstract int getCSAt(int parent, float x, float y, float[] targetcoords)
1) Inverse transform into the coordinate system; in there, clip against the unit square and project to the plane z=0 2) Transform the projected point back into screen coordinates, making note of the z coordinate.
public float[] transformPoints3(int withCS, float[] pt, float[] into)
public float[] inverseTransformPoints3(int withCS, float[] pt, float[] into)
public java.awt.Point transformPoint(int cs, float x, float y, java.awt.Point into)
public java.awt.Point[] transformPoints2(int cs, float[] coords, java.awt.Point[] into)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |