Skip to content

Commit e2a570e

Browse files
authored
rename method arguments for clarity (#1716)
* rename method arguments for clarity * Transform: rename 2 args * Quaternion: rename 3 args * rename "JmeImporter e" arguments * Vector3f: vector arguments named "scalar"??? * Vector4f: vector arguments named "scalar"??? * Google style prohibits underscores in argument names * jme3-core: "Amnt" -> "Amount"
1 parent b543418 commit e2a570e

File tree

53 files changed

+380
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+380
-379
lines changed

jme3-android/src/main/java/com/jme3/renderer/android/AndroidGL.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ public void glBufferData(int target, ByteBuffer data, int usage) {
138138
}
139139

140140
@Override
141-
public void glBufferData(int target, long data_size, int usage) {
142-
GLES20.glBufferData(target, (int) data_size, null, usage);
141+
public void glBufferData(int target, long dataSize, int usage) {
142+
GLES20.glBufferData(target, (int) dataSize, null, usage);
143143
}
144144

145145
@Override
@@ -565,8 +565,8 @@ public void glDrawBuffers(IntBuffer bufs) {
565565
}
566566

567567
@Override
568-
public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) {
569-
GLES30.glDrawElementsInstanced(mode, indices_count, type, (int)indices_buffer_offset, primcount);
568+
public void glDrawElementsInstancedARB(int mode, int indicesCount, int type, long indicesBufferOffset, int primcount) {
569+
GLES30.glDrawElementsInstanced(mode, indicesCount, type, (int)indicesBufferOffset, primcount);
570570
}
571571

572572
@Override

jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,9 +1136,9 @@ public void write(JmeExporter e) throws IOException {
11361136
}
11371137

11381138
@Override
1139-
public void read(JmeImporter e) throws IOException {
1140-
super.read(e);
1141-
InputCapsule capsule = e.getCapsule(this);
1139+
public void read(JmeImporter importer) throws IOException {
1140+
super.read(importer);
1141+
InputCapsule capsule = importer.getCapsule(this);
11421142
xExtent = capsule.readFloat("xExtent", 0);
11431143
yExtent = capsule.readFloat("yExtent", 0);
11441144
zExtent = capsule.readFloat("zExtent", 0);

jme3-core/src/main/java/com/jme3/bounding/BoundingSphere.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,10 +1062,10 @@ public void write(JmeExporter e) throws IOException {
10621062
}
10631063

10641064
@Override
1065-
public void read(JmeImporter e) throws IOException {
1066-
super.read(e);
1065+
public void read(JmeImporter importer) throws IOException {
1066+
super.read(importer);
10671067
try {
1068-
radius = e.getCapsule(this).readFloat("radius", 0);
1068+
radius = importer.getCapsule(this).readFloat("radius", 0);
10691069
} catch (IOException ex) {
10701070
logger.logp(Level.SEVERE, this.getClass().toString(), "read(JMEImporter)", "Exception", ex);
10711071
}

jme3-core/src/main/java/com/jme3/bounding/BoundingVolume.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ public void write(JmeExporter e) throws IOException {
318318
}
319319

320320
@Override
321-
public void read(JmeImporter e) throws IOException {
322-
center = (Vector3f) e.getCapsule(this).readSavable("center", Vector3f.ZERO.clone());
321+
public void read(JmeImporter importer) throws IOException {
322+
center = (Vector3f) importer.getCapsule(this).readSavable("center", Vector3f.ZERO.clone());
323323
}
324324

325325
public int collideWith(Collidable other) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,12 @@ public void write(JmeExporter e) throws IOException {
547547
* De-serialize this color from the specified importer, for example when
548548
* loading from a J3O file.
549549
*
550-
* @param e (not null)
550+
* @param importer (not null)
551551
* @throws IOException from the importer
552552
*/
553553
@Override
554-
public void read(JmeImporter e) throws IOException {
555-
InputCapsule capsule = e.getCapsule(this);
554+
public void read(JmeImporter importer) throws IOException {
555+
InputCapsule capsule = importer.getCapsule(this);
556556
r = capsule.readFloat("r", 0);
557557
g = capsule.readFloat("g", 0);
558558
b = capsule.readFloat("b", 0);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ public void write(JmeExporter e) throws IOException {
248248
* De-serialize this line from the specified importer, for example when
249249
* loading from a J3O file.
250250
*
251-
* @param e (not null)
251+
* @param importer (not null)
252252
* @throws IOException from the importer
253253
*/
254254
@Override
255-
public void read(JmeImporter e) throws IOException {
256-
InputCapsule capsule = e.getCapsule(this);
255+
public void read(JmeImporter importer) throws IOException {
256+
InputCapsule capsule = importer.getCapsule(this);
257257
origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone());
258258
direction = (Vector3f) capsule.readSavable("direction", Vector3f.ZERO.clone());
259259
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,12 @@ public void write(JmeExporter e) throws IOException {
692692
* De-serialize this segment from the specified importer, for example
693693
* when loading from a J3O file.
694694
*
695-
* @param e (not null)
695+
* @param importer (not null)
696696
* @throws IOException from the importer
697697
*/
698698
@Override
699-
public void read(JmeImporter e) throws IOException {
700-
InputCapsule capsule = e.getCapsule(this);
699+
public void read(JmeImporter importer) throws IOException {
700+
InputCapsule capsule = importer.getCapsule(this);
701701
origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone());
702702
direction = (Vector3f) capsule.readSavable("direction", Vector3f.ZERO.clone());
703703
extent = capsule.readFloat("extent", 0);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,12 +1293,12 @@ public void write(JmeExporter e) throws IOException {
12931293
* De-serialize this matrix from the specified importer, for example
12941294
* when loading from a J3O file.
12951295
*
1296-
* @param e (not null)
1296+
* @param importer (not null)
12971297
* @throws IOException from the importer
12981298
*/
12991299
@Override
1300-
public void read(JmeImporter e) throws IOException {
1301-
InputCapsule cap = e.getCapsule(this);
1300+
public void read(JmeImporter importer) throws IOException {
1301+
InputCapsule cap = importer.getCapsule(this);
13021302
m00 = cap.readFloat("m00", 1);
13031303
m01 = cap.readFloat("m01", 0);
13041304
m02 = cap.readFloat("m02", 0);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,12 +2335,12 @@ public void write(JmeExporter e) throws IOException {
23352335
* De-serialize from the specified importer, for example when loading from a
23362336
* J3O file.
23372337
*
2338-
* @param e (not null)
2338+
* @param importer (not null)
23392339
* @throws IOException from the importer
23402340
*/
23412341
@Override
2342-
public void read(JmeImporter e) throws IOException {
2343-
InputCapsule cap = e.getCapsule(this);
2342+
public void read(JmeImporter importer) throws IOException {
2343+
InputCapsule cap = importer.getCapsule(this);
23442344
m00 = cap.readFloat("m00", 1);
23452345
m01 = cap.readFloat("m01", 0);
23462346
m02 = cap.readFloat("m02", 0);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ public void write(JmeExporter e) throws IOException {
323323
* De-serialize this plane from the specified importer, for example when
324324
* loading from a J3O file.
325325
*
326-
* @param e (not null)
326+
* @param importer (not null)
327327
* @throws IOException from the importer
328328
*/
329329
@Override
330-
public void read(JmeImporter e) throws IOException {
331-
InputCapsule capsule = e.getCapsule(this);
330+
public void read(JmeImporter importer) throws IOException {
331+
InputCapsule capsule = importer.getCapsule(this);
332332
normal = (Vector3f) capsule.readSavable("normal", Vector3f.ZERO.clone());
333333
constant = capsule.readFloat("constant", 0);
334334
}

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -800,14 +800,14 @@ public Quaternion slerp(Quaternion q1, Quaternion q2, float t) {
800800

801801
/**
802802
* Sets the values of this quaternion to the slerp from itself to q2 by
803-
* changeAmnt
803+
* changeAmount
804804
*
805805
* @param q2
806806
* Final interpolation value
807-
* @param changeAmnt
807+
* @param changeAmount
808808
* The amount difference
809809
*/
810-
public void slerp(Quaternion q2, float changeAmnt) {
810+
public void slerp(Quaternion q2, float changeAmount) {
811811
if (this.x == q2.x && this.y == q2.y && this.z == q2.z
812812
&& this.w == q2.w) {
813813
return;
@@ -826,8 +826,8 @@ public void slerp(Quaternion q2, float changeAmnt) {
826826
}
827827

828828
// Set the first and second scale for the interpolation
829-
float scale0 = 1 - changeAmnt;
830-
float scale1 = changeAmnt;
829+
float scale0 = 1 - changeAmount;
830+
float scale1 = changeAmount;
831831

832832
// Check if the angle between the 2 quaternions was big enough to
833833
// warrant such calculations
@@ -839,8 +839,8 @@ public void slerp(Quaternion q2, float changeAmnt) {
839839

840840
// Calculate the scale for q1 and q2, according to the angle and
841841
// its sine
842-
scale0 = FastMath.sin((1 - changeAmnt) * theta) * invSinTheta;
843-
scale1 = FastMath.sin((changeAmnt * theta)) * invSinTheta;
842+
scale0 = FastMath.sin((1 - changeAmount) * theta) * invSinTheta;
843+
scale1 = FastMath.sin((changeAmount * theta)) * invSinTheta;
844844
}
845845

846846
// Calculate the x, y, z and w values for the quaternion by using a
@@ -945,24 +945,24 @@ public Quaternion mult(Quaternion q) {
945945
* The result is returned as a new quaternion. It should be noted that
946946
* quaternion multiplication is not commutative so q * p != p * q.
947947
*
948-
* It IS safe for q and res to be the same object.
949-
* It IS NOT safe for this and res to be the same object.
948+
* It IS safe for q and storeResult to be the same object.
949+
* It IS NOT safe for this and storeResult to be the same object.
950950
*
951951
* @param q the quaternion to multiply this quaternion by.
952-
* @param res
952+
* @param storeResult
953953
* the quaternion to store the result in.
954954
* @return the new quaternion.
955955
*/
956-
public Quaternion mult(Quaternion q, Quaternion res) {
957-
if (res == null) {
958-
res = new Quaternion();
956+
public Quaternion mult(Quaternion q, Quaternion storeResult) {
957+
if (storeResult == null) {
958+
storeResult = new Quaternion();
959959
}
960960
float qw = q.w, qx = q.x, qy = q.y, qz = q.z;
961-
res.x = x * qw + y * qz - z * qy + w * qx;
962-
res.y = -x * qz + y * qw + z * qx + w * qy;
963-
res.z = x * qy - y * qx + z * qw + w * qz;
964-
res.w = -x * qx - y * qy - z * qz + w * qw;
965-
return res;
961+
storeResult.x = x * qw + y * qz - z * qy + w * qx;
962+
storeResult.y = -x * qz + y * qw + z * qx + w * qy;
963+
storeResult.z = x * qy - y * qx + z * qw + w * qz;
964+
storeResult.w = -x * qx - y * qy - z * qz + w * qw;
965+
return storeResult;
966966
}
967967

968968
/**
@@ -1461,12 +1461,12 @@ public void write(JmeExporter e) throws IOException {
14611461
* De-serialize this quaternion from the specified importer, for example
14621462
* when loading from a J3O file.
14631463
*
1464-
* @param e (not null)
1464+
* @param importer (not null)
14651465
* @throws IOException from the importer
14661466
*/
14671467
@Override
1468-
public void read(JmeImporter e) throws IOException {
1469-
InputCapsule cap = e.getCapsule(this);
1468+
public void read(JmeImporter importer) throws IOException {
1469+
InputCapsule cap = importer.getCapsule(this);
14701470
x = cap.readFloat("x", 0);
14711471
y = cap.readFloat("y", 0);
14721472
z = cap.readFloat("z", 0);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,12 @@ public void write(JmeExporter e) throws IOException {
533533
* De-serialize this ray from the specified importer, for example
534534
* when loading from a J3O file.
535535
*
536-
* @param e (not null)
536+
* @param importer (not null)
537537
* @throws IOException from the importer
538538
*/
539539
@Override
540-
public void read(JmeImporter e) throws IOException {
541-
InputCapsule capsule = e.getCapsule(this);
540+
public void read(JmeImporter importer) throws IOException {
541+
InputCapsule capsule = importer.getCapsule(this);
542542
origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone());
543543
direction = (Vector3f) capsule.readSavable("direction", Vector3f.ZERO.clone());
544544
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ public void write(JmeExporter e) throws IOException {
225225
* De-serialize this rectangle from the specified importer, for example
226226
* when loading from a J3O file.
227227
*
228-
* @param e (not null)
228+
* @param importer (not null)
229229
* @throws IOException from the importer
230230
*/
231231
@Override
232-
public void read(JmeImporter e) throws IOException {
233-
InputCapsule capsule = e.getCapsule(this);
232+
public void read(JmeImporter importer) throws IOException {
233+
InputCapsule capsule = importer.getCapsule(this);
234234
a = (Vector3f) capsule.readSavable("a", Vector3f.ZERO.clone());
235235
b = (Vector3f) capsule.readSavable("b", Vector3f.ZERO.clone());
236236
c = (Vector3f) capsule.readSavable("c", Vector3f.ZERO.clone());

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ public void write(JmeExporter e) throws IOException {
214214
* De-serialize this ring from the specified importer, for example
215215
* when loading from a J3O file.
216216
*
217-
* @param e (not null)
217+
* @param importer (not null)
218218
* @throws IOException from the importer
219219
*/
220220
@Override
221-
public void read(JmeImporter e) throws IOException {
222-
InputCapsule capsule = e.getCapsule(this);
221+
public void read(JmeImporter importer) throws IOException {
222+
InputCapsule capsule = importer.getCapsule(this);
223223
center = (Vector3f) capsule.readSavable("center", Vector3f.ZERO.clone());
224224
up = (Vector3f) capsule.readSavable("up", Vector3f.UNIT_Z.clone());
225225
innerRadius = capsule.readFloat("innerRadius", 0f);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,13 @@ public String toString() {
485485
/**
486486
* Copies all 3 components from the argument.
487487
*
488-
* @param matrixQuat The Transform to copy (not null, unaffected)
488+
* @param transform The Transform to copy (not null, unaffected)
489489
* @return the (modified) current instance (for chaining)
490490
*/
491-
public Transform set(Transform matrixQuat) {
492-
this.translation.set(matrixQuat.translation);
493-
this.rot.set(matrixQuat.rot);
494-
this.scale.set(matrixQuat.scale);
491+
public Transform set(Transform transform) {
492+
this.translation.set(transform.translation);
493+
this.rot.set(transform.rot);
494+
this.scale.set(transform.scale);
495495
return this;
496496
}
497497

@@ -514,12 +514,12 @@ public void write(JmeExporter e) throws IOException {
514514
* De-serializes from the argument, for example when loading from a J3O
515515
* file.
516516
*
517-
* @param e (not null)
517+
* @param importer (not null)
518518
* @throws IOException from the importer
519519
*/
520520
@Override
521-
public void read(JmeImporter e) throws IOException {
522-
InputCapsule capsule = e.getCapsule(this);
521+
public void read(JmeImporter importer) throws IOException {
522+
InputCapsule capsule = importer.getCapsule(this);
523523

524524
rot.set((Quaternion) capsule.readSavable("rot", Quaternion.IDENTITY));
525525
translation.set((Vector3f) capsule.readSavable("translation", Vector3f.ZERO));

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ public void write(JmeExporter e) throws IOException {
368368
* De-serialize this triangle from the specified importer, for example when
369369
* loading from a J3O file.
370370
*
371-
* @param e (not null)
371+
* @param importer (not null)
372372
* @throws IOException from the importer
373373
*/
374374
@Override
375-
public void read(JmeImporter e) throws IOException {
376-
pointa = (Vector3f) e.getCapsule(this).readSavable("pointa", Vector3f.ZERO.clone());
377-
pointb = (Vector3f) e.getCapsule(this).readSavable("pointb", Vector3f.ZERO.clone());
378-
pointc = (Vector3f) e.getCapsule(this).readSavable("pointc", Vector3f.ZERO.clone());
375+
public void read(JmeImporter importer) throws IOException {
376+
pointa = (Vector3f) importer.getCapsule(this).readSavable("pointa", Vector3f.ZERO.clone());
377+
pointb = (Vector3f) importer.getCapsule(this).readSavable("pointb", Vector3f.ZERO.clone());
378+
pointc = (Vector3f) importer.getCapsule(this).readSavable("pointc", Vector3f.ZERO.clone());
379379
}
380380

381381
/**

0 commit comments

Comments
 (0)