Skip to content

rename method arguments for clarity #1716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public void glBufferData(int target, ByteBuffer data, int usage) {
}

@Override
public void glBufferData(int target, long data_size, int usage) {
GLES20.glBufferData(target, (int) data_size, null, usage);
public void glBufferData(int target, long dataSize, int usage) {
GLES20.glBufferData(target, (int) dataSize, null, usage);
}

@Override
Expand Down Expand Up @@ -565,8 +565,8 @@ public void glDrawBuffers(IntBuffer bufs) {
}

@Override
public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) {
GLES30.glDrawElementsInstanced(mode, indices_count, type, (int)indices_buffer_offset, primcount);
public void glDrawElementsInstancedARB(int mode, int indicesCount, int type, long indicesBufferOffset, int primcount) {
GLES30.glDrawElementsInstanced(mode, indicesCount, type, (int)indicesBufferOffset, primcount);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,9 @@ public void write(JmeExporter e) throws IOException {
}

@Override
public void read(JmeImporter e) throws IOException {
super.read(e);
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
super.read(importer);
InputCapsule capsule = importer.getCapsule(this);
xExtent = capsule.readFloat("xExtent", 0);
yExtent = capsule.readFloat("yExtent", 0);
zExtent = capsule.readFloat("zExtent", 0);
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/bounding/BoundingSphere.java
Original file line number Diff line number Diff line change
Expand Up @@ -1062,10 +1062,10 @@ public void write(JmeExporter e) throws IOException {
}

@Override
public void read(JmeImporter e) throws IOException {
super.read(e);
public void read(JmeImporter importer) throws IOException {
super.read(importer);
try {
radius = e.getCapsule(this).readFloat("radius", 0);
radius = importer.getCapsule(this).readFloat("radius", 0);
} catch (IOException ex) {
logger.logp(Level.SEVERE, this.getClass().toString(), "read(JMEImporter)", "Exception", ex);
}
Expand Down
4 changes: 2 additions & 2 deletions jme3-core/src/main/java/com/jme3/bounding/BoundingVolume.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ public void write(JmeExporter e) throws IOException {
}

@Override
public void read(JmeImporter e) throws IOException {
center = (Vector3f) e.getCapsule(this).readSavable("center", Vector3f.ZERO.clone());
public void read(JmeImporter importer) throws IOException {
center = (Vector3f) importer.getCapsule(this).readSavable("center", Vector3f.ZERO.clone());
}

public int collideWith(Collidable other) {
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/ColorRGBA.java
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this color from the specified importer, for example when
* loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);
r = capsule.readFloat("r", 0);
g = capsule.readFloat("g", 0);
b = capsule.readFloat("b", 0);
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/Line.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this line from the specified importer, for example when
* loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);
origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone());
direction = (Vector3f) capsule.readSavable("direction", Vector3f.ZERO.clone());
}
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/LineSegment.java
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this segment from the specified importer, for example
* when loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);
origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone());
direction = (Vector3f) capsule.readSavable("direction", Vector3f.ZERO.clone());
extent = capsule.readFloat("extent", 0);
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/Matrix3f.java
Original file line number Diff line number Diff line change
Expand Up @@ -1293,12 +1293,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this matrix from the specified importer, for example
* when loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule cap = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule cap = importer.getCapsule(this);
m00 = cap.readFloat("m00", 1);
m01 = cap.readFloat("m01", 0);
m02 = cap.readFloat("m02", 0);
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/Matrix4f.java
Original file line number Diff line number Diff line change
Expand Up @@ -2335,12 +2335,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize from the specified importer, for example when loading from a
* J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule cap = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule cap = importer.getCapsule(this);
m00 = cap.readFloat("m00", 1);
m01 = cap.readFloat("m01", 0);
m02 = cap.readFloat("m02", 0);
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/Plane.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this plane from the specified importer, for example when
* loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);
normal = (Vector3f) capsule.readSavable("normal", Vector3f.ZERO.clone());
constant = capsule.readFloat("constant", 0);
}
Expand Down
42 changes: 21 additions & 21 deletions jme3-core/src/main/java/com/jme3/math/Quaternion.java
Original file line number Diff line number Diff line change
Expand Up @@ -800,14 +800,14 @@ public Quaternion slerp(Quaternion q1, Quaternion q2, float t) {

/**
* Sets the values of this quaternion to the slerp from itself to q2 by
* changeAmnt
* changeAmount
*
* @param q2
* Final interpolation value
* @param changeAmnt
* @param changeAmount
* The amount difference
*/
public void slerp(Quaternion q2, float changeAmnt) {
public void slerp(Quaternion q2, float changeAmount) {
if (this.x == q2.x && this.y == q2.y && this.z == q2.z
&& this.w == q2.w) {
return;
Expand All @@ -826,8 +826,8 @@ public void slerp(Quaternion q2, float changeAmnt) {
}

// Set the first and second scale for the interpolation
float scale0 = 1 - changeAmnt;
float scale1 = changeAmnt;
float scale0 = 1 - changeAmount;
float scale1 = changeAmount;

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

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

// Calculate the x, y, z and w values for the quaternion by using a
Expand Down Expand Up @@ -945,24 +945,24 @@ public Quaternion mult(Quaternion q) {
* The result is returned as a new quaternion. It should be noted that
* quaternion multiplication is not commutative so q * p != p * q.
*
* It IS safe for q and res to be the same object.
* It IS NOT safe for this and res to be the same object.
* It IS safe for q and storeResult to be the same object.
* It IS NOT safe for this and storeResult to be the same object.
*
* @param q the quaternion to multiply this quaternion by.
* @param res
* @param storeResult
* the quaternion to store the result in.
* @return the new quaternion.
*/
public Quaternion mult(Quaternion q, Quaternion res) {
if (res == null) {
res = new Quaternion();
public Quaternion mult(Quaternion q, Quaternion storeResult) {
if (storeResult == null) {
storeResult = new Quaternion();
}
float qw = q.w, qx = q.x, qy = q.y, qz = q.z;
res.x = x * qw + y * qz - z * qy + w * qx;
res.y = -x * qz + y * qw + z * qx + w * qy;
res.z = x * qy - y * qx + z * qw + w * qz;
res.w = -x * qx - y * qy - z * qz + w * qw;
return res;
storeResult.x = x * qw + y * qz - z * qy + w * qx;
storeResult.y = -x * qz + y * qw + z * qx + w * qy;
storeResult.z = x * qy - y * qx + z * qw + w * qz;
storeResult.w = -x * qx - y * qy - z * qz + w * qw;
return storeResult;
}

/**
Expand Down Expand Up @@ -1461,12 +1461,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this quaternion from the specified importer, for example
* when loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule cap = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule cap = importer.getCapsule(this);
x = cap.readFloat("x", 0);
y = cap.readFloat("y", 0);
z = cap.readFloat("z", 0);
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/Ray.java
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this ray from the specified importer, for example
* when loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);
origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone());
direction = (Vector3f) capsule.readSavable("direction", Vector3f.ZERO.clone());
}
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/Rectangle.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this rectangle from the specified importer, for example
* when loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);
a = (Vector3f) capsule.readSavable("a", Vector3f.ZERO.clone());
b = (Vector3f) capsule.readSavable("b", Vector3f.ZERO.clone());
c = (Vector3f) capsule.readSavable("c", Vector3f.ZERO.clone());
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/math/Ring.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this ring from the specified importer, for example
* when loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);
center = (Vector3f) capsule.readSavable("center", Vector3f.ZERO.clone());
up = (Vector3f) capsule.readSavable("up", Vector3f.UNIT_Z.clone());
innerRadius = capsule.readFloat("innerRadius", 0f);
Expand Down
16 changes: 8 additions & 8 deletions jme3-core/src/main/java/com/jme3/math/Transform.java
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,13 @@ public String toString() {
/**
* Copies all 3 components from the argument.
*
* @param matrixQuat The Transform to copy (not null, unaffected)
* @param transform The Transform to copy (not null, unaffected)
* @return the (modified) current instance (for chaining)
*/
public Transform set(Transform matrixQuat) {
this.translation.set(matrixQuat.translation);
this.rot.set(matrixQuat.rot);
this.scale.set(matrixQuat.scale);
public Transform set(Transform transform) {
this.translation.set(transform.translation);
this.rot.set(transform.rot);
this.scale.set(transform.scale);
return this;
}

Expand All @@ -514,12 +514,12 @@ public void write(JmeExporter e) throws IOException {
* De-serializes from the argument, for example when loading from a J3O
* file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
InputCapsule capsule = e.getCapsule(this);
public void read(JmeImporter importer) throws IOException {
InputCapsule capsule = importer.getCapsule(this);

rot.set((Quaternion) capsule.readSavable("rot", Quaternion.IDENTITY));
translation.set((Vector3f) capsule.readSavable("translation", Vector3f.ZERO));
Expand Down
10 changes: 5 additions & 5 deletions jme3-core/src/main/java/com/jme3/math/Triangle.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,14 @@ public void write(JmeExporter e) throws IOException {
* De-serialize this triangle from the specified importer, for example when
* loading from a J3O file.
*
* @param e (not null)
* @param importer (not null)
* @throws IOException from the importer
*/
@Override
public void read(JmeImporter e) throws IOException {
pointa = (Vector3f) e.getCapsule(this).readSavable("pointa", Vector3f.ZERO.clone());
pointb = (Vector3f) e.getCapsule(this).readSavable("pointb", Vector3f.ZERO.clone());
pointc = (Vector3f) e.getCapsule(this).readSavable("pointc", Vector3f.ZERO.clone());
public void read(JmeImporter importer) throws IOException {
pointa = (Vector3f) importer.getCapsule(this).readSavable("pointa", Vector3f.ZERO.clone());
pointb = (Vector3f) importer.getCapsule(this).readSavable("pointb", Vector3f.ZERO.clone());
pointc = (Vector3f) importer.getCapsule(this).readSavable("pointc", Vector3f.ZERO.clone());
}

/**
Expand Down
Loading