Skip to content

Commit 917a240

Browse files
authored
Merge branch 'jMonkeyEngine:master' into master
2 parents b082ac2 + 3d979df commit 917a240

File tree

304 files changed

+4877
-3712
lines changed

Some content is hidden

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

304 files changed

+4877
-3712
lines changed

.vscode/settings.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"java.configuration.updateBuildConfiguration": "automatic",
33
"java.refactor.renameFromFileExplorer": "prompt",
4-
"java.format.settings.url": "./.vscode/JME_style.xml"
5-
}
4+
"java.format.settings.url": "./.vscode/JME_style.xml",
5+
"editor.formatOnPaste": true,
6+
"editor.formatOnType": true
7+
}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jMonkeyEngine
44
[![Build Status](https://github.com/jMonkeyEngine/jmonkeyengine/workflows/Build%20jMonkeyEngine/badge.svg)](https://github.com/jMonkeyEngine/jmonkeyengine/actions)
55

66
jMonkeyEngine is a 3-D game engine for adventurous Java developers. It’s open-source, cross-platform, and cutting-edge.
7-
v3.4.1 is the latest stable version of the Engine.
7+
v3.5.1 is the latest stable version of the Engine.
88
v3.3.2 is the latest stable version of the jMonkeyEngine SDK.
99

1010
The engine is used by several commercial game studios and computer-science courses. Here's a taste:
@@ -53,5 +53,5 @@ Read our [contribution guide](https://github.com/jMonkeyEngine/jmonkeyengine/blo
5353

5454
### License
5555

56-
New BSD (3-clause) License. In other words, you do whatever makes you happy!
56+
[New BSD (3-clause) License](https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/LICENSE)
5757

common.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tasks.withType(JavaCompile) { // compile-time options:
2323
}
2424

2525
ext {
26-
lwjgl3Version = '3.3.0' // used in both the jme3-lwjgl3 and jme3-vr build scripts
26+
lwjgl3Version = '3.3.1' // used in both the jme3-lwjgl3 and jme3-vr build scripts
2727
}
2828

2929
repositories {
@@ -37,7 +37,7 @@ dependencies {
3737
// Adding dependencies here will add the dependencies to each subproject.
3838
testImplementation 'junit:junit:4.13.2'
3939
testImplementation 'org.mockito:mockito-core:3.12.4'
40-
testImplementation 'org.codehaus.groovy:groovy-test:3.0.9'
40+
testImplementation 'org.codehaus.groovy:groovy-test:3.0.10'
4141
}
4242

4343

jme3-android/src/main/java/com/jme3/app/AndroidHarness.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public Object onRetainNonConfigurationInstance() {
190190
}
191191

192192
@Override
193+
@SuppressWarnings("unchecked")
193194
public void onCreate(Bundle savedInstanceState) {
194195
initializeLogHandler();
195196

@@ -240,7 +241,7 @@ public void onCreate(Bundle savedInstanceState) {
240241
try {
241242
if (app == null) {
242243
Class clazz = Class.forName(appClass);
243-
app = (LegacyApplication)clazz.newInstance();
244+
app = (LegacyApplication) clazz.getDeclaredConstructor().newInstance();
244245
}
245246

246247
app.setSettings(settings);
@@ -494,6 +495,11 @@ public void reshape(int width, int height) {
494495
app.reshape(width, height);
495496
}
496497

498+
@Override
499+
public void rescale(float x, float y) {
500+
app.rescale(x, y);
501+
}
502+
497503
@Override
498504
public void update() {
499505
app.update();

jme3-android/src/main/java/com/jme3/app/AndroidHarnessFragment.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ public void onAttach(Activity activity) {
232232
* @param savedInstanceState the saved instance state
233233
*/
234234
@Override
235+
@SuppressWarnings("unchecked")
235236
public void onCreate(Bundle savedInstanceState) {
236237
initializeLogHandler();
237238
logger.fine("onCreate");
@@ -258,7 +259,7 @@ public void onCreate(Bundle savedInstanceState) {
258259
try {
259260
if (app == null) {
260261
Class clazz = Class.forName(appClass);
261-
app = (LegacyApplication)clazz.newInstance();
262+
app = (LegacyApplication) clazz.getDeclaredConstructor().newInstance();
262263
}
263264

264265
app.setSettings(settings);
@@ -571,6 +572,11 @@ public void reshape(int width, int height) {
571572
app.reshape(width, height);
572573
}
573574

575+
@Override
576+
public void rescale(float x, float y) {
577+
app.rescale(x, y);
578+
}
579+
574580
@Override
575581
public void update() {
576582
app.update();

jme3-android/src/main/java/com/jme3/app/jmeSurfaceView/JmeSurfaceView.java

+11
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,17 @@ public void reshape(int width, int height) {
395395
jmeSurfaceViewLogger.log(Level.INFO, "Requested reshaping from the system listener");
396396
}
397397

398+
399+
@Override
400+
public void rescale(float x, float y) {
401+
if (legacyApplication == null) {
402+
return;
403+
}
404+
legacyApplication.rescale(x, y);
405+
jmeSurfaceViewLogger.log(Level.INFO, "Requested rescaling from the system listener");
406+
}
407+
408+
398409
@Override
399410
public void update() {
400411
/*Invoking can be delayed by delaying the draw of GlSurfaceView component on the screen*/

jme3-android/src/main/java/com/jme3/input/android/AndroidSensorJoyInput.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private boolean remapCoordinates(float[] inR, float[] outR) {
282282
* Surface.ROTATION_270 = device in rotated 270deg counterclockwise
283283
*
284284
* When the Manifest locks the orientation, this value will not change during
285-
* gametime, but if the orientation of the screen is based off the sensor,
285+
* game time, but if the orientation of the screen is based off the sensor,
286286
* this value will change as the device is rotated.
287287
* @return Current device rotation amount
288288
*/

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ public void glRenderbufferStorageMultisampleEXT(int target, int samples, int int
580580
}
581581

582582
@Override
583-
public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) {
584-
GLES31.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
583+
public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedSampleLocations) {
584+
GLES31.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedSampleLocations);
585585
}
586586

587587
@Override

jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,10 @@ protected void scanSpatial(Spatial model) {
673673
* @param model the spatial with the model's SkeletonControl (not null)
674674
* @param bone the bone to be linked (not null)
675675
* @param parent the body linked to the parent bone (not null)
676-
* @param reccount depth of the recursion (≥1)
676+
* @param recursionCount depth of the recursion (≥1)
677677
* @param pointsMap (not null)
678678
*/
679-
protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int reccount, Map<Integer, List<Float>> pointsMap) {
679+
protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int recursionCount, Map<Integer, List<Float>> pointsMap) {
680680
PhysicsRigidBody parentShape = parent;
681681
if (boneList.contains(bone.getName())) {
682682

@@ -693,10 +693,10 @@ protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent,
693693
shape = RagdollUtils.makeShapeFromVerticeWeights(model, RagdollUtils.getBoneIndices(link.bone, skeleton, boneList), initScale, link.bone.getModelSpacePosition(), weightThreshold);
694694
}
695695

696-
PhysicsRigidBody shapeNode = new PhysicsRigidBody(shape, rootMass / reccount);
696+
PhysicsRigidBody shapeNode = new PhysicsRigidBody(shape, rootMass / recursionCount);
697697

698698
shapeNode.setKinematic(mode == Mode.Kinematic);
699-
totalMass += rootMass / reccount;
699+
totalMass += rootMass / recursionCount;
700700

701701
link.rigidBody = shapeNode;
702702
link.initalWorldRotation = bone.getModelSpaceRotation().clone();
@@ -721,7 +721,7 @@ protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent,
721721

722722
for (Iterator<Bone> it = bone.getChildren().iterator(); it.hasNext();) {
723723
Bone childBone = it.next();
724-
boneRecursion(model, childBone, parentShape, reccount + 1, pointsMap);
724+
boneRecursion(model, childBone, parentShape, recursionCount + 1, pointsMap);
725725
}
726726
}
727727

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

+28-29
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@
4848
/**
4949
* AnimComposer is a Spatial control that allows manipulation of
5050
* {@link Armature armature} (skeletal) animation.
51-
*
51+
*
5252
* @author Nehon
5353
*/
5454
public class AnimComposer extends AbstractControl {
55-
5655
/**
5756
* The name of the default layer.
5857
*/
@@ -72,7 +71,7 @@ public AnimComposer() {
7271

7372
/**
7473
* Tells if an animation is contained in the list of animations.
75-
*
74+
*
7675
* @param name The name of the animation.
7776
* @return true, if the named animation is in the list of animations.
7877
*/
@@ -117,17 +116,17 @@ public void removeAnimClip(AnimClip anim) {
117116

118117
/**
119118
* Run an action on the default layer.
120-
*
119+
*
121120
* @param name The name of the action to run.
122121
* @return The action corresponding to the given name.
123122
*/
124123
public Action setCurrentAction(String name) {
125124
return setCurrentAction(name, DEFAULT_LAYER);
126125
}
127-
126+
128127
/**
129128
* Run an action on specified layer.
130-
*
129+
*
131130
* @param actionName The name of the action to run.
132131
* @param layerName The layer on which action should run.
133132
* @return The action corresponding to the given name.
@@ -139,19 +138,19 @@ public Action setCurrentAction(String actionName, String layerName) {
139138

140139
return currentAction;
141140
}
142-
141+
143142
/**
144143
* Return the current action on the default layer.
145-
*
146-
* @return The action corresponding to the given name.
144+
*
145+
* @return The action corresponding to the given name.
147146
*/
148147
public Action getCurrentAction() {
149148
return getCurrentAction(DEFAULT_LAYER);
150149
}
151-
150+
152151
/**
153152
* Return current action on specified layer.
154-
*
153+
*
155154
* @param layerName The layer on which action should run.
156155
* @return The action corresponding to the given name.
157156
*/
@@ -161,14 +160,14 @@ public Action getCurrentAction(String layerName) {
161160

162161
return result;
163162
}
164-
163+
165164
/**
166165
* Remove current action on default layer.
167166
*/
168167
public void removeCurrentAction() {
169168
removeCurrentAction(DEFAULT_LAYER);
170169
}
171-
170+
172171
/**
173172
* Remove current action on specified layer.
174173
*
@@ -178,19 +177,19 @@ public void removeCurrentAction(String layerName) {
178177
AnimLayer l = getLayer(layerName);
179178
l.setCurrentAction(null);
180179
}
181-
180+
182181
/**
183182
* Returns current time of the default layer.
184-
*
183+
*
185184
* @return The current time.
186185
*/
187186
public double getTime() {
188187
return getTime(DEFAULT_LAYER);
189188
}
190-
189+
191190
/**
192191
* Returns current time of the specified layer.
193-
*
192+
*
194193
* @param layerName The layer from which to get the time.
195194
* @return the time (in seconds)
196195
*/
@@ -200,7 +199,7 @@ public double getTime(String layerName) {
200199

201200
return result;
202201
}
203-
202+
204203
/**
205204
* Sets current time on the default layer.
206205
*
@@ -226,7 +225,7 @@ public void setTime(String layerName, double time) {
226225
}
227226

228227
/**
229-
*
228+
*
230229
* @param name The name of the action to return.
231230
* @return The action registered with specified name. It will make a new action if there isn't any.
232231
* @see #makeAction(java.lang.String)
@@ -239,29 +238,29 @@ public Action action(String name) {
239238
}
240239
return action;
241240
}
242-
241+
243242
/**
244-
*
243+
*
245244
* @param name The name of the action to return.
246245
* @return The action registered with specified name or null if nothing is registered.
247246
*/
248-
public Action getAction(String name){
247+
public Action getAction(String name) {
249248
return actions.get(name);
250249
}
251-
250+
252251
/**
253252
* Register given action with specified name.
254-
*
253+
*
255254
* @param name The name of the action.
256255
* @param action The action to add.
257256
*/
258-
public void addAction(String name, Action action){
257+
public void addAction(String name, Action action) {
259258
actions.put(name, action);
260259
}
261260

262261
/**
263262
* Create a new ClipAction with specified clip name.
264-
*
263+
*
265264
* @param name The name of the clip.
266265
* @return a new action
267266
* @throws IllegalArgumentException if clip with specified name not found.
@@ -275,17 +274,17 @@ public Action makeAction(String name) {
275274
action = new ClipAction(clip);
276275
return action;
277276
}
278-
277+
279278
/**
280279
* Tells if an action is contained in the list of actions.
281-
*
280+
*
282281
* @param name The name of the action.
283282
* @return true, if the named action is in the list of actions.
284283
*/
285284
public boolean hasAction(String name) {
286285
return actions.containsKey(name);
287286
}
288-
287+
289288
/**
290289
* Remove specified action.
291290
*

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
import com.jme3.math.Matrix4f;
3838
import com.jme3.util.clone.Cloner;
3939
import com.jme3.util.clone.JmeCloneable;
40-
4140
import java.io.IOException;
41+
import java.lang.reflect.InvocationTargetException;
4242
import java.util.*;
4343

4444
/**
@@ -130,8 +130,10 @@ public void setModelTransformClass(Class<? extends JointModelTransform> modelTra
130130

131131
private void instantiateJointModelTransform(Joint joint) {
132132
try {
133-
joint.setJointModelTransform(modelTransformClass.newInstance());
134-
} catch (InstantiationException | IllegalAccessException e) {
133+
joint.setJointModelTransform(modelTransformClass.getDeclaredConstructor().newInstance());
134+
} catch (InstantiationException | IllegalAccessException
135+
| IllegalArgumentException | InvocationTargetException
136+
| NoSuchMethodException | SecurityException e) {
135137
throw new IllegalArgumentException(e);
136138
}
137139
}

0 commit comments

Comments
 (0)