diff --git a/engine/src/core/com/jme3/asset/Asset.java b/engine/src/core/com/jme3/asset/Asset.java index 0af00aa4f..f36f96395 100644 --- a/engine/src/core/com/jme3/asset/Asset.java +++ b/engine/src/core/com/jme3/asset/Asset.java @@ -34,8 +34,40 @@ package com.jme3.asset; /** * Implementing the asset interface allows use of smart asset management. + *
+ * Smart asset management requires cooperation from the {@link AssetKey}.
+ * In particular, the AssetKey should return true in its
+ * {@link AssetKey#useSmartCache() } method. Also smart assets MUST
+ * create a clone of the asset and cannot return the same reference,
+ * e.g. {@link AssetKey#createClonedInstance(java.lang.Object) createCloneInstance(someAsset)} != someAsset
.
+ *
+ * If the {@link AssetManager#loadAsset(com.jme3.asset.AssetKey) } method + * is called twice with the same asset key (equals() wise, not necessarily reference wise) + * then both assets will have the same asset key set (reference wise) via + * {@link Asset#setKey(com.jme3.asset.AssetKey) }, then this asset key + * is used to track all instances of that asset. Once all clones of the asset + * are garbage collected, the shared asset key becomes unreachable and at that + * point it is removed from the smart asset cache. */ public interface Asset { + + /** + * Set by the {@link AssetManager} to track this asset. + * + * Only clones of the asset has this set, the original copy that + * was loaded has this key set to null so that only the clones are tracked + * for garbage collection. + * + * @param key The AssetKey to set + */ public void setKey(AssetKey key); + + /** + * Returns the asset key that is used to track this asset for garbage + * collection. + * + * @return the asset key that is used to track this asset for garbage + * collection. + */ public AssetKey getKey(); } diff --git a/engine/src/core/com/jme3/asset/package.html b/engine/src/core/com/jme3/asset/package.html new file mode 100644 index 000000000..d9e191324 --- /dev/null +++ b/engine/src/core/com/jme3/asset/package.html @@ -0,0 +1,37 @@ + + + +
+com.jme3.asset
contains the {@link com.jme3.asset.AssetManager},
+a utility class that is used to load assets such as textures, models, and
+sound effects in a jME3 application. + +
AssetLoader
that
+loads TGA images should read a stream in .tga format and return an
+{@link com.jme3.texture.Image} object as its output.
+AssetLoader
s are initialized once a file of that format
+is loaded, there's only one AssetLoader per thread so
+AssetLoader's load() method does not have to be thread safe.
+
+AssetLocators
for loading files from the application's
+classpath, the local hard drive, a ZIP file, an HTTP server, and more. The user
+can implement their own AssetLocators and register them with the AssetManager
+to load their resources from their own location.
+
+
+
+
+
diff --git a/engine/src/core/com/jme3/audio/AudioData.java b/engine/src/core/com/jme3/audio/AudioData.java
index a984018e3..186a7346b 100644
--- a/engine/src/core/com/jme3/audio/AudioData.java
+++ b/engine/src/core/com/jme3/audio/AudioData.java
@@ -37,8 +37,8 @@ import com.jme3.util.NativeObject;
/**
* AudioData
is an abstract representation
* of audio data. There are two ways to handle audio data, short audio files
- * are to be stored entirely in memory, while long audio files (music) is
- * streamed from the hard drive as it is played.
+ * are to be stored entirely in memory, while long audio files (music) are
+ * streamed from the hard drive as they are played.
*
* @author Kirill Vainer
*/
diff --git a/engine/src/core/com/jme3/bounding/BoundingVolume.java b/engine/src/core/com/jme3/bounding/BoundingVolume.java
index a74bccfe2..c96fdfb86 100644
--- a/engine/src/core/com/jme3/bounding/BoundingVolume.java
+++ b/engine/src/core/com/jme3/bounding/BoundingVolume.java
@@ -54,12 +54,33 @@ import com.jme3.math.Vector3f;
*/
public abstract class BoundingVolume implements Savable, Cloneable, Collidable {
+ /**
+ * The type of bounding volume being used.
+ */
public enum Type {
- Sphere, AABB, OBB, Capsule;
+ /**
+ * {@link BoundingSphere}
+ */
+ Sphere,
+
+ /**
+ * {@link BoundingBox}.
+ */
+ AABB,
+
+ /**
+ * {@link com.jme3.bounding.OrientedBoundingBox}
+ */
+ OBB,
+
+ /**
+ * Currently unsupported by jME3.
+ */
+ Capsule;
}
protected int checkPlane = 0;
- Vector3f center = new Vector3f();
+ protected Vector3f center = new Vector3f();
public BoundingVolume() {
}
diff --git a/engine/src/core/com/jme3/collision/CollisionResult.java b/engine/src/core/com/jme3/collision/CollisionResult.java
index 42366d071..2f3455312 100644
--- a/engine/src/core/com/jme3/collision/CollisionResult.java
+++ b/engine/src/core/com/jme3/collision/CollisionResult.java
@@ -38,7 +38,11 @@ import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
/**
- * @author Kirill
+ * A CollisionResult
represents a single collision instance
+ * between two {@link Collidable}. A collision check can result in many
+ * collision instances (places where collision has occured).
+ *
+ * @author Kirill Vainer
*/
public class CollisionResult implements Comparable