Skip to content

Commit 9d5eeee

Browse files
committed
jme3-core: correct/clarify javadoc
1 parent 076f249 commit 9d5eeee

9 files changed

Lines changed: 235 additions & 197 deletions

File tree

jme3-core/src/main/java/com/jme3/anim/tween/action/BlendableAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected float getTransitionWeight() {
114114
}
115115

116116
/**
117-
* @param maxTransitionWeight The max transition weight. Must be &gt= 0 and &lt=1 (default=1)
117+
* @param maxTransitionWeight The max transition weight. Must be >0 and <1 (default=1)
118118
*/
119119
public void setMaxTransitionWeight(double maxTransitionWeight) {
120120
assert maxTransitionWeight >= 0 && maxTransitionWeight <= 1;

jme3-core/src/main/java/com/jme3/material/RenderState.java

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ public enum BlendMode {
311311
* Result.rgb = Source Alpha * Source Color +
312312
* (1 - Source Alpha) * Dest Color -&gt; (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
313313
* Result.a = 1 * Source Alpha + 1 * Dest Alpha -&gt; (GL_ONE, GL_ONE)
314-
*
315314
*/
316315
AlphaSumA,
317316
/**
@@ -600,9 +599,12 @@ public RenderState clone() {
600599
}
601600

602601
/**
603-
* returns true if the given renderState is equal to this one
604-
* @param o the renderState to compare to
605-
* @return true if the renderStates are equal
602+
* Tests for equivalence with the argument. If {@code o} is null, false is
603+
* returned. Either way, the current instance is unaffected.
604+
*
605+
* @param o the object to compare (may be null, unaffected)
606+
* @return true if {@code this} and {@code o} are equivalent,
607+
* otherwise false
606608
*/
607609
@Override
608610
public boolean equals(Object o) {
@@ -901,7 +903,7 @@ public void setWireframe(boolean wireframe) {
901903
* @see <a href="http://www.opengl.org/resources/faq/technical/polygonoffset.htm">http://www.opengl.org/resources/faq/technical/polygonoffset.htm</a>
902904
* @param factor scales the maximum Z slope, with respect to X or Y of the polygon
903905
* @param units scales the minimum resolvable depth buffer value
904-
**/
906+
*/
905907
public void setPolyOffset(float factor, float units) {
906908
applyPolyOffset = true;
907909
if (factor == 0 && units == 0) {
@@ -966,6 +968,7 @@ public void setStencil(boolean enabled,
966968
/**
967969
* Set the depth comparison function to the given TestFunction
968970
* default is LessOrEqual (GL_LEQUAL)
971+
*
969972
* @see TestFunction
970973
* @see RenderState#setDepthTest(boolean)
971974
* @param depthFunc the depth comparison function
@@ -980,6 +983,7 @@ public void setDepthFunc(TestFunction depthFunc) {
980983
* Sets the mesh line width.
981984
* Use this in conjunction with {@link #setWireframe(boolean)} or with a mesh in
982985
* {@link com.jme3.scene.Mesh.Mode#Lines} mode.
986+
*
983987
* @param lineWidth the line width.
984988
*/
985989
public void setLineWidth(float lineWidth) {
@@ -1153,71 +1157,81 @@ public TestFunction getBackStencilFunction() {
11531157
}
11541158

11551159
/**
1156-
* Sets the front stencil mask
1157-
* @param frontStencilMask
1160+
* Sets the front stencil mask.
1161+
*
1162+
* @param frontStencilMask the desired bitmask (default=0x7fffffff)
11581163
*/
11591164
public void setFrontStencilMask(int frontStencilMask) {
11601165
this.frontStencilMask = frontStencilMask;
11611166
}
11621167

11631168
/**
1164-
* Sets the back stencil mask
1165-
* @param backStencilMask
1169+
* Sets the back stencil mask.
1170+
*
1171+
* @param backStencilMask the desired bitmask (default=0x7fffffff)
11661172
*/
11671173
public void setBackStencilMask(int backStencilMask) {
11681174
this.backStencilMask = backStencilMask;
11691175
}
11701176

11711177
/**
1172-
* Sets the front stencil reference
1173-
* @param frontStencilReference
1178+
* Sets the front stencil reference.
1179+
*
1180+
* @param frontStencilReference the desired reference (default=0x0)
11741181
*/
11751182
public void setFrontStencilReference(int frontStencilReference) {
11761183
this.frontStencilReference = frontStencilReference;
11771184
}
11781185

11791186
/**
1180-
* Sets the back stencil reference
1181-
* @param backStencilReference
1187+
* Sets the back stencil reference.
1188+
*
1189+
* @param backStencilReference the desired bitmask (default=0x0)
11821190
*/
11831191
public void setBackStencilReference(int backStencilReference) {
11841192
this.backStencilReference = backStencilReference;
11851193
}
11861194

11871195
/**
1188-
* Returns the front stencil mask
1189-
* @return
1196+
* Returns the front stencil mask.
1197+
*
1198+
* @return the bitmask applied before comparing the front stencil to its
1199+
* reference value
11901200
*/
11911201
public int getFrontStencilMask() {
11921202
return frontStencilMask;
11931203
}
11941204

11951205
/**
1196-
* Returns the front stencil reference
1197-
* @return
1206+
* Returns the front stencil reference.
1207+
*
1208+
* @return the reference value for the front stencil
11981209
*/
11991210
public int getFrontStencilReference() {
12001211
return frontStencilReference;
12011212
}
12021213

12031214
/**
1204-
* Returns the back stencil mask
1205-
* @return
1215+
* Returns the back stencil mask.
1216+
*
1217+
* @return the bitmask applied before comparing the back stencil to its
1218+
* reference value
12061219
*/
12071220
public int getBackStencilMask() {
12081221
return backStencilMask;
12091222
}
12101223

12111224
/**
1212-
* Returns the back stencil reference
1213-
* @return
1225+
* Returns the back stencil reference.
1226+
*
1227+
* @return the reference value for the back stencil
12141228
*/
12151229
public int getBackStencilReference() {
12161230
return backStencilReference;
12171231
}
12181232

12191233
/**
1220-
* Retrieve the blend equation.
1234+
* Returns the blend equation.
12211235
*
12221236
* @return the blend equation.
12231237
*/
@@ -1226,7 +1240,7 @@ public BlendEquation getBlendEquation() {
12261240
}
12271241

12281242
/**
1229-
* Retrieve the blend equation used for the alpha component.
1243+
* Returns the blend equation used for the alpha component.
12301244
*
12311245
* @return the blend equation for the alpha component.
12321246
*/
@@ -1235,7 +1249,7 @@ public BlendEquationAlpha getBlendEquationAlpha() {
12351249
}
12361250

12371251
/**
1238-
* Retrieve the blend mode.
1252+
* Returns the blend mode.
12391253
*
12401254
* @return the blend mode.
12411255
*/
@@ -1244,7 +1258,7 @@ public BlendMode getBlendMode() {
12441258
}
12451259

12461260
/**
1247-
* Provides the source factor for the RGB components in
1261+
* Returns the source factor for the RGB components in
12481262
* <code>BlendMode.Custom</code>.
12491263
*
12501264
* @return the custom source factor for RGB components.
@@ -1254,7 +1268,7 @@ public BlendFunc getCustomSfactorRGB() {
12541268
}
12551269

12561270
/**
1257-
* Provides the destination factor for the RGB components in
1271+
* Returns the destination factor for the RGB components in
12581272
* <code>BlendMode.Custom</code>.
12591273
*
12601274
* @return the custom destination factor for RGB components.
@@ -1264,7 +1278,7 @@ public BlendFunc getCustomDfactorRGB() {
12641278
}
12651279

12661280
/**
1267-
* Provides the source factor for the alpha component in
1281+
* Returns the source factor for the alpha component in
12681282
* <code>BlendMode.Custom</code>.
12691283
*
12701284
* @return the custom destination factor for alpha component.
@@ -1274,7 +1288,7 @@ public BlendFunc getCustomSfactorAlpha() {
12741288
}
12751289

12761290
/**
1277-
* Provides the destination factor for the alpha component in
1291+
* Returns the destination factor for the alpha component in
12781292
* <code>BlendMode.Custom</code>.
12791293
*
12801294
* @return the custom destination factor for alpha component.

jme3-core/src/main/java/com/jme3/math/Matrix3f.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,8 @@ public void loadIdentity() {
767767
/**
768768
* Tests for exact identity. The matrix is unaffected.
769769
*
770-
* @return true if equal to {@link #IDENTITY}, otherwise false
770+
* @return true if all diagonals = 1 and all other elements = 0 or -0,
771+
* otherwise false
771772
*/
772773
public boolean isIdentity() {
773774
return (m00 == 1 && m01 == 0 && m02 == 0)
@@ -1177,7 +1178,7 @@ public Matrix3f transposeNew() {
11771178

11781179
/**
11791180
* Returns a string representation of the matrix, which is unaffected. For
1180-
* example, an identity matrix would be represented by:
1181+
* example, the identity matrix is represented by:
11811182
* <pre>
11821183
* Matrix3f
11831184
* [
@@ -1187,7 +1188,7 @@ public Matrix3f transposeNew() {
11871188
* ]
11881189
* </pre>
11891190
*
1190-
* @return the string representation
1191+
* @return the string representation (not null, not empty)
11911192
*/
11921193
@Override
11931194
public String toString() {
@@ -1217,10 +1218,10 @@ public String toString() {
12171218
}
12181219

12191220
/**
1220-
* Returns a hash code. If two matrices are logically equivalent, they will
1221-
* return the same hash code. The current instance is unaffected.
1221+
* Returns a hash code. If two matrices have identical values, they will
1222+
* have the same hash code. The matrix is unaffected.
12221223
*
1223-
* @return the hash-code value
1224+
* @return a 32-bit value for use in hashing
12241225
* @see java.lang.Object#hashCode()
12251226
*/
12261227
@Override
@@ -1242,11 +1243,13 @@ public int hashCode() {
12421243
}
12431244

12441245
/**
1245-
* Tests for exact equality with the argument, distinguishing -0 from 0. The
1246-
* current instance is unaffected.
1246+
* Tests for exact equality with the argument, distinguishing -0 from 0. If
1247+
* {@code o} is null, false is returned. Either way, the current instance is
1248+
* unaffected.
12471249
*
12481250
* @param o the object to compare (may be null, unaffected)
1249-
* @return true if equal, otherwise false
1251+
* @return true if {@code this} and {@code o} have identical values,
1252+
* otherwise false
12501253
*/
12511254
@Override
12521255
public boolean equals(Object o) {

0 commit comments

Comments
 (0)