diff options
author | Julien Gouesse <[email protected]> | 2019-06-01 22:53:18 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2019-06-01 22:53:18 +0200 |
commit | 88c55a6d3cadaabe60e9e859030d4a216fafad55 (patch) | |
tree | 4e87cfb9aa93c1b31ae408a9effe750f6b291a70 /ardor3d-effects | |
parent | bc8a854ffc5fa0bf11b1a0c3e45b136a6ad3a33a (diff) |
Fixes some errors in the Java documentation of ardor3d-effects
Diffstat (limited to 'ardor3d-effects')
6 files changed, 176 insertions, 137 deletions
diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/Particle.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/Particle.java index 1d2d7c5..6b466ec 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/Particle.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/Particle.java @@ -65,11 +65,12 @@ public class Particle implements Savable { /** * Empty constructor - mostly for use with Savable interface */ - public Particle() {} + public Particle() { + } /** * Normal use constructor. Sets up the parent and particle type for this particle. - * + * * @param parent * the particle collection this particle belongs to */ @@ -91,7 +92,7 @@ public class Particle implements Savable { * Cause this particle to reset it's color, age and size per the parent's settings. status is set to * Status.Available. Location, velocity and lifespan are set as given. Actual geometry data is not affected by this * call, only particle params. - * + * * @param velocity * new initial particle velocity * @param position @@ -113,7 +114,7 @@ public class Particle implements Savable { /** * Reset particle conditions. Besides the passed lifespan, we also reset color, size, and spin angle to their * starting values (as given by parent.) Status is set to Status.Available. - * + * * @param lifeSpan * the recreated particle's new lifespan */ @@ -131,7 +132,7 @@ public class Particle implements Savable { * Update the vertices for this particle, taking size, spin and viewer into consideration. In the case of particle * type ParticleType.GeomMesh, the original triangle normal is maintained rather than rotating it to face the camera * or parent vectors. - * + * * @param cam * Camera to use in determining viewer aspect. If null, or if parent is not set to camera facing, * parent's left and up vectors are used. @@ -245,7 +246,7 @@ public class Particle implements Savable { * (interpolating between start and end size), spin (using parent's spin speed) and current age of particle. If this * particle's age is greater than its lifespan, it is set to status DEAD. * </p> - * + * * @param secondsPassed * number of seconds passed since last update. * @return true if this particle is not ALIVE (in other words, if it is ready to be reused.) @@ -270,8 +271,8 @@ public class Particle implements Savable { // interpolate colors final int verts = ParticleSystem.getVertsForParticleType(type); for (int x = 0; x < verts; x++) { - BufferUtils.setInBuffer(currColor, parent.getParticleGeometry().getMeshData().getColorBuffer(), startIndex - + x); + BufferUtils.setInBuffer(currColor, parent.getParticleGeometry().getMeshData().getColorBuffer(), + startIndex + x); } // check for tex animation @@ -343,7 +344,7 @@ public class Particle implements Savable { /** * Set the position of the particle in space. - * + * * @param position * the new position in world coordinates */ @@ -361,7 +362,7 @@ public class Particle implements Savable { /** * Set the status of this particle. - * + * * @param status * new status of this particle * @see Status @@ -379,7 +380,7 @@ public class Particle implements Savable { /** * Set the current velocity of this particle - * + * * @param velocity * the new velocity */ @@ -403,8 +404,9 @@ public class Particle implements Savable { /** * Set the starting index where this particle is represented in its parent's geometry data - * + * * @param index + * the starting index where this particle is represented in its parent's geometry data */ public void setStartIndex(final int index) { startIndex = index; @@ -440,7 +442,7 @@ public class Particle implements Savable { * particle will maintain the triangle's ratio and plane of orientation. It will spin (if applicable) around the * triangle's normal axis. The triangle should already have its center and normal fields calculated before calling * this method. - * + * * @param t * the triangle to model this particle after. */ diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleController.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleController.java index 5d1d6be..08f521f 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleController.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleController.java @@ -71,7 +71,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Update the particles managed by this manager. If any particles are "dead" recreate them at the origin position * (which may be a point, line or rectangle.) - * + * * @param secondsPassed * double precision time * @param particles @@ -87,8 +87,8 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> // If instructed, check to see if our last frustum check passed if (isUpdateOnlyInView()) { - final Camera cam = _viewCamera != null ? _viewCamera : ContextManager.getCurrentContext() - .getCurrentCamera(); + final Camera cam = _viewCamera != null ? _viewCamera + : ContextManager.getCurrentContext().getCurrentCamera(); if (cam != null) { final int state = cam.getPlaneState(); final boolean out = cam.contains(particles.getWorldBound()).equals(FrustumIntersect.Outside); @@ -127,8 +127,8 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> // is added to any current value Note this is a double value, // so we will keep adding up partial particles - _releaseParticles += (particles.getReleaseRate() * _timePassed * (1.0 + _releaseVariance - * (MathUtils.nextRandomFloat() - 0.5))); + _releaseParticles += (particles.getReleaseRate() * _timePassed + * (1.0 + _releaseVariance * (MathUtils.nextRandomFloat() - 0.5))); // Try to create all "whole" particles we have added up _particlesToCreate = (int) _releaseParticles; @@ -249,8 +249,9 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> if (anyAlive) { boolean updateMB = true; final Camera cam = _viewCamera != null ? _viewCamera - : (ContextManager.getCurrentContext() != null ? ContextManager.getCurrentContext() - .getCurrentCamera() : null); + : (ContextManager.getCurrentContext() != null + ? ContextManager.getCurrentContext().getCurrentCamera() + : null); if (cam != null) { final int state = cam.getPlaneState(); updateMB = cam.contains(particles.getWorldBound()).equals(FrustumIntersect.Outside); @@ -266,7 +267,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Get how soon after the last update the manager will send updates to the particles. - * + * * @return The precision. */ public double getPrecision() { @@ -278,7 +279,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> * <br> * This means that if an update is called every 2ms (e.g. running at 500 FPS) the particles position and stats will * be updated every fifth frame with the elapsed time (in this case, 10ms) since previous update. - * + * * @param precision * in seconds */ @@ -289,7 +290,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Get the variance possible on the release rate. 0.0f = no variance 0.5f = between releaseRate / 2f and 1.5f * * releaseRate - * + * * @return release variance as a percent. */ public double getReleaseVariance() { @@ -298,7 +299,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Set the variance possible on the release rate. - * + * * @param variance * release rate +/- variance as a percent (eg. .5 = 50%) */ @@ -308,7 +309,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Does this manager regulate the particle flow? - * + * * @return true if this manager regulates how many particles per sec are emitted. */ public boolean isControlFlow() { @@ -317,7 +318,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Set the regulate flow property on the manager. - * + * * @param regulate * regulate particle flow. */ @@ -327,7 +328,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Does this manager use the particle's bounding volume to limit updates? - * + * * @return true if this manager only updates the particles when they are in view. */ public boolean isUpdateOnlyInView() { @@ -336,7 +337,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Set the updateOnlyInView property on the manager. - * + * * @param updateOnlyInView * use the particle's bounding volume to limit updates. */ @@ -363,7 +364,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Return the number this manager has warmed up - * + * * @return int */ public int getIterations() { @@ -372,8 +373,9 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Sets the iterations for the warmup and calls warmUp with the number of iterations as the argument - * + * * @param iterations + * the iterations for the warmup */ public void setIterations(final int iterations) { this.iterations = iterations; @@ -381,7 +383,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Add an external influence to this particle controller. - * + * * @param influence * ParticleInfluence */ @@ -394,7 +396,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Remove an influence from this particle controller. - * + * * @param influence * ParticleInfluence * @return true if found and removed. @@ -408,7 +410,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Returns the list of influences acting on this particle controller. - * + * * @return ArrayList */ public List<ParticleInfluence> getInfluences() { @@ -423,7 +425,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Subscribe a listener to receive mouse events. Enable event generation. - * + * * @param listener * to be subscribed */ @@ -437,7 +439,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Unsubscribe a listener. Disable event generation if no more listeners. - * + * * @param listener * to be unsuscribed * @see #addListener(ParticleControllerListener) @@ -459,7 +461,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Check if a listener is allready added to this ParticleController - * + * * @param listener * listener to check for * @return true if listener is contained in the listenerlist @@ -473,7 +475,7 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Get all added ParticleController listeners - * + * * @return ArrayList of listeners added to this ParticleController */ public List<ParticleControllerListener> getListeners() { @@ -483,9 +485,11 @@ public class ParticleController extends ComplexSpatialController<ParticleSystem> /** * Runs the update method of this particle manager X number of times passing .1 seconds for each call. This is used * to "warm up" and get the particle manager going. - * + * * @param iterations * The number of iterations to warm up. + * @param particles + * the particle system */ public void warmUp(int iterations, final ParticleSystem particles) { // first set the initial positions of all the verts diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.java index 0f74bcc..dc31541 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.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>. */ @@ -110,7 +110,8 @@ public abstract class ParticleSystem extends Node { protected Vector3 _oldEmit = new Vector3(Float.NaN, Float.NaN, Float.NaN); protected double _matData[] = new double[9]; - public ParticleSystem() {} + public ParticleSystem() { + } public ParticleSystem(final String name, final int numParticles) { this(name, numParticles, ParticleType.Quad); @@ -275,7 +276,7 @@ public abstract class ParticleSystem extends Node { /** * Set the start color for particles. - * + * * @param color * The new start color. */ @@ -293,7 +294,7 @@ public abstract class ParticleSystem extends Node { /** * Set the end color for particles. The base color of the particle will linearly approach this color from the start * color over the lifetime of the particle. - * + * * @param color * ColorRGBA The ending color. */ @@ -303,7 +304,7 @@ public abstract class ParticleSystem extends Node { /** * getEndColor returns the ending color. - * + * * @return The ending color */ public ReadOnlyColorRGBA getEndColor() { @@ -312,7 +313,7 @@ public abstract class ParticleSystem extends Node { /** * Set the start and end spinSpeed of particles managed by this manager. Setting it to 0 means no spin. - * + * * @param speed * double */ @@ -335,7 +336,7 @@ public abstract class ParticleSystem extends Node { /** * Add an external influence to the particle controller for this mesh. - * + * * @param influence * ParticleInfluence */ @@ -345,7 +346,7 @@ public abstract class ParticleSystem extends Node { /** * Remove an influence from the particle controller for this mesh. - * + * * @param influence * ParticleInfluence * @return true if found and removed. @@ -356,7 +357,7 @@ public abstract class ParticleSystem extends Node { /** * Returns the list of influences acting on this particle controller. - * + * * @return ArrayList */ public List<ParticleInfluence> getInfluences() { @@ -374,7 +375,7 @@ public abstract class ParticleSystem extends Node { /** * Set the minimum angle (in radians) that particles can be emitted away from the emission direction. Any angle less * than 0 is trimmed to 0. - * + * * @param f * The new emission minimum angle. */ @@ -384,7 +385,7 @@ public abstract class ParticleSystem extends Node { /** * getEmissionMinimumAngle returns the minimum emission angle. - * + * * @return The minimum emission angle. */ public double getMinimumAngle() { @@ -394,7 +395,7 @@ public abstract class ParticleSystem extends Node { /** * Set the maximum angle (in radians) that particles can be emitted away from the emission direction. Any angle less * than 0 is trimmed to 0. - * + * * @param f * The new emission maximum angle. */ @@ -404,7 +405,7 @@ public abstract class ParticleSystem extends Node { /** * getEmissionMaximumAngle returns the maximum emission angle. - * + * * @return The maximum emission angle. */ public double getMaximumAngle() { @@ -414,7 +415,7 @@ public abstract class ParticleSystem extends Node { /** * Set the minimum lifespan of new particles (or recreated) managed by this manager. if a value less than zero is * given, 1.0 is used. - * + * * @param lifeSpan * in ms */ @@ -424,7 +425,7 @@ public abstract class ParticleSystem extends Node { /** * getParticlesMinimumLifeTime returns the minimum life time of a particle. - * + * * @return The current minimum life time in ms. */ public double getMinimumLifeTime() { @@ -434,7 +435,7 @@ public abstract class ParticleSystem extends Node { /** * Set the maximum lifespan of new particles (or recreated) managed by this manager. if a value less than zero is * given, 1.0 is used. - * + * * @param lifeSpan * in ms */ @@ -444,7 +445,7 @@ public abstract class ParticleSystem extends Node { /** * getParticlesMaximumLifeTime returns the maximum life time of a particle. - * + * * @return The current maximum life time in ms. */ public double getMaximumLifeTime() { @@ -477,7 +478,7 @@ public abstract class ParticleSystem extends Node { /** * Set the acceleration for any new particles created (or recreated) by this manager. - * + * * @param velocity * particle v0 */ @@ -487,7 +488,7 @@ public abstract class ParticleSystem extends Node { /** * Get the acceleration set in this manager. - * + * * @return The initialVelocity */ public double getInitialVelocity() { @@ -497,7 +498,7 @@ public abstract class ParticleSystem extends Node { /** * Set the offset for any new particles created (or recreated) by this manager. This is applicable only to managers * generating from a point (not a line, rectangle, etc..) - * + * * @param offset * new offset position */ @@ -507,7 +508,7 @@ public abstract class ParticleSystem extends Node { /** * Get the offset point set in this manager. - * + * * @return origin */ public ReadOnlyVector3 getOriginOffset() { @@ -524,7 +525,7 @@ public abstract class ParticleSystem extends Node { /** * Get the number of particles the manager should release per second. - * + * * @return The number of particles that should be released per second. */ public int getReleaseRate() { @@ -533,7 +534,7 @@ public abstract class ParticleSystem extends Node { /** * Set the number of particles the manager should release per second. - * + * * @param particlesPerSecond * number of particles per second */ @@ -596,7 +597,7 @@ public abstract class ParticleSystem extends Node { /** * Get which emittype method is being used by the underlying system. One of ParticleType.Quad, * ParticleType.Triangle, ParticleType.Point, ParticleType.Line, ParticleType.GeomMesh - * + * * @return An int representing the type of particle we are emitting. */ public ParticleType getParticleType() { @@ -605,7 +606,7 @@ public abstract class ParticleSystem extends Node { /** * Set what type of particle to emit from this sytem. Does not have an effect unless recreate is called. - * + * * @param type * particle type to use, should be one of ParticleType.Quad, ParticleType.Triangle, ParticleType.Point, * ParticleType.Line, ParticleType.GeomMesh @@ -616,7 +617,7 @@ public abstract class ParticleSystem extends Node { /** * Set our particle emitter. - * + * * @param emitter * New emitter or null for default point emitter. */ @@ -660,8 +661,8 @@ public abstract class ParticleSystem extends Node { vertices[x] = new Vector3(); final int vertIndex = mData.getVertexIndex(index, x, 0); - BufferUtils.populateFromBuffer(vertices[x], mData.getVertexBuffer(), mData.getIndices() != null ? mData - .getIndices().get(vertIndex) : vertIndex); + BufferUtils.populateFromBuffer(vertices[x], mData.getVertexBuffer(), + mData.getIndices() != null ? mData.getIndices().get(vertIndex) : vertIndex); } Triangle t = p.getTriangleModel(); if (t == null) { @@ -760,8 +761,9 @@ public abstract class ParticleSystem extends Node { /** * Used to determine particle orientation (only if cameraFacing is false.) - * + * * @param vector + * the facing up vector */ public void setFacingUpVector(final ReadOnlyVector3 vector) { _facingUpVector.set(vector); @@ -773,8 +775,9 @@ public abstract class ParticleSystem extends Node { /** * Used to determine particle orientation (only if cameraFacing is false.) - * + * * @param vector + * the facing left vector */ public void setFacingLeftVector(final ReadOnlyVector3 vector) { _facingLeftVector.set(vector); @@ -794,7 +797,7 @@ public abstract class ParticleSystem extends Node { /** * Returns a random angle between the min and max angles. - * + * * @return the random angle. */ public double getRandomAngle() { @@ -803,7 +806,7 @@ public abstract class ParticleSystem extends Node { /** * generate a random lifespan between the min and max lifespan of the particle system. - * + * * @return the generated lifespan value */ public double getRandomLifeSpan() { @@ -812,9 +815,10 @@ public abstract class ParticleSystem extends Node { /** * Generate a random velocity within the parameters of max angle and the rotation matrix. - * + * * @param store * a vector to store the results in. + * @return the random velocity */ protected Vector3 getRandomVelocity(final Vector3 store) { final double randDir = MathUtils.TWO_PI * MathUtils.nextRandomFloat(); @@ -833,7 +837,7 @@ public abstract class ParticleSystem extends Node { /** * Apply the rotation matrix to a given vector representing a particle velocity. - * + * * @param pSpeed * the velocity vector to be modified. */ @@ -911,7 +915,7 @@ public abstract class ParticleSystem extends Node { /** * Changes the number of particles in this particle mesh. - * + * * @param count * the desired number of particles to change to. */ @@ -936,8 +940,8 @@ public abstract class ParticleSystem extends Node { if (isRotateWithScene()) { // XXX: Perhaps we can avoid this special case via an addition to the interface? if (getParticleEmitter() instanceof MeshEmitter) { - ((MeshEmitter) getParticleEmitter()).getSource().getWorldRotation() - .applyPost(_emissionDirection, _worldEmit); + ((MeshEmitter) getParticleEmitter()).getSource().getWorldRotation().applyPost(_emissionDirection, + _worldEmit); } else { getWorldRotation().applyPost(_emissionDirection, _worldEmit); } diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/SimpleParticleInfluenceFactory.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/SimpleParticleInfluenceFactory.java index 7953500..6fa8da5 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/SimpleParticleInfluenceFactory.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/SimpleParticleInfluenceFactory.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>. */ @@ -30,7 +30,8 @@ public final class SimpleParticleInfluenceFactory { private boolean _random, _rotateWithScene; private final Vector3 _vector = new Vector3(); - public BasicWind() {} + public BasicWind() { + } public BasicWind(final double windStr, final ReadOnlyVector3 windDir, final boolean addRandom, final boolean rotateWithScene) { @@ -116,7 +117,8 @@ public final class SimpleParticleInfluenceFactory { private boolean rotateWithScene; private final Vector3 vector = new Vector3(); - public BasicGravity() {} + public BasicGravity() { + } public BasicGravity(final ReadOnlyVector3 gravForce, final boolean rotateWithScene) { gravity.set(gravForce); @@ -177,7 +179,8 @@ public final class SimpleParticleInfluenceFactory { private final Vector3 velocity = new Vector3(); private double dragCoefficient; - public BasicDrag() {} + public BasicDrag() { + } public BasicDrag(final double dragCoef) { dragCoefficient = dragCoef; @@ -229,7 +232,8 @@ public final class SimpleParticleInfluenceFactory { private final Quaternion _rot = new Quaternion(); private final Line3 _line = new Line3(); - public BasicVortex() {} + public BasicVortex() { + } public BasicVortex(final double strength, final double divergence, final ReadOnlyLine3 axis, final boolean random, final boolean transformWithScene) { @@ -388,11 +392,12 @@ public final class SimpleParticleInfluenceFactory { /** * Not used. */ - private SimpleParticleInfluenceFactory() {} + private SimpleParticleInfluenceFactory() { + } /** * Creates a basic wind that always blows in a single direction. - * + * * @param windStr * Max strength of wind. * @param windDir @@ -410,7 +415,9 @@ public final class SimpleParticleInfluenceFactory { /** * Create a basic gravitational force. - * + * + * @param gravForce + * the gravitational force * @param rotateWithScene * rotate the gravity vector with the particle system * @return ParticleInfluence @@ -422,7 +429,7 @@ public final class SimpleParticleInfluenceFactory { /** * Create a basic drag force that will use the given drag coefficient. Drag is determined by figuring the current * velocity and reversing it, then multiplying by the drag coefficient and dividing by the particle mass. - * + * * @param dragCoef * Should be positive. Larger values mean more drag but possibly more instability. * @return ParticleInfluence @@ -433,7 +440,7 @@ public final class SimpleParticleInfluenceFactory { /** * Creates a basic vortex. - * + * * @param strength * Max strength of vortex. * @param divergence diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/ProjectedGrid.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/ProjectedGrid.java index d758609..54a0c17 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/ProjectedGrid.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/ProjectedGrid.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>. */ @@ -214,10 +214,10 @@ public class ProjectedGrid extends Mesh { // force the projector to point at the plane if (projectorCamera.getLocation().getY() > 0.0 && projectorCamera.getDirection().getY() > 0.0 || projectorCamera.getLocation().getY() < 0.0 && projectorCamera.getDirection().getY() < 0.0) { - projectorCamera.setDirection(new Vector3(projectorCamera.getDirection().getX(), -projectorCamera - .getDirection().getY(), projectorCamera.getDirection().getZ())); - projectorCamera.setUp(projectorCamera.getDirection().cross(projectorCamera.getLeft(), null) - .normalizeLocal()); + projectorCamera.setDirection(new Vector3(projectorCamera.getDirection().getX(), + -projectorCamera.getDirection().getY(), projectorCamera.getDirection().getZ())); + projectorCamera + .setUp(projectorCamera.getDirection().cross(projectorCamera.getLeft(), null).normalizeLocal()); } // find the plane intersection point @@ -499,7 +499,7 @@ public class ProjectedGrid extends Mesh { * <code>getSurfaceNormal</code> returns the normal of an arbitrary point on the terrain. The normal is linearly * interpreted from the normals of the 4 nearest defined points. If the point provided is not within the bounds of * the height map, null is returned. - * + * * @param position * the vector representing the location to find a normal at. * @param store @@ -514,7 +514,7 @@ public class ProjectedGrid extends Mesh { * <code>getSurfaceNormal</code> returns the normal of an arbitrary point on the terrain. The normal is linearly * interpreted from the normals of the 4 nearest defined points. If the point provided is not within the bounds of * the height map, null is returned. - * + * * @param position * the vector representing the location to find a normal at. Only the x and z values are used. * @param store @@ -529,7 +529,7 @@ public class ProjectedGrid extends Mesh { * <code>getSurfaceNormal</code> returns the normal of an arbitrary point on the terrain. The normal is linearly * interpreted from the normals of the 4 nearest defined points. If the point provided is not within the bounds of * the height map, null is returned. - * + * * @param x * the x coordinate to check. * @param z @@ -551,7 +551,8 @@ public class ProjectedGrid extends Mesh { store = new Vector3(); } - final Vector3 topLeft = store, topRight = new Vector3(), bottomLeft = new Vector3(), bottomRight = new Vector3(); + final Vector3 topLeft = store, topRight = new Vector3(), bottomLeft = new Vector3(), + bottomRight = new Vector3(); final int focalSpot = (int) (col + row * sizeX); @@ -578,6 +579,9 @@ public class ProjectedGrid extends Mesh { /** * <code>buildVertices</code> sets up the vertex and index arrays of the TriMesh. + * + * @param vertexCount + * the vertex count */ private void buildVertices(final int vertexCount) { vertBuf = BufferUtils.createVector3Buffer(vertBuf, vertexCount); diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/WaterNode.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/WaterNode.java index d5ee47c..6d8e2aa 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/WaterNode.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/water/WaterNode.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>. */ @@ -130,7 +130,7 @@ public class WaterNode extends Node { /** * Resets water parameters to default values - * + * */ public void resetParameters() { waterPlane = new Plane(new Vector3(0.0, 1.0, 0.0), 0.0); @@ -162,7 +162,7 @@ public class WaterNode extends Node { /** * Creates a new WaterRenderPass - * + * * @param cam * main rendercam to use for reflection settings etc * @param renderScale @@ -190,8 +190,9 @@ public class WaterNode extends Node { /** * Initialize texture renderers. Load water textures. Create shaders. - * + * * @param r + * the renderer */ private void initialize(final Renderer r) { if (cam == null || initialized) { @@ -201,8 +202,8 @@ public class WaterNode extends Node { final ContextCapabilities caps = ContextManager.getCurrentContext().getCapabilities(); - if (useRefraction && useProjectedShader && caps.getNumberOfFragmentTextureUnits() < 6 || useRefraction - && caps.getNumberOfFragmentTextureUnits() < 5) { + if (useRefraction && useProjectedShader && caps.getNumberOfFragmentTextureUnits() < 6 + || useRefraction && caps.getNumberOfFragmentTextureUnits() < 5) { useRefraction = false; logger.info("Not enough textureunits, falling back to non refraction water"); } @@ -380,14 +381,14 @@ public class WaterNode extends Node { final Vector4 clipPlane = Vector4.fetchTempInstance(); if (useReflection) { - clipPlane.set(waterPlane.getNormal().getX(), waterPlane.getNormal().getY(), waterPlane.getNormal() - .getZ(), heightTotal); + clipPlane.set(waterPlane.getNormal().getX(), waterPlane.getNormal().getY(), + waterPlane.getNormal().getZ(), heightTotal); renderReflection(clipPlane); } if (useRefraction && aboveWater) { - clipPlane.set(-waterPlane.getNormal().getX(), -waterPlane.getNormal().getY(), -waterPlane.getNormal() - .getZ(), -waterPlane.getConstant()); + clipPlane.set(-waterPlane.getNormal().getX(), -waterPlane.getNormal().getY(), + -waterPlane.getNormal().getZ(), -waterPlane.getConstant()); renderRefraction(clipPlane); } } @@ -422,10 +423,10 @@ public class WaterNode extends Node { try { logger.info("loading " + currentShaderStr); - waterShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, - currentShaderStr + ".vert")); - waterShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, - currentShaderStr + ".frag")); + waterShader.setVertexShader( + ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, currentShaderStr + ".vert")); + waterShader.setFragmentShader( + ResourceLocatorTool.getClassPathResourceAsStream(WaterNode.class, currentShaderStr + ".frag")); } catch (final IOException e) { logger.log(Level.WARNING, "Error loading shader", e); return; @@ -464,10 +465,10 @@ public class WaterNode extends Node { } /** - * Sets a spatial up for being rendered with the watereffect - * + * Sets a spatial up for being rendered with the water effect + * * @param spatial - * Spatial to use as base for the watereffect + * Spatial to use as base for the water effect */ public void setWaterEffectOnSpatial(final Spatial spatial) { spatial.setRenderState(cullBackFace); @@ -493,6 +494,9 @@ public class WaterNode extends Node { /** * Render water reflection RTT + * + * @param clipPlane + * the clip plane */ private void renderReflection(final Vector4 clipPlane) { if (renderList.isEmpty()) { @@ -578,6 +582,9 @@ public class WaterNode extends Node { /** * Render water refraction RTT + * + * @param clipPlane + * the clip plane */ private void renderRefraction(final Vector4 clipPlane) { if (renderList.isEmpty()) { @@ -677,7 +684,7 @@ public class WaterNode extends Node { /** * Adds a spatial to the list of spatials used as reflection in the water - * + * * @param renderNode * Spatial to add to the list of objects used as reflection in the water */ @@ -692,10 +699,10 @@ public class WaterNode extends Node { } /** - * Sets up a node to be transformed and clipped for skybox usage - * + * Sets up a node to be transformed and clipped for sky box usage + * * @param skyBox - * Handle to a node to use as skybox + * Handle to a node to use as sky box */ public void setSkybox(final Node skyBox) { if (skyBox != null) { @@ -721,6 +728,9 @@ public class WaterNode extends Node { /** * Color to use when the incident angle to the surface is low + * + * @param waterColorStart + * the color to use when the incident angle to the surface is low */ public void setWaterColorStart(final ColorRGBA waterColorStart) { this.waterColorStart = waterColorStart; @@ -732,6 +742,9 @@ public class WaterNode extends Node { /** * Color to use when the incident angle to the surface is high + * + * @param waterColorEnd + * the color to use when the incident angle to the surface is high */ public void setWaterColorEnd(final ColorRGBA waterColorEnd) { this.waterColorEnd = waterColorEnd; @@ -742,9 +755,10 @@ public class WaterNode extends Node { } /** - * Set at what distance the waveheights should start to fade out(for projected water only) - * + * Set at what distance the wave heights should start to fade out(for projected water only) + * * @param heightFalloffStart + * the distance the wave heights should start to fade out */ public void setHeightFalloffStart(final double heightFalloffStart) { this.heightFalloffStart = heightFalloffStart; @@ -756,8 +770,9 @@ public class WaterNode extends Node { /** * Set the fadeout length of the waveheights, when over falloff start(for projected water only) - * - * @param heightFalloffStart + * + * @param heightFalloffSpeed + * the the fadeout length of the waveheights */ public void setHeightFalloffSpeed(final double heightFalloffSpeed) { this.heightFalloffSpeed = heightFalloffSpeed; @@ -768,10 +783,10 @@ public class WaterNode extends Node { } /** - * Set base height of the waterplane(Used for reflecting the camera for rendering reflection) - * + * Set base height of the water plane(Used for reflecting the camera for rendering reflection) + * * @param waterHeight - * Waterplane height + * the water plane height */ public void setWaterHeight(final double waterHeight) { waterPlane.setConstant(waterHeight); @@ -782,10 +797,10 @@ public class WaterNode extends Node { } /** - * Set the normal of the waterplane(Used for reflecting the camera for rendering reflection) - * + * Set the normal of the water plane(Used for reflecting the camera for rendering reflection) + * * @param normal - * Waterplane normal + * the water plane normal */ public void setNormal(final Vector3 normal) { waterPlane.setNormal(normal); @@ -796,10 +811,10 @@ public class WaterNode extends Node { } /** - * Set the movement speed of the reflectiontexture - * + * Set the movement speed of the reflection texture + * * @param speedReflection - * Speed of reflectiontexture + * the speed of reflection texture */ public void setSpeedReflection(final double speedReflection) { this.speedReflection = speedReflection; @@ -810,10 +825,10 @@ public class WaterNode extends Node { } /** - * Set the movement speed of the refractiontexture - * + * Set the movement speed of the refraction texture + * * @param speedRefraction - * Speed of refractiontexture + * the speed of refraction texture */ public void setSpeedRefraction(final double speedRefraction) { this.speedRefraction = speedRefraction; @@ -825,9 +840,9 @@ public class WaterNode extends Node { /** * Maximum amplitude of the water, used for clipping correctly(projected water only) - * + * * @param waterMaxAmplitude - * Maximum amplitude + * the maximum amplitude */ public void setWaterMaxAmplitude(final double waterMaxAmplitude) { this.waterMaxAmplitude = waterMaxAmplitude; @@ -878,9 +893,10 @@ public class WaterNode extends Node { } /** - * If true, fade to fogcolor. If false, fade to 100% reflective surface - * + * If true, fade to fog color. If false, fade to 100% reflective surface + * * @param value + * <code>true</code> if fade to fog color */ public void useFadeToFogColor(final boolean value) { useFadeToFogColor = value; @@ -896,8 +912,9 @@ public class WaterNode extends Node { /** * Turn reflection on and off - * + * * @param useReflection + * <code>true</code> if the reflection is turned on */ public void setUseReflection(final boolean useReflection) { if (useReflection == this.useReflection) { @@ -913,8 +930,9 @@ public class WaterNode extends Node { /** * Turn refraction on and off - * + * * @param useRefraction + * <code>true</code> if the refraction is turned on */ public void setUseRefraction(final boolean useRefraction) { if (useRefraction == this.useRefraction) { |