diff options
Diffstat (limited to 'ardor3d-extras')
12 files changed, 213 insertions, 110 deletions
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/atlas/TexturePacker.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/atlas/TexturePacker.java index 36d2025..7eac4aa 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/atlas/TexturePacker.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/atlas/TexturePacker.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -40,21 +40,21 @@ import com.ardor3d.util.geom.BufferUtils; * involved. * <p> * Simple use case: - * <p> + * </p> * <blockquote> - * + * * <pre> * // Create a texture atlas packer with maximum atlas size of 256x256 * final TexturePacker packer = new TexturePacker(256, 256); - * + * * // Add meshes into atlas (lots of different ways of doing this if you have other source/target texture indices) * packer.insert(mesh1); * packer.insert(mesh2); - * + * * // Create all the atlases (also possible to set filters etc here through the AtlasTextureParameter) * packer.createAtlases(); * </pre> - * + * * </blockquote> */ public class TexturePacker { @@ -108,8 +108,8 @@ public class TexturePacker { } final ImageDataFormat format = parameterObject.getTexture().getImage().getDataFormat(); if (format != ImageDataFormat.RGB && format != ImageDataFormat.RGBA) { - TexturePacker.logger.warning("Skipping mesh! - Only RGB and RGBA texture formats supported currently: " - + parameterObject); + TexturePacker.logger.warning( + "Skipping mesh! - Only RGB and RGBA texture formats supported currently: " + parameterObject); return; } @@ -342,9 +342,8 @@ public class TexturePacker { fillDataBuffer(dataAsFloatBuffer, dataAsFloatBuffer, sourceIndex, targetIndex, useAlpha); } - private void setDataPixel(final Rectangle2 rectangle, final int width, final int height, - final ByteBuffer lightData, final ByteBuffer dataAsFloatBuffer, final int y, final int x, - final boolean sourceAlpha) { + private void setDataPixel(final Rectangle2 rectangle, final int width, final int height, final ByteBuffer lightData, + final ByteBuffer dataAsFloatBuffer, final int y, final int x, final boolean sourceAlpha) { final int componentsSource = sourceAlpha ? 4 : 3; final int componentsTarget = useAlpha ? 4 : 3; diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java index aa822a4..fdd91e8 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java @@ -17,9 +17,15 @@ public class SpatialState { protected Transform _transform = new Transform(); - public SpatialState() {} + public SpatialState() { + } - /** copy constructor */ + /** + * copy constructor + * + * @param toCopy + * the instance to copy + */ public SpatialState(final SpatialState toCopy) { _transform.set(toCopy._transform); } diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/filter/UpdateFilter.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/filter/UpdateFilter.java index 0e4646a..b4fcb16 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/filter/UpdateFilter.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/filter/UpdateFilter.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -21,22 +21,25 @@ public interface UpdateFilter { /** * Called after a successful application of mouse/key input. - * + * * @param manager + * the manager */ void applyFilter(InteractManager manager); /** * Callback for when a control begins a drag operation. - * + * * @param manager + * the manager */ void beginDrag(InteractManager manager); /** * Callback for when a control ends a drag operation. - * + * * @param manager + * the manager */ void endDrag(InteractManager manager); diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/widget/RotateWidget.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/widget/RotateWidget.java index a15cc80..3518736 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/widget/RotateWidget.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/widget/RotateWidget.java @@ -74,7 +74,7 @@ public class RotateWidget extends AbstractInteractWidget { * Call this after creating the rings you want to use. * * @param texture - * @return + * the texture to set */ public void setTexture(final Texture2D texture) { if (_xRing != null) { @@ -317,8 +317,8 @@ public class RotateWidget extends AbstractInteractWidget { // apply to our interact matrix if used if (_interactMatrix == InteractMatrix.World) { - _rotateStore.multiplyLocal(new Quaternion().fromVectorToVector(_calcVec3A, _calcVec3B).toRotationMatrix( - _calcMat3)); + _rotateStore.multiplyLocal( + new Quaternion().fromVectorToVector(_calcVec3A, _calcVec3B).toRotationMatrix(_calcMat3)); } // convert to target coord space diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java index 2683123..b59e98c 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java @@ -57,6 +57,7 @@ public class ObjExporter { * @param mtlFile * material file, optional * @throws IOException + * exception */ public void save(final Mesh mesh, final File objFile, final File mtlFile) throws IOException { if (mesh.getControllerCount() == 0 || !(mesh.getController(0) instanceof KeyframeController)) { @@ -85,6 +86,7 @@ public class ObjExporter { * @param customTextureName * texture name that overrides the one of the mesh (except in key frames), optional * @throws IOException + * exception */ public void save(final List<Mesh> meshList, final File objFile, final File mtlFile, final String customTextureName) throws IOException { @@ -141,6 +143,7 @@ public class ObjExporter { * @param customTextureName * texture name that overrides the one of the mesh, optional * @throws IOException + * exception */ protected void save(final Mesh mesh, final File objFile, final File mtlFile, final boolean append, final int firstVertexIndex, final boolean firstFiles, final List<ObjMaterial> materialList, diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/stl/StlImporter.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/stl/StlImporter.java index a5aeed9..bac050d 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/stl/StlImporter.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/stl/StlImporter.java @@ -33,8 +33,8 @@ import com.ardor3d.util.resource.ResourceSource; * * This class supports both ASCII and Binary formats and files residing either locally or on a network. * - * Refer to <a href="http://en.wikipedia.org/wiki/STL_(file_format)" target="_blank>Wikipedia</a>. Several STL models - * can be downloaded freely from <a href="http://grabcad.com" target="_blank">GrabCAD</a>. + * Refer to <a href="http://en.wikipedia.org/wiki/STL_(file_format)">Wikipedia</a>. Several STL models can be downloaded + * freely from <a href="http://grabcad.com">GrabCAD</a>. * * @author gmseed * @see StlFileParser diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/KeyframeController.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/KeyframeController.java index e84db4f..a41e53f 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/KeyframeController.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/KeyframeController.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -29,24 +29,24 @@ import com.ardor3d.util.geom.BufferUtils; /** * TODO: Revisit for better Ardor3D integration. - * + * * Started Date: Jun 12, 2004 <br> - * - * + * + * * Class can do linear interpolation of a Mesh between units of time. Similar to VertexKeyframeController but * interpolates float units of time instead of integer key frames. - * + * * setSpeed(float) sets a speed relative to the defined speed. For example, the default is 1. A speed of 2 would run * twice as fast and a speed of .5 would run half as fast - * + * * setMinTime(float) and setMaxTime(float) both define the bounds that KeyframeController should follow. It is the * programmer's responsibility to make sure that the MinTime and MaxTime are within the span of the defined setKeyframe - * + * * Controller functions RepeatType and isActive are both defined in their default way for KeyframeController - * + * * When this controller is saved/loaded to XML format, it assumes that the mesh it morphs is the Mesh it belongs to, so * it is recommended to only attach this controller to the Mesh it animates. - * + * * (Based on work by Jack Lindamood, kevglass (parts), hevee (blend time), Julien Gouesse (port to Ardor3D)) */ @@ -144,6 +144,8 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * Gets the current time in the animation + * + * @return the current time in the animation */ public double getCurTime() { return _curTime; @@ -151,7 +153,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * Sets the current time in the animation - * + * * @param time * The time this Controller should continue at */ @@ -161,7 +163,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * Sets the Mesh that will be physically changed by this KeyframeController - * + * * @param morph * The new mesh to morph */ @@ -176,21 +178,19 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl } /** - * Tells the controller to change its morphMesh to shape at time seconds. Time must be >=0 and shape must be + * Tells the controller to change its morphMesh to shape at time seconds. Time must be >=0 and shape must be * non-null and shape must have the same number of vertexes as the current shape. If not, then nothing happens. It * is also required that setMorphingMesh(Mesh) is called before setKeyframe. It is assumed that shape.indices == * morphMesh.indices, otherwise morphing may look funny - * + * * @param time * The time for the change * @param shape * The new shape at that time */ public void setKeyframe(final double time, final Mesh shape) { - if (_morphMesh == null - || time < 0 - || shape.getMeshData().getVertexBuffer().capacity() != _morphMesh.getMeshData().getVertexBuffer() - .capacity()) { + if (_morphMesh == null || time < 0 || shape.getMeshData().getVertexBuffer().capacity() != _morphMesh + .getMeshData().getVertexBuffer().capacity()) { return; } for (int i = 0; i < _keyframes.size(); i++) { @@ -220,7 +220,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl * <br> * This would be useful for example when a figure stops running and tries to raise an arm. Instead of "teleporting" * to the raise-arm animation beginning, a smooth translation can occur. - * + * * @param newTimeToReach * The time to reach. * @param translationLen @@ -292,7 +292,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl * warning is set and nothing happens. <br> * It is suggested that this function be called if new animation boundaries need to be set, instead of setMinTime * and setMaxTime directly. - * + * * @param newBeginTime * The starting time * @param newEndTime @@ -328,7 +328,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * Saves whatever the current morphMesh looks like into the dataCopy - * + * * @param dataCopy * The copy to save the current mesh into */ @@ -389,8 +389,8 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl final IndexBufferData<?> mmInds = _morphMesh.getMeshData().getIndices(); mmInds.clear(); if (dcInds == null || dcInds.capacity() != mmInds.capacity() || dcInds.getClass() != mmInds.getClass()) { - dcInds = BufferUtils.createIndexBufferData(mmInds.capacity(), _morphMesh.getMeshData() - .getVertexBuffer().capacity() - 1); + dcInds = BufferUtils.createIndexBufferData(mmInds.capacity(), + _morphMesh.getMeshData().getVertexBuffer().capacity() - 1); dcInds.clear(); dataCopy.getMeshData().setIndices(dcInds); } @@ -418,7 +418,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * As defined in Controller - * + * * @param time * as defined in Controller */ @@ -460,20 +460,23 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl final FloatBuffer verts = _morphMesh.getMeshData().getVertexBuffer(); final FloatBuffer norms = _morphMesh.getMeshData().getNormalBuffer(); - final FloatBuffer texts = _interpTex ? _morphMesh.getMeshData().getTextureCoords(0) != null ? _morphMesh - .getMeshData().getTextureCoords(0).getBuffer() : null : null; + final FloatBuffer texts = _interpTex ? _morphMesh.getMeshData().getTextureCoords(0) != null + ? _morphMesh.getMeshData().getTextureCoords(0).getBuffer() + : null : null; final FloatBuffer colors = _morphMesh.getMeshData().getColorBuffer(); final FloatBuffer oldverts = oldShape.getMeshData().getVertexBuffer(); final FloatBuffer oldnorms = oldShape.getMeshData().getNormalBuffer(); - final FloatBuffer oldtexts = _interpTex ? oldShape.getMeshData().getTextureCoords(0) != null ? oldShape - .getMeshData().getTextureCoords(0).getBuffer() : null : null; + final FloatBuffer oldtexts = _interpTex ? oldShape.getMeshData().getTextureCoords(0) != null + ? oldShape.getMeshData().getTextureCoords(0).getBuffer() + : null : null; final FloatBuffer oldcolors = oldShape.getMeshData().getColorBuffer(); final FloatBuffer newverts = newShape.getMeshData().getVertexBuffer(); final FloatBuffer newnorms = newShape.getMeshData().getNormalBuffer(); - final FloatBuffer newtexts = _interpTex ? newShape.getMeshData().getTextureCoords(0) != null ? newShape - .getMeshData().getTextureCoords(0).getBuffer() : null : null; + final FloatBuffer newtexts = _interpTex ? newShape.getMeshData().getTextureCoords(0) != null + ? newShape.getMeshData().getTextureCoords(0).getBuffer() + : null : null; final FloatBuffer newcolors = newShape.getMeshData().getColorBuffer(); if (verts == null || oldverts == null || newverts == null) { return; @@ -577,7 +580,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * If both min and max time are equal and the model is already updated, then it's an easy quit, or if it's on CLAMP * and I've exceeded my time it's also an easy quit. - * + * * @return true if update doesn't need to be called, false otherwise */ private boolean easyQuit() { @@ -594,7 +597,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * If true, the model's bounding volume will be updated every frame. If false, it will not. - * + * * @param update * The new update model volume per frame value. */ @@ -604,7 +607,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * Returns true if the model's bounding volume is being updated every frame. - * + * * @return True if bounding volume is updating. */ public boolean isUpdateBounding() { @@ -625,7 +628,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl * If repeat type RT_WRAP is set, after reaching the last frame of the currently set animation maxTime (see * Controller.setMaxTime), there will be an additional blendTime seconds long phase inserted, morphing from the last * frame to the first. - * + * * @param blendTime * The blend time to set */ @@ -635,7 +638,7 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl /** * Gets the currently set blending time for smooth animation transitions - * + * * @return The current blend time * @see #setBlendTime(float blendTime) */ @@ -741,11 +744,12 @@ public class KeyframeController<T extends Spatial> extends ComplexSpatialControl public double _time; - public PointInTime() {} + public PointInTime() { + } public PointInTime(final double time, final Mesh shape) { - this._time = time; - this._newShape = shape; + _time = time; + _newShape = shape; } @Override diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvFaceInfo.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvFaceInfo.java index 3f847ca..f1e5928 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvFaceInfo.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvFaceInfo.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -36,8 +36,9 @@ final class NvFaceInfo { /** * Copies only v0, v1 and v2 - * + * * @param source + * the source */ public NvFaceInfo(final NvFaceInfo source) { this(source._v0, source._v1, source._v2); diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripInfo.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripInfo.java index 575cd87..f2c5abb 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripInfo.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripInfo.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -37,7 +37,7 @@ final class NvStripInfo { } /** - * @return true if the experiment id is >= 0 + * @return true if the experiment id is >= 0 */ final boolean isExperiment() { return _experimentId >= 0; @@ -45,7 +45,8 @@ final class NvStripInfo { /** * @param faceInfo - * @return + * the face info + * @return <code>true</code> if it's in the strip */ final boolean IsInStrip(final NvFaceInfo faceInfo) { if (faceInfo == null) { @@ -56,10 +57,12 @@ final class NvStripInfo { } /** - * + * * @param faceInfo + * the face info * @param edgeInfos - * @return true if the input face and the current strip share an edge + * the edge infos + * @return <code>true</code> if the input face and the current strip share an edge */ boolean sharesEdge(final NvFaceInfo faceInfo, final List<NvEdgeInfo> edgeInfos) { // check v0->v1 edge @@ -88,9 +91,11 @@ final class NvStripInfo { /** * take the given forward and backward strips and combine them together - * + * * @param forward + * the forward strips * @param backward + * the backward strips */ void combine(final List<NvFaceInfo> forward, final List<NvFaceInfo> backward) { // add backward faces @@ -108,8 +113,10 @@ final class NvStripInfo { /** * @param faceVec + * the face list * @param face - * @return true if the face is "unique", i.e. has a vertex which doesn't exist in the faceVec + * the face + * @return <code>true</code> if the face is "unique", i.e. has a vertex which doesn't exist in the faceVec */ boolean unique(final List<NvFaceInfo> faceVec, final NvFaceInfo face) { boolean bv0, bv1, bv2; // bools to indicate whether a vertex is in the faceVec or not @@ -117,19 +124,22 @@ final class NvStripInfo { for (int i = 0; i < faceVec.size(); i++) { if (!bv0) { - if (faceVec.get(i)._v0 == face._v0 || faceVec.get(i)._v1 == face._v0 || faceVec.get(i)._v2 == face._v0) { + if (faceVec.get(i)._v0 == face._v0 || faceVec.get(i)._v1 == face._v0 + || faceVec.get(i)._v2 == face._v0) { bv0 = true; } } if (!bv1) { - if (faceVec.get(i)._v0 == face._v1 || faceVec.get(i)._v1 == face._v1 || faceVec.get(i)._v2 == face._v1) { + if (faceVec.get(i)._v0 == face._v1 || faceVec.get(i)._v1 == face._v1 + || faceVec.get(i)._v2 == face._v1) { bv1 = true; } } if (!bv2) { - if (faceVec.get(i)._v0 == face._v2 || faceVec.get(i)._v1 == face._v2 || faceVec.get(i)._v2 == face._v2) { + if (faceVec.get(i)._v0 == face._v2 || faceVec.get(i)._v1 == face._v2 + || faceVec.get(i)._v2 == face._v2) { bv2 = true; } } @@ -147,6 +157,11 @@ final class NvStripInfo { /** * If either the faceInfo has a real strip index because it is already assign to a committed strip OR it is assigned * in an experiment and the experiment index is the one we are building for, then it is marked and unavailable + * + * @param faceInfo + * the face info + * @return <code>true</code> if the face is marked + * */ boolean isMarked(final NvFaceInfo faceInfo) { return faceInfo._stripId >= 0 || isExperiment() && faceInfo._experimentId == _experimentId; @@ -154,8 +169,9 @@ final class NvStripInfo { /** * Marks the face with the current strip ID - * + * * @param faceInfo + * the face info */ void markTriangle(final NvFaceInfo faceInfo) { assert !isMarked(faceInfo); @@ -170,9 +186,11 @@ final class NvStripInfo { /** * Builds a strip forward as far as we can go, then builds backwards, and joins the two lists - * + * * @param edgeInfos + * the edge infos * @param faceInfos + * the face infos */ void build(final List<NvEdgeInfo> edgeInfos, final List<NvFaceInfo> faceInfos) { // used in building the strips forward and backward diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripifier.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripifier.java index fbdf921..d413a0b 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripifier.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvStripifier.java @@ -37,9 +37,13 @@ final class NvStripifier { * @param in_cacheSize * the target cache size * @param in_minStripLength + * the minimum strip length * @param maxIndex + * the maximum index * @param outStrips + * the strips * @param outFaceList + * the face list */ void stripify(final List<Integer> in_indices, final int in_cacheSize, final int in_minStripLength, final int maxIndex, final List<NvStripInfo> outStrips, final List<NvFaceInfo> outFaceList) { @@ -76,11 +80,16 @@ final class NvStripifier { * Generates actual strips from the list-in-strip-order. * * @param allStrips + * all strips * @param stripIndices + * the strip indices * @param bStitchStrips - * @param numSeparateStrips + * <code>true</code> if the strips are stitched * @param bRestart + * <code>true</code> if it restarts * @param restartVal + * restart value + * @return the number of separate strips */ int createStrips(final List<NvStripInfo> allStrips, final List<Integer> stripIndices, final boolean bStitchStrips, final boolean bRestart, final int restartVal) { @@ -211,7 +220,9 @@ final class NvStripifier { /** * @param faceA + * the face A * @param faceB + * the face B * @return the first vertex unique to faceB */ static int getUniqueVertexInB(final NvFaceInfo faceA, final NvFaceInfo faceB) { @@ -236,7 +247,9 @@ final class NvStripifier { /** * @param faceA + * the face A * @param faceB + * the face B * @return the (at most) two vertices shared between the two faces */ static int[] getSharedVertices(final NvFaceInfo faceA, final NvFaceInfo faceB) { @@ -309,9 +322,12 @@ final class NvStripifier { /** * @param faceInfo + * the face info * @param v0 + * the vertex 0 * @param v1 - * @return true if the face is ordered in CW fashion + * the vertex 1 + * @return <code>true</code> if the face is ordered in CW fashion */ static boolean isCW(final NvFaceInfo faceInfo, final int v0, final int v1) { if (faceInfo._v0 == v0) { @@ -326,7 +342,8 @@ final class NvStripifier { /** * * @param numIndices - * @return true if the next face should be ordered in CW fashion + * the number of indices + * @return <code>true</code> if the next face should be ordered in CW fashion */ static boolean nextIsCW(final int numIndices) { return numIndices % 2 == 0; @@ -334,7 +351,9 @@ final class NvStripifier { /** * @param indices + * the indices * @param face + * the face * @return vertex of the input face which is "next" in the input index list */ static int getNextIndex(final List<Integer> indices, final NvFaceInfo face) { @@ -386,9 +405,12 @@ final class NvStripifier { * find the edge info for these two indices * * @param edgeInfos + * the edge infos * @param v0 + * the vertex 0 * @param v1 - * @return + * the vertex 1 + * @return the edge info */ static NvEdgeInfo findEdgeInfo(final List<NvEdgeInfo> edgeInfos, final int v0, final int v1) { // we can get to it through either array because the edge infos have a v0 and v1 and there is no order except @@ -417,10 +439,14 @@ final class NvStripifier { * find the other face sharing these vertices * * @param edgeInfos + * the edge infos * @param v0 + * the vertex 0 * @param v1 + * the vertex 1 * @param faceInfo - * @return + * the face info + * @return the other face sharing these vertices */ @SuppressWarnings("null") static NvFaceInfo findOtherFace(final List<NvEdgeInfo> edgeInfos, final int v0, final int v1, @@ -441,8 +467,10 @@ final class NvStripifier { * because we're stripifying in the same general orientation. * * @param faceInfos + * the face infos * @param edgeInfos - * @return + * the edge infos + * @return the good reset point */ NvFaceInfo findGoodResetPoint(final List<NvFaceInfo> faceInfos, final List<NvEdgeInfo> edgeInfos) { // we hop into different areas of the mesh to try to get other large open spans done. Areas of small strips can @@ -500,9 +528,13 @@ final class NvStripifier { * around the mesh some, to ensure that large open spans of strips get generated. * * @param allStrips + * all strips * @param allFaceInfos + * all face infos * @param allEdgeInfos + * all edge infos * @param numSamples + * the number of samples */ @SuppressWarnings("unchecked") void findAllStrips(final List<NvStripInfo> allStrips, final List<NvFaceInfo> allFaceInfos, @@ -643,9 +675,13 @@ final class NvStripifier { * to maximize cache hits. The final strips are stored in outStrips * * @param allStrips + * all strips * @param outStrips + * the resulting strips * @param edgeInfos + * the edge infos * @param outFaceList + * the resulting face list */ void splitUpStripsAndOptimize(final List<NvStripInfo> allStrips, final List<NvStripInfo> outStrips, final List<NvEdgeInfo> edgeInfos, final List<NvFaceInfo> outFaceList) { @@ -919,10 +955,14 @@ final class NvStripifier { * Finds the next face to start the next strip on. * * @param faceInfos + * the face infos * @param edgeInfos + * the edge infos * @param strip + * the strip * @param startInfo - * @return + * the start info + * @return <code>true</code> if the next face to start the next strip on is found */ boolean findTraversal(final List<NvFaceInfo> faceInfos, final List<NvEdgeInfo> edgeInfos, final NvStripInfo strip, final NvStripStartInfo startInfo) { @@ -963,7 +1003,9 @@ final class NvStripifier { * "Commits" the input strips by setting their m_experimentId to -1 and adding to the allStrips vector * * @param allStrips + * all strips * @param strips + * the strips */ void commitStrips(final List<NvStripInfo> allStrips, final List<NvStripInfo> strips) { // Iterate through strips @@ -986,6 +1028,7 @@ final class NvStripifier { /** * * @param strips + * the strips * @return the average strip size of the input vector of strips */ float avgStripSize(final List<NvStripInfo> strips) { @@ -1001,8 +1044,10 @@ final class NvStripifier { * Finds a good starting point, namely one which has only one neighbor * * @param faceInfos + * the face infos * @param edgeInfos - * @return + * the edge infos + * @return the good starting point or -1 */ int findStartPoint(final List<NvFaceInfo> faceInfos, final List<NvEdgeInfo> edgeInfos) { int bestCtr = -1; @@ -1039,7 +1084,9 @@ final class NvStripifier { * Updates the input vertex cache with this strip's vertices * * @param vcache + * the vertex cache * @param strip + * the strip */ void updateCacheStrip(final VertexCache vcache, final NvStripInfo strip) { for (final NvFaceInfo face : strip._faces) { @@ -1051,7 +1098,9 @@ final class NvStripifier { * Updates the input vertex cache with this face's vertices * * @param vcache + * the vertex cache * @param face + * the face */ void updateCacheFace(final VertexCache vcache, final NvFaceInfo face) { if (!vcache.inCache(face._v0)) { @@ -1069,7 +1118,9 @@ final class NvStripifier { /** * @param vcache + * the vertex cache * @param strip + * the strip * @return the number of cache hits per face in the strip */ float calcNumHitsStrip(final VertexCache vcache, final NvStripInfo strip) { @@ -1097,7 +1148,9 @@ final class NvStripifier { /** * @param vcache + * the vertex cache * @param face + * the face * @return the number of cache hits in the face */ int calcNumHitsFace(final VertexCache vcache, final NvFaceInfo face) { @@ -1121,7 +1174,9 @@ final class NvStripifier { /** * * @param face + * the face * @param edgeInfoVec + * the edge info list * @return the number of neighbors that this face has */ int numNeighbors(final NvFaceInfo face, final List<NvEdgeInfo> edgeInfoVec) { @@ -1146,8 +1201,11 @@ final class NvStripifier { * Builds the list of all face and edge infos * * @param faceInfos + * the face infos * @param edgeInfos + * the edge infos * @param maxIndex + * the maximum index */ void buildStripifyInfo(final List<NvFaceInfo> faceInfos, final List<NvEdgeInfo> edgeInfos, final int maxIndex) { // reserve space for the face infos, but do not resize them. diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvTriangleStripper.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvTriangleStripper.java index 71f8870..83bc901 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvTriangleStripper.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/util/nvtristrip/NvTriangleStripper.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -44,11 +44,12 @@ public class NvTriangleStripper implements Visitor { /** * For GPUs that support primitive restart, this sets a value as the restart index - * + * * Restart is meaningless if strips are not being stitched together, so enabling restart makes NvTriStrip forcing * stitching. So, you'll get back one strip. - * + * * @param restartVal + * restart value */ public void enableRestart(final int restartVal) { _restart = true; @@ -67,10 +68,10 @@ public class NvTriangleStripper implements Visitor { } /** - * Sets the cache size which the stripfier uses to optimize the data. Controls the length of the generated + * Sets the cache size which the stripifier uses to optimize the data. Controls the length of the generated * individual strips. This is the "actual" cache size, so 24 for GeForce3 and 16 for GeForce1/2 You may want to play * around with this number to tweak performance. - * + * * @param cacheSize * (Default value: 24) */ @@ -86,7 +87,7 @@ public class NvTriangleStripper implements Visitor { * boolean to indicate whether to stitch together strips into one huge strip or not. If set to true, you'll get back * one huge strip stitched together using degenerate triangles. If set to false, you'll get back a large number of * separate strips. - * + * * @param bStitchStrips * (Default value: true) */ @@ -99,10 +100,10 @@ public class NvTriangleStripper implements Visitor { } /** - * + * * Sets the minimum acceptable size for a strip, in triangles. All strips generated which are shorter than this will * be thrown into one big, separate list. - * + * * @param minSize * (Default value: 0) */ @@ -116,7 +117,7 @@ public class NvTriangleStripper implements Visitor { /** * If set to true, will return an optimized list, with no strips at all. - * + * * @param bListsOnly * (Default value: false) */ @@ -130,7 +131,7 @@ public class NvTriangleStripper implements Visitor { /** * If set to true, will call remapIndices after generateStrips. - * + * * @param reorder * (Default value: false) * @see #remapIndices(PrimitiveGroup[], AtomicReference, int) @@ -144,17 +145,23 @@ public class NvTriangleStripper implements Visitor { } /** - * - Returns true if the two triangles defined by firstTri and secondTri are the same The "same" is defined in this - * case as having the same indices with the same winding order - * + * + * Returns <code>true</code> if the two triangles defined by firstTri and secondTri are the same The "same" is + * defined in this case as having the same indices with the same winding order + * * @param firstTri0 + * index 0 of the first triangle * @param firstTri1 + * index 1 of the first triangle * @param firstTri2 + * index 2 of the first triangle * @param secondTri0 + * index 0 of the second triangle * @param secondTri1 + * index 1 of the second triangle * @param secondTri2 - * @return + * index 2 of the second triangle + * @return <code>true</code> if the two triangles are the same */ boolean sameTriangle(final int firstTri0, final int firstTri1, final int firstTri2, final int secondTri0, final int secondTri1, final int secondTri2) { @@ -183,7 +190,8 @@ public class NvTriangleStripper implements Visitor { return isSame; } - boolean testTriangle(final int v0, final int v1, final int v2, final List<NvFaceInfo> in_bins[], final int NUMBINS) { + boolean testTriangle(final int v0, final int v1, final int v2, final List<NvFaceInfo> in_bins[], + final int NUMBINS) { // hash this triangle boolean isLegit = false; int ctr = v0 % NUMBINS; @@ -225,10 +233,11 @@ public class NvTriangleStripper implements Visitor { } /** - * + * * @param in_indices * input index list, the indices you would use to render * @param validate + * <code>true</code> if the generated data are validated against the input * @return array of optimized/stripified PrimitiveGroups */ @SuppressWarnings("unchecked") @@ -445,13 +454,15 @@ public class NvTriangleStripper implements Visitor { /** * Function to remap your indices to improve spatial locality in your vertex buffer. - * + * * Note that you must reorder your vertex buffer according to the remapping handed back to you. - * + * * Credit goes to the MS Xbox crew for the idea for this interface. - * + * * @param in_primGroups * array of PrimitiveGroups you want remapped + * @param remappedVertices + * store of the remapped vertices if not null * @param numVerts * number of vertices in your vertex buffer, also can be thought of as the range of acceptable values for * indices in your primitive groups. diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/useful/TrailMesh.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/useful/TrailMesh.java index da73655..39b75e2 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/useful/TrailMesh.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/useful/TrailMesh.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -78,7 +78,7 @@ public class TrailMesh extends Mesh { /** * Creates a new TrailMesh. - * + * * @param name * Name of Spatial * @param nrTrailSections @@ -100,7 +100,7 @@ public class TrailMesh extends Mesh { /** * Update the front position of the trail. - * + * * @param position * New position of the trail front * @param width @@ -114,7 +114,7 @@ public class TrailMesh extends Mesh { /** * Update the front position of the trail. - * + * * @param position * New position of the trail front * @param tangent @@ -158,7 +158,7 @@ public class TrailMesh extends Mesh { /** * Update the vertices of the trail. - * + * * @param camPos * Camera position used for billboarding. */ @@ -248,8 +248,8 @@ public class TrailMesh extends Mesh { } else if (i == nrTrailSections - 1) { trailDirection.set(trailVector).subtractLocal(trailVectors.get(i - 1).interpolatedPosition); } else { - trailDirection.set(trailVectors.get(i + 1).interpolatedPosition).subtractLocal( - trailVectors.get(i - 1).interpolatedPosition); + trailDirection.set(trailVectors.get(i + 1).interpolatedPosition) + .subtractLocal(trailVectors.get(i - 1).interpolatedPosition); } trailCamVec.set(trailVector).subtractLocal(camPos); @@ -340,8 +340,8 @@ public class TrailMesh extends Mesh { /** * Get the mesh data to modify it manually. If data is modified, invalidate() method call is required. - * - * @return + * + * @return the mesh data */ public LinkedList<TrailData> getTrailData() { return trailVectors; |