Skip to content

Commit 0b5e869

Browse files
authored
rename private variables (#1736)
* rename private fields for clarity * TestShadowsPerf: rename "createballs()" for clarity * rename more private fields * MorphControl: rename a private method
1 parent 2da5543 commit 0b5e869

File tree

15 files changed

+180
-180
lines changed

15 files changed

+180
-180
lines changed

jme3-core/src/main/java/com/jme3/anim/MorphControl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected void controlRender(RenderManager rm, ViewPort vp) {
142142
lastGpuTargetIndex = i;
143143
// binding the morph target's buffers to the mesh morph buffers.
144144
MorphTarget t = morphTargets[i];
145-
boundBufferIdx = bindMorphtargetBuffer(mesh, targetNumBuffers, boundBufferIdx, t);
145+
boundBufferIdx = bindMorphTargetBuffer(mesh, targetNumBuffers, boundBufferIdx, t);
146146
// setting the weight in the mat param array
147147
matWeights[nbGPUTargets] = weights[i];
148148
nbGPUTargets++;
@@ -179,7 +179,7 @@ protected void controlRender(RenderManager rm, ViewPort vp) {
179179
writeCpuBuffer(targetNumBuffers, mt);
180180

181181
// binding the merged morph target
182-
bindMorphtargetBuffer(mesh, targetNumBuffers, (nbGPUTargets - 1) * targetNumBuffers, mt);
182+
bindMorphTargetBuffer(mesh, targetNumBuffers, (nbGPUTargets - 1) * targetNumBuffers, mt);
183183

184184
// setting the eight of the merged targets
185185
matWeights[nbGPUTargets - 1] = cpuWeightSum;
@@ -236,7 +236,7 @@ private int getMaxGPUTargets(RenderManager rm, Geometry geom, Material mat, int
236236
return maxGPUTargets;
237237
}
238238

239-
private int bindMorphtargetBuffer(Mesh mesh, int targetNumBuffers, int boundBufferIdx, MorphTarget t) {
239+
private int bindMorphTargetBuffer(Mesh mesh, int targetNumBuffers, int boundBufferIdx, MorphTarget t) {
240240
int start = VertexBuffer.Type.MorphTarget0.ordinal();
241241
if (targetNumBuffers >= 1) {
242242
activateBuffer(mesh, boundBufferIdx, start, t.getBuffer(VertexBuffer.Type.Position));

jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
6161
private final ByteBuffer nativeBuf = BufferUtils.createByteBuffer(BUFFER_SIZE);
6262
private final byte[] arrayBuf = new byte[BUFFER_SIZE];
6363
private int[] channels;
64-
private AudioSource[] chanSrcs;
64+
private AudioSource[] channelSources;
6565
private int nextChan = 0;
66-
private final ArrayList<Integer> freeChans = new ArrayList<>();
66+
private final ArrayList<Integer> freeChannels = new ArrayList<>();
6767
private Listener listener;
6868
private boolean audioDisabled = false;
6969
private boolean supportEfx = false;
@@ -116,7 +116,7 @@ private void initOpenAL() {
116116
}
117117

118118
ib = BufferUtils.createIntBuffer(channels.length);
119-
chanSrcs = new AudioSource[channels.length];
119+
channelSources = new AudioSource[channels.length];
120120

121121
final String deviceName = alc.alcGetString(ALC.ALC_DEVICE_SPECIFIER);
122122

@@ -189,8 +189,8 @@ private void destroyOpenAL() {
189189
}
190190

191191
// stop any playing channels
192-
for (int i = 0; i < chanSrcs.length; i++) {
193-
if (chanSrcs[i] != null) {
192+
for (int i = 0; i < channelSources.length; i++) {
193+
if (channelSources[i] != null) {
194194
clearChannel(i);
195195
}
196196
}
@@ -643,8 +643,8 @@ private void setListenerParams(Listener listener) {
643643
}
644644

645645
private int newChannel() {
646-
if (freeChans.size() > 0) {
647-
return freeChans.remove(0);
646+
if (freeChannels.size() > 0) {
647+
return freeChannels.remove(0);
648648
} else if (nextChan < channels.length) {
649649
return nextChan++;
650650
} else {
@@ -656,7 +656,7 @@ private void freeChannel(int index) {
656656
if (index == nextChan - 1) {
657657
nextChan--;
658658
} else {
659-
freeChans.add(index);
659+
freeChannels.add(index);
660660
}
661661
}
662662

@@ -817,8 +817,8 @@ private void attachAudioToSource(int sourceId, AudioData data, boolean looping)
817817

818818
private void clearChannel(int index) {
819819
// make room at this channel
820-
if (chanSrcs[index] != null) {
821-
AudioSource src = chanSrcs[index];
820+
if (channelSources[index] != null) {
821+
AudioSource src = channelSources[index];
822822

823823
int sourceId = channels[index];
824824
al.alSourceStop(sourceId);
@@ -837,7 +837,7 @@ private void clearChannel(int index) {
837837
}
838838
}
839839

840-
chanSrcs[index] = null;
840+
channelSources[index] = null;
841841
}
842842
}
843843

@@ -891,7 +891,7 @@ public void updateInRenderThread(float tpf) {
891891
}
892892

893893
for (int i = 0; i < channels.length; i++) {
894-
AudioSource src = chanSrcs[i];
894+
AudioSource src = channelSources[i];
895895

896896
if (src == null) {
897897
continue;
@@ -974,7 +974,7 @@ public void updateInDecoderThread(float tpf) {
974974
}
975975

976976
for (int i = 0; i < channels.length; i++) {
977-
AudioSource src = chanSrcs[i];
977+
AudioSource src = channelSources[i];
978978

979979
if (src == null || !(src.getAudioData() instanceof AudioStream)) {
980980
continue;
@@ -1080,7 +1080,7 @@ public void playSourceInstance(AudioSource src) {
10801080
// set parameters, like position and max distance
10811081
setSourceParams(sourceId, src, true);
10821082
attachAudioToSource(sourceId, src.getAudioData(), false);
1083-
chanSrcs[index] = src;
1083+
channelSources[index] = src;
10841084

10851085
// play the channel
10861086
al.alSourcePlay(sourceId);
@@ -1116,7 +1116,7 @@ public void playSource(AudioSource src) {
11161116
updateAudioData(data);
11171117
}
11181118

1119-
chanSrcs[index] = src;
1119+
channelSources[index] = src;
11201120
setSourceParams(channels[index], src, false);
11211121
attachAudioToSource(channels[index], data, src.isLooping());
11221122
}

jme3-core/src/main/java/com/jme3/collision/bih/BIHTriangle.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,39 +36,39 @@
3636

3737
public final class BIHTriangle {
3838

39-
private final Vector3f pointa = new Vector3f();
40-
private final Vector3f pointb = new Vector3f();
41-
private final Vector3f pointc = new Vector3f();
39+
private final Vector3f pointA = new Vector3f();
40+
private final Vector3f pointB = new Vector3f();
41+
private final Vector3f pointC = new Vector3f();
4242
private final Vector3f center = new Vector3f();
4343

4444
public BIHTriangle(Vector3f p1, Vector3f p2, Vector3f p3) {
45-
pointa.set(p1);
46-
pointb.set(p2);
47-
pointc.set(p3);
48-
center.set(pointa);
49-
center.addLocal(pointb).addLocal(pointc).multLocal(FastMath.ONE_THIRD);
45+
pointA.set(p1);
46+
pointB.set(p2);
47+
pointC.set(p3);
48+
center.set(pointA);
49+
center.addLocal(pointB).addLocal(pointC).multLocal(FastMath.ONE_THIRD);
5050
}
5151

5252
public Vector3f get1() {
53-
return pointa;
53+
return pointA;
5454
}
5555

5656
public Vector3f get2() {
57-
return pointb;
57+
return pointB;
5858
}
5959

6060
public Vector3f get3() {
61-
return pointc;
61+
return pointC;
6262
}
6363

6464
public Vector3f getCenter() {
6565
return center;
6666
}
6767

6868
public Vector3f getNormal() {
69-
Vector3f normal = new Vector3f(pointb);
70-
normal.subtractLocal(pointa)
71-
.crossLocal(pointc.x - pointa.x, pointc.y - pointa.y, pointc.z - pointa.z);
69+
Vector3f normal = new Vector3f(pointB);
70+
normal.subtractLocal(pointA)
71+
.crossLocal(pointC.x - pointA.x, pointC.y - pointA.y, pointC.z - pointA.z);
7272
normal.normalizeLocal();
7373
return normal;
7474
}
@@ -77,19 +77,19 @@ public float getExtreme(int axis, boolean left) {
7777
float v1, v2, v3;
7878
switch (axis) {
7979
case 0:
80-
v1 = pointa.x;
81-
v2 = pointb.x;
82-
v3 = pointc.x;
80+
v1 = pointA.x;
81+
v2 = pointB.x;
82+
v3 = pointC.x;
8383
break;
8484
case 1:
85-
v1 = pointa.y;
86-
v2 = pointb.y;
87-
v3 = pointc.y;
85+
v1 = pointA.y;
86+
v2 = pointB.y;
87+
v3 = pointC.y;
8888
break;
8989
case 2:
90-
v1 = pointa.z;
91-
v2 = pointb.z;
92-
v3 = pointc.z;
90+
v1 = pointA.z;
91+
v2 = pointB.z;
92+
v3 = pointC.z;
9393
break;
9494
default:
9595
assert false;

jme3-core/src/main/java/com/jme3/font/StringBlock.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class StringBlock implements Cloneable {
4646
private String text;
4747
private Rectangle textBox;
4848
private Align alignment = Align.Left;
49-
private VAlign valignment = VAlign.Top;
49+
private VAlign vAlignment = VAlign.Top;
5050
private float size;
5151
private ColorRGBA color = new ColorRGBA(ColorRGBA.White);
5252
private boolean kerning;
@@ -118,15 +118,15 @@ BitmapFont.Align getAlignment() {
118118
}
119119

120120
BitmapFont.VAlign getVerticalAlignment() {
121-
return valignment;
121+
return vAlignment;
122122
}
123123

124124
void setAlignment(BitmapFont.Align alignment) {
125125
this.alignment = alignment;
126126
}
127127

128128
void setVerticalAlignment(BitmapFont.VAlign alignment) {
129-
this.valignment = alignment;
129+
this.vAlignment = alignment;
130130
}
131131

132132
float getSize() {

0 commit comments

Comments
 (0)