diff options
author | Julien Gouesse <[email protected]> | 2016-03-20 13:33:05 +0100 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2016-03-20 13:33:05 +0100 |
commit | 435bc8704e41eafb6425ed817426c5ac0dfd18e3 (patch) | |
tree | ac82bb9da97dbb4899ecbf7eb49eeec3dd3a90bb /ardor3d-animation | |
parent | 74255bd3aaee37331607c4f832732a6c4b2d0e65 (diff) |
Fixes the javadoc of ardor3d-animation
Diffstat (limited to 'ardor3d-animation')
20 files changed, 138 insertions, 116 deletions
diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java index 76fd763..0caa7eb 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java @@ -64,7 +64,7 @@ public class AnimationManager { protected final List<AnimationLayer> _layers = new ArrayList<AnimationLayer>(); /** - * A map of key->Double values, allowing control over elements under this manager without needing precise knowledge + * A map of key / Double values, allowing control over elements under this manager without needing precise knowledge * of the layout of those layers, blend trees, etc. Missing keys will return 0.0 and log a warning. */ protected final LoggingMap<String, Double> _valuesStore = new LoggingMap<String, Double>(); diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/Joint.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/Joint.java index f4a6202..67dcbd5 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/Joint.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/Joint.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>. */ @@ -41,7 +41,7 @@ public class Joint implements Savable { /** * Construct a new Joint object using the given name. - * + * * @param name * the name */ @@ -50,7 +50,7 @@ public class Joint implements Savable { } /** - * @return the inverse of the joint space -> model space transformation. + * @return the inverse of the joint space to model space transformation. */ public ReadOnlyTransform getInverseBindPose() { return _inverseBindPose; @@ -69,7 +69,7 @@ public class Joint implements Savable { /** * Set the index of this joint's parent within the containing Skeleton's joint array. - * + * * @param parentIndex * the index, or NO_PARENT if this Joint is root (has no parent) */ diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/SkinnedMesh.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/SkinnedMesh.java index 5a30091..1ad1ac0 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/SkinnedMesh.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/SkinnedMesh.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>. */ @@ -91,7 +91,7 @@ public class SkinnedMesh extends Mesh implements PoseListener { * Flag for enabling automatically updating the skin's model bound when the pose changes. Only effective in CPU * skinning mode. Default is false as this is currently expensive. * </p> - * + * * XXX: If we can find a better way to update the bounds, maybe we should make this default to true or remove this * altogether. */ @@ -111,7 +111,7 @@ public class SkinnedMesh extends Mesh implements PoseListener { /** * Constructs a new SkinnedMesh with a given name. - * + * * @param name * the name of the skinned mesh. */ @@ -128,7 +128,7 @@ public class SkinnedMesh extends Mesh implements PoseListener { /** * Sets the bind pose mesh data object used by this skinned mesh. - * + * * @param poseData * the new bind pose */ @@ -197,8 +197,9 @@ public class SkinnedMesh extends Mesh implements PoseListener { /** * Sets the joint indices used by this skinned mesh to compute mesh deformation. Each entry is interpreted as an * 16bit signed integer index into a Skeleton's Joint. - * + * * @param jointIndices + * the joint indices */ public void setJointIndices(final short[] jointIndices) { _jointIndices = jointIndices; @@ -209,7 +210,7 @@ public class SkinnedMesh extends Mesh implements PoseListener { /** * @return this skinned mesh's joint weights. - * @see #setWeights(FloatBuffer) + * @see #setWeights(float[]) */ public float[] getWeights() { return _weights; @@ -217,7 +218,7 @@ public class SkinnedMesh extends Mesh implements PoseListener { /** * Sets the joint weights used by this skinned mesh. - * + * * @param weights * the new weights. */ @@ -275,7 +276,7 @@ public class SkinnedMesh extends Mesh implements PoseListener { /** * This should be set after setting up gpu attribute params. - * + * * @param useGPU * true if we should do skinning on the card (GPU) or false if on the CPU. */ @@ -337,7 +338,7 @@ public class SkinnedMesh extends Mesh implements PoseListener { * Set custom logic for how this skin should react when it is told its pose has updated. This might include * throttling skin application, ignoring skin application when the skin is outside of the camera view, etc. If null, * (the default) the skin will always apply the new pose and optionally update the model bound. - * + * * @param customApplier * the new custom logic, or null to use the default behavior. */ @@ -609,9 +610,10 @@ public class SkinnedMesh extends Mesh implements PoseListener { /** * Rewrites the weights on this SkinnedMesh, if necessary, to reduce the number of weights per vert to the given * max. This is done by dropping the least significant weight and balancing the remainder to total 1.0 again. - * + * * @param maxCount - * the desired maximum weightsPerVert. If this is >= the current weightsPerVert, this method is a NOOP. + * the desired maximum weightsPerVert. If this is greater than or equal to the current weightsPerVert, + * this method is a NOOP. */ public void constrainWeightCount(final int maxCount) { if (maxCount >= _weightsPerVert) { diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AbstractAnimationChannel.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AbstractAnimationChannel.java index 17eaba3..0dc092f 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AbstractAnimationChannel.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AbstractAnimationChannel.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>. */ @@ -27,12 +27,15 @@ public abstract class AbstractAnimationChannel implements Savable { /** The name of this channel. */ protected final String _channelName; - /** Our time indices. Each index of the array should contain a value that is > the value in the previous index. */ + /** + * Our time indices. Each index of the array should contain a value that is greater than the value in the previous + * index. + */ protected final float[] _times; /** * Construct a new channel. - * + * * @param channelName * the name of our channel. This is immutable to this instance of the class. * @param times @@ -63,7 +66,7 @@ public abstract class AbstractAnimationChannel implements Savable { /** * Update the given applyTo object with information from this channel at the given time position. - * + * * @param clockTime * the current local clip time (where 0 == start of clip) * @param applyTo @@ -98,7 +101,7 @@ public abstract class AbstractAnimationChannel implements Savable { /** * Sets data on the given applyTo Object for the given sampleIndex and a percent progress towards the sample * following it. - * + * * @param sampleIndex * the sample to pull information from. * @param progressPercent @@ -118,7 +121,7 @@ public abstract class AbstractAnimationChannel implements Savable { /** * Returns a new channel of the same name and content as this, but trimmed to just the times between start and end * sample. - * + * * @param startSample * the sample to start with (inclusive). Sample counting starts at 0. * @param endSample @@ -130,9 +133,9 @@ public abstract class AbstractAnimationChannel implements Savable { } /** - * + * * Returns a new channel of the same content as this, but trimmed to just the times between start and end sample. - * + * * @param name * the new name for our subchannel. * @param startSample @@ -141,14 +144,14 @@ public abstract class AbstractAnimationChannel implements Savable { * the sample to end with (inclusive). max is getSampleCount() - 1. * @return the new channel. * @throws IllegalArgumentException - * if start > end or end >= getSampleCount. + * if start greater than end or end greater than or equal to getSampleCount. */ public abstract AbstractAnimationChannel getSubchannelBySample(String name, int startSample, int endSample); /** * Returns a new channel of the same name and content as this, but trimmed to just the times between start and end * times. - * + * * @param startTime * the time to start with (inclusive) * @param endTime @@ -160,9 +163,9 @@ public abstract class AbstractAnimationChannel implements Savable { } /** - * + * * Returns a new channel of the same content as this, but trimmed to just the times between start and end sample. - * + * * @param name * the new name for our subchannel. * @param startTime @@ -171,7 +174,7 @@ public abstract class AbstractAnimationChannel implements Savable { * the time to end with (inclusive) * @return the new channel. * @throws IllegalArgumentException - * if start > end or end >= getSampleCount. + * if start greater than end or end greater than or equal to getSampleCount. */ public abstract AbstractAnimationChannel getSubchannelByTime(String name, float startTime, float endTime); diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClip.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClip.java index 39ca36e..c3292fe 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClip.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClip.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>. */ @@ -38,6 +38,9 @@ public class AnimationClip implements Savable { /** * Construct a new animation clip with no channels. + * + * @param name + * clip's name, should be unique */ public AnimationClip(final String name) { _name = name; @@ -46,7 +49,10 @@ public class AnimationClip implements Savable { /** * Construct a new animation clip, copying in a given list of channels. - * + * + * @param name + * clip's name, should be unique + * * @param channels * a list of channels to shallow copy locally. */ @@ -65,7 +71,7 @@ public class AnimationClip implements Savable { /** * Update an instance of this clip. - * + * * @param clockTime * the current local clip time (where 0 == start of clip) * @param instance @@ -82,7 +88,7 @@ public class AnimationClip implements Savable { /** * Add a channel to this clip. - * + * * @param channel * the channel to add. */ @@ -93,7 +99,7 @@ public class AnimationClip implements Savable { /** * Locate a channel in this clip using its channel name. - * + * * @param channelName * the name to match against. * @return the first channel with a name matching the given channelName, or null if no matches are found. @@ -109,7 +115,7 @@ public class AnimationClip implements Savable { /** * Remove a given channel from this clip. - * + * * @param channel * the channel to remove. * @return true if this clip had the given channel and it was removed. diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.java index 35bd687..dac8681 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.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>. */ @@ -39,7 +39,7 @@ public class AnimationClipInstance { /** The global start time of our clip instance. */ private double _startTime = 0.0; - /** Map of channel name -> state tracking objects. */ + /** Map of channel name to state tracking objects. */ private final Map<String, Object> _clipStateObjects = new HashMap<String, Object>(); /** List of callbacks for animation events. */ @@ -47,7 +47,7 @@ public class AnimationClipInstance { /** * Add an animation listener to our callback list. - * + * * @param animationListener * the listener to add. */ @@ -60,7 +60,7 @@ public class AnimationClipInstance { /** * Remove an animation listener from our callback list. - * + * * @param animationListener * the listener to remove. * @return true if the listener was found in our list diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/InterpolatedDoubleChannel.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/InterpolatedDoubleChannel.java index a8e8f4e..9e0d19a 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/InterpolatedDoubleChannel.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/InterpolatedDoubleChannel.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>. */ @@ -31,12 +31,12 @@ public class InterpolatedDoubleChannel extends AbstractAnimationChannel { /** * Construct a new InterpolatedDoubleChannel. - * + * * @param channelName * the name of this channel. * @param times * the time samples - * @param keys + * @param values * our key samples. Entries may be null. Should have as many entries as the times array. */ public InterpolatedDoubleChannel(final String channelName, final float[] times, final double[] values) { @@ -65,7 +65,8 @@ public class InterpolatedDoubleChannel extends AbstractAnimationChannel { } @Override - public InterpolatedDoubleChannel getSubchannelBySample(final String name, final int startSample, final int endSample) { + public InterpolatedDoubleChannel getSubchannelBySample(final String name, final int startSample, + final int endSample) { if (startSample > endSample) { throw new IllegalArgumentException("startSample > endSample"); } @@ -86,7 +87,8 @@ public class InterpolatedDoubleChannel extends AbstractAnimationChannel { } @Override - public InterpolatedDoubleChannel getSubchannelByTime(final String name, final float startTime, final float endTime) { + public InterpolatedDoubleChannel getSubchannelByTime(final String name, final float startTime, + final float endTime) { if (startTime > endTime) { throw new IllegalArgumentException("startTime > endTime"); } diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/JointData.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/JointData.java index af97ebd..536b3e8 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/JointData.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/JointData.java @@ -1 +1 @@ -/**
* Copyright (c) 2008-2012 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
* 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>.
*/
package com.ardor3d.extension.animation.skeletal.clip;
import java.io.IOException;
import com.ardor3d.util.export.InputCapsule;
import com.ardor3d.util.export.OutputCapsule;
/**
* Describes transform of a joint.
*/
public class JointData extends TransformData {
private int _jointIndex;
/**
* Construct a new, identity joint data object.
*/
public JointData(final int index) {
_jointIndex = index;
}
/**
* Construct a new joint data object, copying the value of the given source.
*
* @param source
* our source to copy.
* @throws NullPointerException
* if source is null.
*/
public JointData(final JointData source) {
set(source);
}
/**
* Construct a new, identity joint data object.
*/
public JointData() {}
/**
* Copy the source's values into this transform data object.
*
* @param source
* our source to copy.
* @throws NullPointerException
* if source is null.
*/
public void set(final JointData source) {
super.set(source);
_jointIndex = source._jointIndex;
}
public int getJointIndex() {
return _jointIndex;
}
public void setJointIndex(final int jointIndex) {
_jointIndex = jointIndex;
}
/**
* Blend this transform with the given transform.
*
* @param blendTo
* The transform to blend to
* @param blendWeight
* The blend weight
* @param store
* The transform store.
* @return The blended transform.
*/
@Override
public TransformData blend(final TransformData blendTo, final double blendWeight, final TransformData store) {
TransformData rVal = store;
if (rVal == null) {
rVal = new JointData(_jointIndex);
} else if (rVal instanceof JointData) {
((JointData) rVal).setJointIndex(_jointIndex);
}
return super.blend(blendTo, blendWeight, rVal);
}
// /////////////////
// Methods for Savable
// /////////////////
@Override
public void write(final OutputCapsule capsule) throws IOException {
super.write(capsule);
capsule.write(_jointIndex, "jointIndex", 0);
}
@Override
public void read(final InputCapsule capsule) throws IOException {
super.read(capsule);
_jointIndex = capsule.readInt("jointIndex", 0);
}
}
\ No newline at end of file +/**
* Copyright (c) 2008-2012 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
* 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>.
*/
package com.ardor3d.extension.animation.skeletal.clip;
import java.io.IOException;
import com.ardor3d.util.export.InputCapsule;
import com.ardor3d.util.export.OutputCapsule;
/**
* Describes transform of a joint.
*/
public class JointData extends TransformData {
private int _jointIndex;
/**
* Construct a new, identity joint data object.
*
* @param index
* the index
*/
public JointData(final int index) {
_jointIndex = index;
}
/**
* Construct a new joint data object, copying the value of the given source.
*
* @param source
* our source to copy.
* @throws NullPointerException
* if source is null.
*/
public JointData(final JointData source) {
set(source);
}
/**
* Construct a new, identity joint data object.
*/
public JointData() {}
/**
* Copy the source's values into this transform data object.
*
* @param source
* our source to copy.
* @throws NullPointerException
* if source is null.
*/
public void set(final JointData source) {
super.set(source);
_jointIndex = source._jointIndex;
}
public int getJointIndex() {
return _jointIndex;
}
public void setJointIndex(final int jointIndex) {
_jointIndex = jointIndex;
}
/**
* Blend this transform with the given transform.
*
* @param blendTo
* The transform to blend to
* @param blendWeight
* The blend weight
* @param store
* The transform store.
* @return The blended transform.
*/
@Override
public TransformData blend(final TransformData blendTo, final double blendWeight, final TransformData store) {
TransformData rVal = store;
if (rVal == null) {
rVal = new JointData(_jointIndex);
} else if (rVal instanceof JointData) {
((JointData) rVal).setJointIndex(_jointIndex);
}
return super.blend(blendTo, blendWeight, rVal);
}
// /////////////////
// Methods for Savable
// /////////////////
@Override
public void write(final OutputCapsule capsule) throws IOException {
super.write(capsule);
capsule.write(_jointIndex, "jointIndex", 0);
}
@Override
public void read(final InputCapsule capsule) throws IOException {
super.read(capsule);
_jointIndex = capsule.readInt("jointIndex", 0);
}
}
\ No newline at end of file diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerCallback.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerCallback.java index 292c497..4d6f019 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerCallback.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerCallback.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,9 +21,11 @@ public interface TriggerCallback { /** * Called once per encounter of a TriggerParam. Not guaranteed to be called if, for example, the window defined in * the TriggerParam is very small and/or the frame rate is really bad. - * + * * @param applyToPose + * apply to pose * @param manager + * animation manager */ void doTrigger(SkeletonPose applyToPose, AnimationManager manager); diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerData.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerData.java index 5c62785..c741cd0 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerData.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/TriggerData.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>. */ @@ -53,11 +53,11 @@ public class TriggerData { /** * Try to set a given trigger/index as armed. If we already have this trigger and index set, we don't change the * state of armed. - * - * @param trigger - * our trigger name + * * @param index * our sample index + * @param triggers + * our triggers names */ public synchronized void arm(final int index, final String... triggers) { if (triggers == null || triggers.length == 0) { diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/layer/LayerLERPBlender.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/layer/LayerLERPBlender.java index f4883c0..3f2d108 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/layer/LayerLERPBlender.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/layer/LayerLERPBlender.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>. */ @@ -19,7 +19,6 @@ import com.ardor3d.extension.animation.skeletal.blendtree.BinaryLERPSource; * <p> * A layer blender that uses linear interpolation to merge the results of two layers. * </p> - * See also {@link BinaryLERPSource#combineSourceData(Map, Map, double)} */ public class LayerLERPBlender implements LayerBlender { @@ -66,8 +65,8 @@ public class LayerLERPBlender implements LayerBlender { // set A final Map<String, ? extends Object> sourceAData = getLayerA().getCurrentSourceData(); // set B - final Map<String, ? extends Object> sourceBData = getLayerB().getCurrentState() != null ? getLayerB() - .getCurrentState().getCurrentSourceData(manager) : null; + final Map<String, ? extends Object> sourceBData = getLayerB().getCurrentState() != null + ? getLayerB().getCurrentState().getCurrentSourceData(manager) : null; return BinaryLERPSource.combineSourceData(sourceAData, sourceBData, manager.getValuesStore().get(_blendKey)); } diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractFiniteState.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractFiniteState.java index 0353f93..7010266 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractFiniteState.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractFiniteState.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>. */ @@ -32,7 +32,7 @@ public abstract class AbstractFiniteState { /** * Reset the clip instances held by this state's blend tree (or other leaf nodes in our blend tree) to a start time * using the current global time from the given manager. - * + * * @param manager * our manager. */ @@ -43,7 +43,7 @@ public abstract class AbstractFiniteState { /** * Reset the clip instances held by this state's blend tree (or other leaf nodes in our blend tree) to given start * time. - * + * * @param manager * our manager. * @param globalStartTime @@ -55,7 +55,7 @@ public abstract class AbstractFiniteState { /** * Update this state using the current global time. - * + * * @param globalTime * the current global time. * @param layer @@ -65,13 +65,16 @@ public abstract class AbstractFiniteState { /** * Post update. If the state has no more clips and no end transition, this will clear this state from the layer. - * + * * @param layer * the layer this state belongs to. */ public abstract void postUpdate(final AnimationLayer layer); /** + * @param manager + * animation manager + * * @return the current map of source channel data for this layer. */ public abstract Map<String, ? extends Object> getCurrentSourceData(AnimationManager manager); diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTransitionState.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTransitionState.java index 66efc81..f2cb1d2 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTransitionState.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTransitionState.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>. */ @@ -18,12 +18,12 @@ import com.ardor3d.extension.animation.skeletal.layer.AnimationLayer; public abstract class AbstractTransitionState extends AbstractFiniteState { /** - * @see {@link AbstractTransitionState#setStartWindow(double)} + * @see AbstractTransitionState#setStartWindow(double) */ private double _startWindow = -1; /** - * @see {@link AbstractTransitionState#setEndWindow(double)} + * @see AbstractTransitionState#setEndWindow(double) */ private double _endWindow = -1; @@ -34,7 +34,7 @@ public abstract class AbstractTransitionState extends AbstractFiniteState { /** * Construct a new transition state. - * + * * @param targetState * the name of the steady state we want the Animation Layer to be in at the end of the transition. */ @@ -51,9 +51,10 @@ public abstract class AbstractTransitionState extends AbstractFiniteState { /** * @param startWindow - * our new start window value. If greater than 0, this transition is only valid if the current time is >= - * startWindow. Note that animations are separate from states, so time scaling an animation will not - * affect transition windows directly and must be factored into the start/end values. + * our new start window value. If greater than 0, this transition is only valid if the current time is + * greater than or equal to startWindow. Note that animations are separate from states, so time scaling + * an animation will not affect transition windows directly and must be factored into the start/end + * values. */ public void setStartWindow(final double startWindow) { _startWindow = startWindow; @@ -69,9 +70,9 @@ public abstract class AbstractTransitionState extends AbstractFiniteState { /** * @param endWindow - * our new end window value. If greater than 0, this transition is only valid if the current time is <= - * endWindow. Note that animations are separate from states, so time scaling an animation will not affect - * transition windows directly and must be factored into the start/end values. + * our new end window value. If greater than 0, this transition is only valid if the current time is less + * than or equal to endWindow. Note that animations are separate from states, so time scaling an + * animation will not affect transition windows directly and must be factored into the start/end values. */ public void setEndWindow(final double endWindow) { _endWindow = endWindow; @@ -87,7 +88,7 @@ public abstract class AbstractTransitionState extends AbstractFiniteState { /** * Request that this state perform a transition to another. - * + * * @param callingState * the state calling for this transition. * @param layer @@ -137,7 +138,7 @@ public abstract class AbstractTransitionState extends AbstractFiniteState { /** * Do the transition logic for this transition state. - * + * * @param callingState * the state calling for this transition. * @param layer diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTwoStateLerpTransition.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTwoStateLerpTransition.java index 8efbcbe..fccb91f 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTwoStateLerpTransition.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/AbstractTwoStateLerpTransition.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>. */ @@ -63,7 +63,7 @@ public abstract class AbstractTwoStateLerpTransition extends AbstractTransitionS /** * Construct a new AbstractTwoStateLerpTransition. - * + * * @param targetState * the name of the steady state we want the Animation Layer to be in at the end of the transition. * @param fadeTime @@ -105,7 +105,7 @@ public abstract class AbstractTwoStateLerpTransition extends AbstractTransitionS } /** - * @param stateA + * @param stateB * sets the end state. Updates the state's owner to point to this transition. */ public void setStateB(final AbstractFiniteState stateB) { @@ -186,10 +186,10 @@ public abstract class AbstractTwoStateLerpTransition extends AbstractTransitionS @Override public Map<String, ? extends Object> getCurrentSourceData(final AnimationManager manager) { // grab our data maps from the two states - final Map<String, ? extends Object> sourceAData = getStateA() != null ? getStateA().getCurrentSourceData( - manager) : null; - final Map<String, ? extends Object> sourceBData = getStateB() != null ? getStateB().getCurrentSourceData( - manager) : null; + final Map<String, ? extends Object> sourceAData = getStateA() != null + ? getStateA().getCurrentSourceData(manager) : null; + final Map<String, ? extends Object> sourceBData = getStateB() != null + ? getStateB().getCurrentSourceData(manager) : null; // reuse previous _sourceData transforms to avoid re-creating // too many new transform data objects. This assumes that a diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/FrozenTransitionState.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/FrozenTransitionState.java index 355020a..7c05f23 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/FrozenTransitionState.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/FrozenTransitionState.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>. */ @@ -17,16 +17,16 @@ import com.ardor3d.extension.animation.skeletal.layer.AnimationLayer; * A two state transition that freezes the starting state at its current position and blends that over time with a * target state. The target state moves forward in time during the blend as normal. * </p> - * + * * XXX: Might be able to make this more efficient by capturing the getCurrentSourceData of stateA and reusing. */ public class FrozenTransitionState extends AbstractTwoStateLerpTransition { /** * Construct a new FrozenTransitionState. - * - * @param the - * name of the steady state we want the Animation Layer to be in at the end of the transition. + * + * @param targetState + * the name of the steady state we want the Animation Layer to be in at the end of the transition. * @param fadeTime * the amount of time we should take to do the transition. * @param type diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/IgnoreTransitionState.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/IgnoreTransitionState.java index 153b181..a134785 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/IgnoreTransitionState.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/IgnoreTransitionState.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>. */ @@ -22,9 +22,6 @@ public class IgnoreTransitionState extends AbstractTransitionState { /** * Construct a new transition state. - * - * @param targetState - * the name of the state to transition to. */ public IgnoreTransitionState() { super(null); diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/ImportClipMap.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/ImportClipMap.java index d8ba845..d9eba36 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/ImportClipMap.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/ImportClipMap.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>. */ @@ -16,7 +16,7 @@ import com.ardor3d.extension.animation.skeletal.clip.AnimationClip; import com.ardor3d.extension.animation.skeletal.util.LoggingMap; /** - * This class essentially just wraps a String->Animation HashMap, providing extra logging when a clip is not found, or + * This class essentially just wraps a String / Animation HashMap, providing extra logging when a clip is not found, or * duplicate clips are added. */ public class ImportClipMap extends LoggingMap<String, AnimationClip> { @@ -26,7 +26,7 @@ public class ImportClipMap extends LoggingMap<String, AnimationClip> { /** * Add a clip to the store. Logs a warning if a clip by the same name was already in the store. - * + * * @param clip * the clip to add. */ diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/OutputClipSourceMap.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/OutputClipSourceMap.java index cc98260..f7bdd21 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/OutputClipSourceMap.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/state/loader/OutputClipSourceMap.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>. */ @@ -16,7 +16,7 @@ import com.ardor3d.extension.animation.skeletal.blendtree.ClipSource; import com.ardor3d.extension.animation.skeletal.util.LoggingMap; /** - * This class essentially just wraps a String->ClipSource HashMap, providing extra logging when a ClipSource is not + * This class essentially just wraps a String / ClipSource HashMap, providing extra logging when a ClipSource is not * found, or duplicate ClipSources are added. */ public class OutputClipSourceMap extends LoggingMap<String, ClipSource> { @@ -26,7 +26,7 @@ public class OutputClipSourceMap extends LoggingMap<String, ClipSource> { /** * Add a ClipSource to the store. Logs a warning if a source by the same name was already in the store. - * + * * @param source * the clip source to add. */ diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/LoggingMap.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/LoggingMap.java index 95eb5db..a7e78d9 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/LoggingMap.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/LoggingMap.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>. */ @@ -17,7 +17,7 @@ import java.util.Set; import java.util.logging.Logger; /** - * This class essentially just wraps a KEY->VALUE HashMap, providing extra logging when a VALUE is not found, or + * This class essentially just wraps a KEY/VALUE HashMap, providing extra logging when a VALUE is not found, or * duplicate VALUE objects are added. An optional callback may be provided to try to load values not present in this * map. These are loaded using the string representation of the key and casting the return from Object to the value * class. If the value is still null, a default value is returned. @@ -45,7 +45,7 @@ public class LoggingMap<KEY, VALUE> { /** * Add a value to the store. Logs a warning if a value by the same key was already in the store and logOnReplace is * true. - * + * * @param key * the key to add. * @param value @@ -62,7 +62,7 @@ public class LoggingMap<KEY, VALUE> { /** * Retrieves a value from our store by key. Logs a warning if a value by that key is not found and logOnMissing is * true. If missing, defaultValue is returned. - * + * * @param key * the key of the value to find. * @return the associated value, or null if none is found. @@ -80,8 +80,8 @@ public class LoggingMap<KEY, VALUE> { // value still null... if (value == null) { if (isLogOnMissing()) { - LoggingMap.logger.warning("Value not found with key: " + key + " Returning defaultValue: " - + _defaultValue); + LoggingMap.logger + .warning("Value not found with key: " + key + " Returning defaultValue: " + _defaultValue); } return getDefaultValue(); } @@ -90,7 +90,7 @@ public class LoggingMap<KEY, VALUE> { /** * Removes the mapping for the given key. - * + * * @param key * the key of the value to remove. * @return the previously associated value, or null if none was found. diff --git a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/SkeletalDebugger.java b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/SkeletalDebugger.java index 9ac819f..ae3480f 100644 --- a/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/SkeletalDebugger.java +++ b/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/util/SkeletalDebugger.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>. */ @@ -50,6 +50,7 @@ public class SkeletalDebugger { protected static final BoundingSphere measureSphere = new BoundingSphere(); protected static final BasicText jointText = BasicText.createDefaultTextLabel("", ""); + static { // No lighting, replace texturing SkeletalDebugger.jointText.getSceneHints().setLightCombineMode(LightCombineMode.Off); @@ -65,7 +66,7 @@ public class SkeletalDebugger { /** * Traverse the given scene and draw the currently posed Skeleton of any SkinnedMesh we encounter. - * + * * @param scene * the scene * @param renderer @@ -78,7 +79,7 @@ public class SkeletalDebugger { /** * Traverse the given scene and draw the currently posed Skeleton of any SkinnedMesh we encounter. If showLabels is * true, joint names will be drawn over the joints. - * + * * @param scene * the scene * @param renderer @@ -130,10 +131,11 @@ public class SkeletalDebugger { /** * Draw a skeleton in a specific pose. - * + * * @param pose * the posed skeleton to draw * @param scene + * the scene * @param renderer * the Renderer to draw with. * @param showLabels @@ -165,8 +167,8 @@ public class SkeletalDebugger { final Transform t = scene.getWorldTransform().multiply(globals[i], store); point.zero(); - SkeletalDebugger.jointText.setTranslation(Camera.getCurrentCamera().getScreenCoordinates( - t.applyForward(point))); + SkeletalDebugger.jointText + .setTranslation(Camera.getCurrentCamera().getScreenCoordinates(t.applyForward(point))); final double size = SkeletalDebugger.LABEL_RATIO; SkeletalDebugger.jointText.setScale(size, size, -size); @@ -183,13 +185,14 @@ public class SkeletalDebugger { /** Our bone shape. */ private static final Pyramid bone = new Pyramid("bone", 1, 1); + static { // Alter the primitive to better represent our bone. // Set color to white SkeletalDebugger.setBoneColor(ColorRGBA.WHITE); // Rotate the vertices of our bone to point along the Z axis instead of the Y. - SkeletalDebugger.bone.getMeshData().rotatePoints( - new Quaternion().fromAngleAxis(90 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X)); + SkeletalDebugger.bone.getMeshData() + .rotatePoints(new Quaternion().fromAngleAxis(90 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X)); // Drop the normals SkeletalDebugger.bone.getMeshData().setNormalBuffer(null); @@ -208,12 +211,13 @@ public class SkeletalDebugger { /** * Draw a single bone using the given world-space joint transformations. - * + * * @param start * our parent joint transform * @param end * our child joint transform * @param scene + * the scene * @param renderer * the Renderer to draw with. */ @@ -254,8 +258,8 @@ public class SkeletalDebugger { SkeletalDebugger.bone.setWorldRotation(q); // Offset with skin transform - SkeletalDebugger.bone.setWorldTransform(scene.getWorldTransform().multiply( - SkeletalDebugger.bone.getWorldTransform(), null)); + SkeletalDebugger.bone + .setWorldTransform(scene.getWorldTransform().multiply(SkeletalDebugger.bone.getWorldTransform(), null)); // Release some temp vars. Matrix3.releaseTempInstance(orient); @@ -268,7 +272,7 @@ public class SkeletalDebugger { /** * Set the color of the joint label object used in showing joint names. - * + * * @param color * the new color to use for joint labels. */ @@ -278,7 +282,7 @@ public class SkeletalDebugger { /** * Set the color of the bone object used in skeleton drawing. - * + * * @param color * the new color to use for skeleton bones. */ @@ -288,6 +292,7 @@ public class SkeletalDebugger { /** Our joint shape. */ private static final Sphere joint = new Sphere("joint", 3, 4, 0.5); + static { // Alter the primitive to better represent our joint. // Set color to cyan @@ -307,15 +312,17 @@ public class SkeletalDebugger { // Update our joint and make it ready for use. SkeletalDebugger.joint.updateGeometricState(0); } + private static Transform spTransform = new Transform(); private static Matrix3 spMatrix = new Matrix3(); /** * Draw a single Joint using the given world-space joint transform. - * + * * @param jntTransform * our joint transform * @param scene + * the scene * @param renderer * the Renderer to draw with. */ @@ -337,7 +344,7 @@ public class SkeletalDebugger { /** * Set the color of the joint object used in skeleton drawing. - * + * * @param color * the new color to use for skeleton joints. */ |