public class PyramidWidget extends JOGLEdgedFacetedWidget
A rectangular pyramid.
The face geometry has defined normals. The edge geometry is composed of the base rectangle plus four axial lines along the pyramid creases.
The base dimensions and pyramid depth are mutable. The pyramid base is
centered at the origin of the local coordinate frame, with apex extending in
the positive Z direction. The pyramid may be further positioned e.g. by
manipulating Widget.rx
.
trackWidgetLength(float...)
may be called to enable Widget.widgetLength
tracking, which causes the base width, height, and/or the pyramid depth to
track Widget.widgetLength
*trackWidthFactor
, Widget.widgetLength
*trackHeightFactor
, or Widget.widgetLength
*trackDepthFactor
, respectively.
Face vertex array is five tri strips:
D C E A B
Edge vertex array is 5 line strips:
Copyright (C) 2008 Marsette A. Vona, III
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
cvsid |
protected float |
depth
the current pyramid depth
|
protected float |
height
the current base dims
|
protected float |
trackDepthFactor
mapping from
Widget.widgetLength to pyramid depth, NaN if none |
protected float |
trackHeightFactor
mapping from
Widget.widgetLength to base height, NaN if none |
protected float |
trackWidthFactor
mapping from
Widget.widgetLength to base width, NaN if none |
protected float |
width
the current base dims
|
edgeGeometry, edgeVertices, faceGeometry, faceVertices, X, Y, Z
DASHED_PATTERN, DEF_EDGE_COLOR, DEF_OFFSET_BIAS, DEF_OFFSET_FACTOR, DOTTED_PATTERN, edgeAppearance, edgeColoringAttributes, edgeLineAttributes, EDGES, edgeTransparencyAttributes, facePolygonAttributes, SOLID_PATTERN
faceAppearance, faceMaterial, FACES, faceTransparencyAttributes
alpha, appearance, autoSetBoundingSpheres, boundingSphereCenter, boundingSphereCenterInView, boundingSphereRadius, boundingSphereRadiusInView, dbgEnabled, dbgNormalsGeometry, dbgNormalsVertices, dbgSpheresGeometry, dbgSpheresVertices, DEF_DBG_NORMAL_LENGTH, DEF_WIDGET_LENGTH, enabled, geometry, numGeometries, primitiveIterator, propertyMap, rx, vertexAccessor, widgetLength
Constructor and Description |
---|
PyramidWidget()
Covers
PyramidWidget(float, float, float) , uses width =
height= 1.0f, depth = 0.5f. |
PyramidWidget(float width,
float height,
float depth)
Creates a new PyramidWidget with given dims.
|
Modifier and Type | Method and Description |
---|---|
boolean |
setAngles(float x,
float y)
Covers
setLengthsAndAngles(float, float, float) , does not change pyramid depth. |
boolean |
setAngleX(float x)
covers
setAngles(float, float) , only sets horizontal angle |
boolean |
setAngleY(float y)
covers
setAngles(float, float) , only sets vertical angle |
boolean |
setDepth(float depth)
covers
setLengths(float, float, float) , only changes pyramid depth |
boolean |
setHeight(float height)
covers
setLengths(float, float, float) , only changes base height |
boolean |
setLengths(float width,
float height,
float depth)
Set the pyramid dimensions.
|
boolean |
setLengthsAndAngles(float x,
float y,
float depth)
Like
setLengths(float, float, float) but sets base dimensions from given apex
angles. |
boolean |
setWidth(float width)
covers
setLengths(float, float, float) , only changes base width |
void |
trackWidgetLength(float... trackFactor)
|
protected void |
widgetLengthChanged()
implements
Widget.widgetLength tracking, see class header doc |
gevc, gfnc, gfvc, sev, sevc, sfn, sfnc, sfv, sfvc
enableEdges, getEdgeAppearance, getEdgeGeometry, setAlpha, setColor, setColor, setEdgeAlpha, setEdgeColor, setEdgeColor, setEdgePattern, setEdgePattern, setEdgeWidth, setFaceOffset, setFaceOffsetBias, setFaceOffsetFactor
enableFaces, getFaceAppearance, getFaceGeometry, setFaceAlpha, setFaceColor, setFaceColor
cons, countGeometryArrays, disableBoundingSphere, disableBoundingSpheres, dump, dump, enableDBGGeometry, enableGeometry, ensureBoundingSpheresInView, getAppearance, getBoundingSphereCenter, getBoundingSphereRadius, getGeometry, getProperty, getWidget, getWidgetAlpha, hasBoundingSphere, hasBoundingSphereInView, hasProperty, indexOf, populateFrom, recomputeBoundingSphere, recomputeBoundingSpheres, removeDBGNormals, removeDBGSpheres, removeGeometry, removeGeometry, removeProperty, replaceAppearanceWithClone, replaceGeometryWithClone, scaleWidget, setAppearance, setBoundingSphereCenter, setBoundingSphereRadius, setGeometry, setGeometryAlpha, setGeometryAlpha, setGeometryAndAppearance, setProperty, setProperty, setWidgetAlpha, setWidgetLength, updateAllDBGNormals, updateAllDBGNormals, updateAllDBGSpheres, updateDBGNormals, updateDBGNormals, updateDBGSpheres, updateExistingDBGNormals, updateExistingDBGSpheres
private static final java.lang.String cvsid
protected float width
protected float height
protected float depth
protected float trackWidthFactor
Widget.widgetLength
to base width, NaN if noneprotected float trackHeightFactor
Widget.widgetLength
to base height, NaN if noneprotected float trackDepthFactor
Widget.widgetLength
to pyramid depth, NaN if nonepublic PyramidWidget(float width, float height, float depth)
Creates a new PyramidWidget with given dims.
width
- the non-negative base widthheight
- the non-negative base heightdepth
- the non-negative pyramid depthpublic PyramidWidget()
Covers PyramidWidget(float, float, float)
, uses width =
height= 1.0f, depth = 0.5f.
public boolean setLengths(float width, float height, float depth)
Set the pyramid dimensions.
width
- the new base width, ignored if NaN, otherwise must be
non-negativeheight
- the new base height, ignored if NaN, otherwise must be
non-negativedepth
- the new pyramid depth, ignored if NaN, otherwise must be
non-negativepublic boolean setWidth(float width)
setLengths(float, float, float)
, only changes base widthpublic boolean setHeight(float height)
setLengths(float, float, float)
, only changes base heightpublic boolean setDepth(float depth)
setLengths(float, float, float)
, only changes pyramid depthpublic boolean setLengthsAndAngles(float x, float y, float depth)
Like setLengths(float, float, float)
but sets base dimensions from given apex
angles.
public boolean setAngles(float x, float y)
Covers setLengthsAndAngles(float, float, float)
, does not change pyramid depth.
public boolean setAngleX(float x)
setAngles(float, float)
, only sets horizontal anglepublic boolean setAngleY(float y)
setAngles(float, float)
, only sets vertical anglepublic void trackWidgetLength(float... trackFactor)
Set trackWidthFactor
, trackHeightFactor
, and trackDepthFactor
, see class header doc.
trackWidgetLength
in class Widget
protected void widgetLengthChanged()
Widget.widgetLength
tracking, see class header docwidgetLengthChanged
in class Widget