ch.randelshofer.rubik
Class AbstractRubiksCubeIdx3D
java.lang.Object
ch.randelshofer.rubik.AbstractCube3D
ch.randelshofer.rubik.AbstractCubeIdx3D
ch.randelshofer.rubik.AbstractRubiksCubeIdx3D
- All Implemented Interfaces:
- Cube3D, CubeListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener
- Direct Known Subclasses:
- RubiksBarrelIdx3D, RubiksCubeIdx3D, RubiksCuboctahedronIdx3D, RubiksDiamondIdx3D
public abstract class AbstractRubiksCubeIdx3D
- extends AbstractCubeIdx3D
Abstract base class for the geometrical representation of a RubiksCube
using the Idx3D engine.
Each part is represented by a idx3d_Object. The idx3d_Object is a child of
an idx3d_Group which represents the explosion factor. The idx3d_Group is
a child of the idx3d_Scene.
- Version:
- 3.0 2007-12-30 Adapted to changes in AbstractCube.
2.2 2007-09-09 Use SplineInterpolator for cube twists.
2.1 2006-02-21 Avoid unecessary object creation.
2.0 2004-08-29 Reflectivity of part fill color increased from 160
to 300. We use now a hierarchical scene graph. Support for explosion addded.
1.0 December 26, 2003 Created.
- Author:
- Werner Randelshofer
|
Field Summary |
protected static float |
PART_LENGTH
A cube part has a side length of 18 mm. |
| Fields inherited from class ch.randelshofer.rubik.AbstractCubeIdx3D |
alphaBetaTransform, cachedStickersImage, centerCount, centerOffset, cornerCount, cornerOffset, edgeCount, edgeOffset, explosion, explosionShift, explosionTransforms, HALF_PI, identityNormalMatrix, identityVertexMatrix, isInStartedPlayer, locationTransforms, partCount, parts, PI, scaleTransform, scene, sharedLightmap, sideCount, sideOffset, stickersTexture |
| Methods inherited from class ch.randelshofer.rubik.AbstractCubeIdx3D |
dispose, getLock, getPart, getPartCount, getScene, initActions, isInStartedPlayer, setInStartedPlayer, setStickerBeveling, updateAlphaBeta, updateAttributes, updateCube, updateExplosionFactor, updateExplosionFactor, updatePartFillColor, updatePartOutlineColor, updatePartsFillColor, updatePartsVisibility, updatePartVisibility, updateScaleFactor, updateScaleFactor, updateStickerFillColor, updateStickersFillColor, updateStickersImage, updateStickerVisibility, validateAlphaBeta, validateAttributes, validateCube, validateScaleFactor, validateStickersImage |
| Methods inherited from class ch.randelshofer.rubik.AbstractCube3D |
addChangeListener, addCube3DListener, createAttributes, cubeChanged, dispatch, fireActionPerformed, fireMouseEntered, fireMouseExited, fireMousePressed, fireMouseReleased, fireStateChanged, getAnimator, getAttributes, getCube, getDispatcher, isAdjusting, isAnimated, isAnimating, isShowGhostParts, propertyChange, removeChangeListener, removeCube3DListener, setAnimated, setAnimator, setAttributes, setCube, setDispatcher, setLock, setShowGhostParts, stateChanged, stopAnimation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ch.randelshofer.rubik.Cube3D |
getKind |
PART_LENGTH
protected static final float PART_LENGTH
- A cube part has a side length of 18 mm.
- See Also:
- Constant Field Values
AbstractRubiksCubeIdx3D
public AbstractRubiksCubeIdx3D()
- Creates a new instance.
init
protected void init()
getUnitScaleFactor
protected float getUnitScaleFactor()
- Overrides:
getUnitScaleFactor in class AbstractCubeIdx3D
getPartIndexForStickerIndex
public abstract int getPartIndexForStickerIndex(int stickerIndex)
- Specified by:
getPartIndexForStickerIndex in interface Cube3D- Specified by:
getPartIndexForStickerIndex in class AbstractCube3D
getPartFaceIndexForStickerIndex
protected abstract int getPartFaceIndexForStickerIndex(int stickerIndex)
- Specified by:
getPartFaceIndexForStickerIndex in class AbstractCube3D
getStickerIndexForPart
protected abstract int getStickerIndexForPart(int part,
int orientation)
getStickerCount
protected abstract int getStickerCount()
- Specified by:
getStickerCount in class AbstractCube3D
initEdges
protected abstract void initEdges()
initCorners
protected abstract void initCorners()
initSides
protected abstract void initSides()
initCenter
protected void initCenter()
initTransforms
protected void initTransforms()
cubeTwisted
public void cubeTwisted(CubeEvent evt)
- Specified by:
cubeTwisted in interface CubeListener- Overrides:
cubeTwisted in class AbstractCube3D
validateTwist
public void validateTwist(int[] partIndices,
int[] locations,
int[] orientations,
int length,
int axis,
int angle,
float alpha)
- Specified by:
validateTwist in class AbstractCubeIdx3D