Skip to content

Commit c535757

Browse files
authored
Merge branch 'jMonkeyEngine:master' into capdevon-BillboardControl
2 parents 45e5344 + 1f9d606 commit c535757

File tree

51 files changed

+3489
-1134
lines changed

Some content is hidden

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

51 files changed

+3489
-1134
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#! /bin/bash
2+
set -euo pipefail
3+
4+
## Upload a deployment
5+
## from the "org.jmonkeyengine" namespace in Sonatype's OSSRH staging area
6+
## to Sonatype's Central Publisher Portal
7+
## so the deployment can be tested and then published or dropped.
8+
9+
## IMPORTANT: The upload request must originate
10+
## from the IP address used to stage the deployment to the staging area!
11+
12+
# The required -p and -u flags on the command line
13+
# specify the password and username components of a "user token"
14+
# generated using the web interface at https://central.sonatype.com/account
15+
16+
while getopts p:u: flag
17+
do
18+
case "${flag}" in
19+
p) centralPassword=${OPTARG};;
20+
u) centralUsername=${OPTARG};;
21+
esac
22+
done
23+
24+
# Combine both components into a base64 "user token"
25+
# suitable for the Authorization header of a POST request:
26+
27+
token=$(printf %s:%s "${centralUsername}" "${centralPassword}" | base64)
28+
29+
# Send a POST request to upload the deployment:
30+
31+
server='ossrh-staging-api.central.sonatype.com'
32+
endpoint='/manual/upload/defaultRepository/org.jmonkeyengine'
33+
url="https://${server}${endpoint}"
34+
35+
statusCode=$(curl "${url}" \
36+
--no-progress-meter \
37+
--output postData1.txt \
38+
--write-out '%{response_code}' \
39+
--request POST \
40+
--header 'accept: */*' \
41+
--header "Authorization: Bearer ${token}" \
42+
--data '')
43+
44+
echo "Status code = ${statusCode}"
45+
echo 'Received data:'
46+
cat postData1.txt
47+
echo '[EOF]'
48+
49+
# Retry if the default repo isn't found (status=400).
50+
51+
if [ "${statusCode}" == "400" ]; then
52+
echo "Will retry after 30 seconds."
53+
sleep 30
54+
55+
statusCode2=$(curl "${url}" \
56+
--no-progress-meter \
57+
--output postData2.txt \
58+
--write-out '%{response_code}' \
59+
--request POST \
60+
--header 'accept: */*' \
61+
--header "Authorization: Bearer ${token}" \
62+
--data '')
63+
64+
echo "Status code = ${statusCode2}"
65+
echo 'Received data:'
66+
cat postData2.txt
67+
echo '[EOF]'
68+
fi

.github/workflows/main.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# >> Configure MINIO NATIVES SNAPSHOT
1717
# OBJECTS_KEY=XXXXXX
1818
# >> Configure SONATYPE RELEASE
19-
# OSSRH_PASSWORD=XXXXXX
20-
# OSSRH_USERNAME=XXXXXX
19+
# CENTRAL_PASSWORD=XXXXXX
20+
# CENTRAL_USERNAME=XXXXXX
2121
# >> Configure SIGNING
2222
# SIGNING_KEY=XXXXXX
2323
# SIGNING_PASSWORD=XXXXXX
@@ -359,16 +359,16 @@ jobs:
359359
name: android-natives
360360
path: build/native
361361

362-
- name: Rebuild the maven artifacts and deploy them to the Sonatype repository
362+
- name: Rebuild the maven artifacts and upload them to Sonatype's maven-snapshots repo
363363
run: |
364-
if [ "${{ secrets.OSSRH_PASSWORD }}" = "" ];
364+
if [ "${{ secrets.CENTRAL_PASSWORD }}" = "" ];
365365
then
366-
echo "Configure the following secrets to enable deployment to Sonatype:"
367-
echo "OSSRH_PASSWORD, OSSRH_USERNAME, SIGNING_KEY, SIGNING_PASSWORD"
366+
echo "Configure the following secrets to enable uploading to Sonatype:"
367+
echo "CENTRAL_PASSWORD, CENTRAL_USERNAME, SIGNING_KEY, SIGNING_PASSWORD"
368368
else
369369
./gradlew publishMavenPublicationToSNAPSHOTRepository \
370-
-PossrhPassword=${{ secrets.OSSRH_PASSWORD }} \
371-
-PossrhUsername=${{ secrets.OSSRH_USERNAME }} \
370+
-PcentralPassword=${{ secrets.CENTRAL_PASSWORD }} \
371+
-PcentralUsername=${{ secrets.CENTRAL_USERNAME }} \
372372
-PsigningKey='${{ secrets.SIGNING_KEY }}' \
373373
-PsigningPassword='${{ secrets.SIGNING_PASSWORD }}' \
374374
-PuseCommitHashAsVersionName=true \
@@ -384,13 +384,13 @@ jobs:
384384
if: github.event_name == 'release'
385385
steps:
386386

387-
# We need to clone everything again for uploadToMaven.sh ...
387+
# We need to clone everything again for uploadToCentral.sh ...
388388
- name: Clone the repo
389389
uses: actions/checkout@v4
390390
with:
391391
fetch-depth: 1
392392

393-
# Setup jdk 21 used for building Sonatype OSSRH artifacts
393+
# Setup jdk 21 used for building Sonatype artifacts
394394
- name: Setup the java environment
395395
uses: actions/setup-java@v4
396396
with:
@@ -416,20 +416,23 @@ jobs:
416416
name: android-natives
417417
path: build/native
418418

419-
- name: Rebuild the maven artifacts and deploy them to Sonatype OSSRH
419+
- name: Rebuild the maven artifacts and upload them to Sonatype's Central Publisher Portal
420420
run: |
421-
if [ "${{ secrets.OSSRH_PASSWORD }}" = "" ];
421+
if [ "${{ secrets.CENTRAL_PASSWORD }}" = "" ];
422422
then
423-
echo "Configure the following secrets to enable deployment to Sonatype:"
424-
echo "OSSRH_PASSWORD, OSSRH_USERNAME, SIGNING_KEY, SIGNING_PASSWORD"
423+
echo "Configure the following secrets to enable uploading to Sonatype:"
424+
echo "CENTRAL_PASSWORD, CENTRAL_USERNAME, SIGNING_KEY, SIGNING_PASSWORD"
425425
else
426-
./gradlew publishMavenPublicationToOSSRHRepository \
427-
-PossrhPassword=${{ secrets.OSSRH_PASSWORD }} \
428-
-PossrhUsername=${{ secrets.OSSRH_USERNAME }} \
429-
-PsigningKey='${{ secrets.SIGNING_KEY }}' \
430-
-PsigningPassword='${{ secrets.SIGNING_PASSWORD }}' \
431-
-PuseCommitHashAsVersionName=true \
432-
--console=plain --stacktrace
426+
./gradlew publishMavenPublicationToCentralRepository \
427+
-PcentralPassword=${{ secrets.CENTRAL_PASSWORD }} \
428+
-PcentralUsername=${{ secrets.CENTRAL_USERNAME }} \
429+
-PsigningKey='${{ secrets.SIGNING_KEY }}' \
430+
-PsigningPassword='${{ secrets.SIGNING_PASSWORD }}' \
431+
-PuseCommitHashAsVersionName=true \
432+
--console=plain --stacktrace
433+
.github/actions/tools/uploadToCentral.sh \
434+
-p '${{ secrets.CENTRAL_PASSWORD }}' \
435+
-u '${{ secrets.CENTRAL_USERNAME }}'
433436
fi
434437
435438
- name: Deploy to GitHub Releases

.github/workflows/screenshot-test-comment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,7 @@ jobs:
113113
**Note;** it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar".
114114
115115
See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information
116+
117+
Contact @richardTingle (aka richtea) for guidance if required
116118
edit-mode: replace
117119
comment-id: ${{ steps.existingCommentId.outputs.comment-id }}

common.gradle

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,27 +157,35 @@ publishing {
157157
version project.version
158158
}
159159
}
160+
160161
repositories {
161162
maven {
162163
name = 'Dist'
163164
url = gradle.rootProject.projectDir.absolutePath + '/dist/maven'
164165
}
166+
167+
// Uploading to Sonatype relies on the existence of 2 properties
168+
// (centralUsername and centralPassword)
169+
// which should be set using -P options on the command line.
170+
171+
maven {
172+
// for uploading release builds to the default repo in Sonatype's OSSRH staging area
173+
credentials {
174+
username = gradle.rootProject.hasProperty('centralUsername') ? centralUsername : 'Unknown user'
175+
password = gradle.rootProject.hasProperty('centralPassword') ? centralPassword : 'Unknown password'
176+
}
177+
name = 'Central'
178+
url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
179+
}
165180
maven {
181+
// for uploading snapshot builds to Sonatype's maven-snapshots repo
166182
credentials {
167-
username = gradle.rootProject.hasProperty('ossrhUsername') ? ossrhUsername : 'Unknown user'
168-
password = gradle.rootProject.hasProperty('ossrhPassword') ? ossrhPassword : 'Unknown password'
183+
username = gradle.rootProject.hasProperty('centralUsername') ? centralUsername : 'Unknown user'
184+
password = gradle.rootProject.hasProperty('centralPassword') ? centralPassword : 'Unknown password'
169185
}
170-
name = 'OSSRH'
171-
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2'
186+
name = 'SNAPSHOT'
187+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
172188
}
173-
maven {
174-
credentials {
175-
username = gradle.rootProject.hasProperty('ossrhUsername') ? ossrhUsername : 'Unknown user'
176-
password = gradle.rootProject.hasProperty('ossrhPassword') ? ossrhPassword : 'Unknown password'
177-
}
178-
name = 'SNAPSHOT'
179-
url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
180-
}
181189
}
182190
}
183191

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

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,71 @@
1+
/*
2+
* Copyright (c) 2009-2025 jMonkeyEngine
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are
7+
* met:
8+
*
9+
* * Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
*
12+
* * Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
132
package com.jme3.anim;
233

334
import com.jme3.anim.util.JointModelTransform;
435
import com.jme3.math.Matrix4f;
536
import com.jme3.math.Transform;
637

738
/**
8-
* This JointModelTransform implementation accumulate joints transforms in a Matrix4f to properly
9-
* support non uniform scaling in an armature hierarchy
39+
* An implementation of {@link JointModelTransform} that accumulates joint transformations
40+
* into a {@link Matrix4f}. This approach is particularly useful for correctly handling
41+
* non-uniform scaling within an armature hierarchy, as {@code Matrix4f} can represent
42+
* non-uniform scaling directly, unlike {@link Transform}, which typically handles
43+
* uniform scaling.
44+
* <p>
45+
* This class maintains a single {@link Matrix4f} to represent the accumulated
46+
* model-space transform of the joint it's associated with.
1047
*/
1148
public class MatrixJointModelTransform implements JointModelTransform {
1249

13-
final private Matrix4f modelTransformMatrix = new Matrix4f();
14-
final private Transform modelTransform = new Transform();
50+
/**
51+
* The model-space transform of the joint represented as a Matrix4f.
52+
* This matrix accumulates the local transform of the joint and the model transform
53+
* of its parent.
54+
*/
55+
private final Matrix4f modelTransformMatrix = new Matrix4f();
56+
/**
57+
* A temporary Transform instance used for converting the modelTransformMatrix
58+
* to a Transform object when {@link #getModelTransform()} is called.
59+
*/
60+
private final Transform modelTransform = new Transform();
1561

1662
@Override
1763
public void updateModelTransform(Transform localTransform, Joint parent) {
1864
localTransform.toTransformMatrix(modelTransformMatrix);
1965
if (parent != null) {
20-
((MatrixJointModelTransform) parent.getJointModelTransform()).getModelTransformMatrix().mult(modelTransformMatrix, modelTransformMatrix);
66+
MatrixJointModelTransform transform = (MatrixJointModelTransform) parent.getJointModelTransform();
67+
transform.getModelTransformMatrix().mult(modelTransformMatrix, modelTransformMatrix);
2168
}
22-
2369
}
2470

2571
@Override
@@ -31,7 +77,8 @@ public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindM
3177
public void applyBindPose(Transform localTransform, Matrix4f inverseModelBindMatrix, Joint parent) {
3278
modelTransformMatrix.set(inverseModelBindMatrix).invertLocal(); // model transform = model bind
3379
if (parent != null) {
34-
((MatrixJointModelTransform) parent.getJointModelTransform()).getModelTransformMatrix().invert().mult(modelTransformMatrix, modelTransformMatrix);
80+
MatrixJointModelTransform transform = (MatrixJointModelTransform) parent.getJointModelTransform();
81+
transform.getModelTransformMatrix().invert().mult(modelTransformMatrix, modelTransformMatrix);
3582
}
3683
localTransform.fromTransformMatrix(modelTransformMatrix);
3784
}

0 commit comments

Comments
 (0)