repo_name
stringclasses
5 values
pr_number
int64
1.52k
15.5k
pr_title
stringlengths
8
143
pr_description
stringlengths
0
10.2k
author
stringlengths
3
18
date_created
timestamp[ns, tz=UTC]
date_merged
timestamp[ns, tz=UTC]
previous_commit
stringlengths
40
40
pr_commit
stringlengths
40
40
query
stringlengths
11
10.2k
filepath
stringlengths
6
220
before_content
stringlengths
0
597M
after_content
stringlengths
0
597M
label
int64
-1
1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-box2d/gdx-box2d/gradle.properties
POM_NAME=libGDX Box2D
POM_NAME=libGDX Box2D
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backend-lwjgl3/gradle.properties
POM_NAME=libGDX LWJGL 3 Backend
POM_NAME=libGDX LWJGL 3 Backend
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backend-lwjgl3/build.gradle
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ if (JavaVersion.current().isJava9Compatible()) { compileJava { options.release = versions.javaLwjgl3 } } sourceCompatibility = versions.javaLwjgl3 targetCompatibility = versions.javaLwjgl3 dependencies { api libraries.lwjgl3 api gdxnatives.desktop }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ if (JavaVersion.current().isJava9Compatible()) { compileJava { options.release = versions.javaLwjgl3 } } sourceCompatibility = versions.javaLwjgl3 targetCompatibility = versions.javaLwjgl3 dependencies { api libraries.lwjgl3 api gdxnatives.desktop }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests-android/project.properties
# This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! # # This file must be checked in Version Control Systems. # # To customize properties used by the Ant build system use, # "ant.properties", and override values to adapt the script to your # project structure. # Indicates whether an apk should be generated for each density. split.density=false # Project target. target=android-24
# This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! # # This file must be checked in Version Control Systems. # # To customize properties used by the Ant build system use, # "ant.properties", and override values to adapt the script to your # project structure. # Indicates whether an apk should be generated for each density. split.density=false # Project target. target=android-24
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-freetype/build.gradle
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ dependencies { api project(":gdx") } apply plugin: "com.badlogicgames.gdx.gdx-jnigen" jnigen { sharedLibName = "gdx-freetype" all { headerDirs = ["freetype/include"] cIncludes = [ // BASE "freetype/src/base/ftsystem.c", "freetype/src/base/ftinit.c", "freetype/src/base/ftdebug.c", "freetype/src/base/ftbase.c", "freetype/src/base/ftbbox.c", "freetype/src/base/ftglyph.c", "freetype/src/base/ftbdf.c", "freetype/src/base/ftbitmap.c", "freetype/src/base/ftcid.c", "freetype/src/base/ftfstype.c", "freetype/src/base/ftgasp.c", "freetype/src/base/ftgxval.c", "freetype/src/base/ftmm.c", "freetype/src/base/ftotval.c", "freetype/src/base/ftpatent.c", "freetype/src/base/ftpfr.c", "freetype/src/base/ftstroke.c", "freetype/src/base/ftsynth.c", "freetype/src/base/fttype1.c", "freetype/src/base/ftwinfnt.c", "freetype/src/base/ftxf86.c", // "freetype/src/base/ftmac.c", // DRIVERS "freetype/src/bdf/bdf.c", "freetype/src/cff/cff.c", "freetype/src/cid/type1cid.c", "freetype/src/pcf/pcf.c", "freetype/src/pfr/pfr.c", "freetype/src/sdf/sdf.c", "freetype/src/sfnt/sfnt.c", "freetype/src/truetype/truetype.c", "freetype/src/type1/type1.c", "freetype/src/type42/type42.c", "freetype/src/winfonts/winfnt.c", // RASTERIZERS "freetype/src/raster/raster.c", "freetype/src/smooth/smooth.c", // AUX "freetype/src/autofit/autofit.c", "freetype/src/cache/ftcache.c", "freetype/src/gzip/ftgzip.c", "freetype/src/lzw/ftlzw.c", "freetype/src/bzip2/ftbzip2.c", "freetype/src/gxvalid/gxvalid.c", "freetype/src/otvalid/otvalid.c", "freetype/src/psaux/psaux.c", "freetype/src/pshinter/pshinter.c", "freetype/src/psnames/psnames.c" ] cppExcludes = ["freetype/subprojects/"] cFlags += " -DFT2_BUILD_LIBRARY " cFlags += System.getenv("CC_FLAGS") ?: "" cppFlags += " -DFT2_BUILD_LIBRARY " cppFlags += System.getenv("CPP_FLAGS") ?: "" } add(Windows, x32) add(Windows, x64) add(Linux, x64) add(Linux, x32, ARM) add(Linux, x64, ARM) add(MacOsX, x64) { linkerFlags += " -framework CoreServices -framework Carbon" } add(MacOsX, x64, ARM) { linkerFlags += " -framework CoreServices -framework Carbon" } add(Android) add(IOS) }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ dependencies { api project(":gdx") } apply plugin: "com.badlogicgames.gdx.gdx-jnigen" jnigen { sharedLibName = "gdx-freetype" all { headerDirs = ["freetype/include"] cIncludes = [ // BASE "freetype/src/base/ftsystem.c", "freetype/src/base/ftinit.c", "freetype/src/base/ftdebug.c", "freetype/src/base/ftbase.c", "freetype/src/base/ftbbox.c", "freetype/src/base/ftglyph.c", "freetype/src/base/ftbdf.c", "freetype/src/base/ftbitmap.c", "freetype/src/base/ftcid.c", "freetype/src/base/ftfstype.c", "freetype/src/base/ftgasp.c", "freetype/src/base/ftgxval.c", "freetype/src/base/ftmm.c", "freetype/src/base/ftotval.c", "freetype/src/base/ftpatent.c", "freetype/src/base/ftpfr.c", "freetype/src/base/ftstroke.c", "freetype/src/base/ftsynth.c", "freetype/src/base/fttype1.c", "freetype/src/base/ftwinfnt.c", "freetype/src/base/ftxf86.c", // "freetype/src/base/ftmac.c", // DRIVERS "freetype/src/bdf/bdf.c", "freetype/src/cff/cff.c", "freetype/src/cid/type1cid.c", "freetype/src/pcf/pcf.c", "freetype/src/pfr/pfr.c", "freetype/src/sdf/sdf.c", "freetype/src/sfnt/sfnt.c", "freetype/src/truetype/truetype.c", "freetype/src/type1/type1.c", "freetype/src/type42/type42.c", "freetype/src/winfonts/winfnt.c", // RASTERIZERS "freetype/src/raster/raster.c", "freetype/src/smooth/smooth.c", // AUX "freetype/src/autofit/autofit.c", "freetype/src/cache/ftcache.c", "freetype/src/gzip/ftgzip.c", "freetype/src/lzw/ftlzw.c", "freetype/src/bzip2/ftbzip2.c", "freetype/src/gxvalid/gxvalid.c", "freetype/src/otvalid/otvalid.c", "freetype/src/psaux/psaux.c", "freetype/src/pshinter/pshinter.c", "freetype/src/psnames/psnames.c" ] cppExcludes = ["freetype/subprojects/"] cFlags += " -DFT2_BUILD_LIBRARY " cFlags += System.getenv("CC_FLAGS") ?: "" cppFlags += " -DFT2_BUILD_LIBRARY " cppFlags += System.getenv("CPP_FLAGS") ?: "" } add(Windows, x32) add(Windows, x64) add(Linux, x64) add(Linux, x32, ARM) add(Linux, x64, ARM) add(MacOsX, x64) { linkerFlags += " -framework CoreServices -framework Carbon" } add(MacOsX, x64, ARM) { linkerFlags += " -framework CoreServices -framework Carbon" } add(Android) add(IOS) }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./.github/workflows/gradle-wrapper-validation.yml
name: "Validate Gradle Wrapper" on: [push, pull_request] jobs: validation: name: "Validation" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
name: "Validate Gradle Wrapper" on: [push, pull_request] jobs: validation: name: "Validation" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/build.gradle
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ configure(subprojects - project(":backends:gdx-backend-android")) { apply plugin: "java" if (JavaVersion.current().isJava9Compatible()) { compileJava { options.release = versions.java } } sourceCompatibility = versions.java targetCompatibility = versions.java sourceSets.main.java.srcDirs = ["src"] sourceSets.main.resources.srcDirs = ["res"] dependencies { api project(":gdx") } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ configure(subprojects - project(":backends:gdx-backend-android")) { apply plugin: "java" if (JavaVersion.current().isJava9Compatible()) { compileJava { options.release = versions.java } } sourceCompatibility = versions.java targetCompatibility = versions.java sourceSets.main.java.srcDirs = ["src"] sourceSets.main.resources.srcDirs = ["res"] dependencies { api project(":gdx") } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backend-robovm/build.gradle
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ sourceSets { main { resources { srcDir 'res' } } } dependencies { api libraries.robovm } processResources.duplicatesStrategy = DuplicatesStrategy.EXCLUDE sourcesJar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ sourceSets { main { resources { srcDir 'res' } } } dependencies { api libraries.robovm } processResources.duplicatesStrategy = DuplicatesStrategy.EXCLUDE sourcesJar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./publish.gradle
configure([ project(":gdx"), project(":backends:gdx-backend-android"), project(":backends:gdx-backend-headless"), project(":backends:gdx-backend-lwjgl"), project(":backends:gdx-backend-lwjgl3"), project(":backends:gdx-backend-robovm"), project(":backends:gdx-backend-robovm-metalangle"), project(":backends:gdx-backend-gwt"), project(":extensions:gdx-box2d-parent"), project(":extensions:gdx-box2d-parent:gdx-box2d"), project(":extensions:gdx-box2d-parent:gdx-box2d-gwt"), project(":extensions:gdx-bullet"), project(":extensions:gdx-freetype"), project(":extensions:gdx-lwjgl3-angle"), project(":extensions:gdx-lwjgl3-glfw-awt-macos"), project(":extensions:gdx-tools") ]) { apply plugin: 'maven-publish' apply plugin: 'signing' afterEvaluate { project -> //Workaround android not having components populated yet. afterEvaluate { publishing { publications { mavenJava(MavenPublication) { //Most normal java projects if(components.findByName("java") != null) from components.java //Android if(components.findByName("release") != null) { from components.release } versionMapping { usage('java-api') { fromResolutionOf('runtimeClasspath') } usage('java-runtime') { fromResolutionResult() } } pom { name = POM_NAME if(!POM_DESCRIPTION.isEmpty()) description = POM_DESCRIPTION url = POM_URL licenses { license { name = POM_LICENCE_NAME url = POM_LICENCE_URL distribution = POM_LICENCE_DIST } } developers { developer { id = "libGDX Developers" url = "https://github.com/libgdx/libgdx/graphs/contributors" } } scm { connection = POM_SCM_CONNECTION developerConnection = POM_SCM_DEV_CONNECTION url = POM_SCM_URL } } } //Libgdx natives all follow the "$name-platform" artifact structure. if(project.tasks.findByName('jnigen')) { mavenPlatform(MavenPublication) { artifactId = artifactId + "-platform" if(project.tasks.findByName('jnigenJarNativesDesktop')) artifact jnigenJarNativesDesktop { } [ 'arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86' ].each { id -> if(project.tasks.findByName("jnigenJarNativesAndroid${id}")) artifact "jnigenJarNativesAndroid${id}" { } } if(project.tasks.findByName('jnigenJarNativesIOS')) artifact jnigenJarNativesIOS { } pom { name = POM_NAME + " Native Libraries" if(!POM_DESCRIPTION.isEmpty()) description = POM_DESCRIPTION url = POM_URL licenses { license { name = POM_LICENCE_NAME url = POM_LICENCE_URL distribution = POM_LICENCE_DIST } } developers { developer { id = "libGDX Developers" url = "https://github.com/libgdx/libgdx/graphs/contributors" } } scm { connection = POM_SCM_CONNECTION developerConnection = POM_SCM_DEV_CONNECTION url = POM_SCM_URL } } } } } repositories { maven { url = version.endsWith('SNAPSHOT') ? getSnapshotRepositoryUrl() : getReleaseRepositoryUrl() if (getRepositoryUsername() || getRepositoryPassword()) { credentials { username = getRepositoryUsername() password = getRepositoryPassword() } } } } } signing { useGpgCmd() sign publishing.publications.mavenJava if(project.tasks.findByName('jnigen')) sign publishing.publications.mavenPlatform } //Simply using "required" in signing block doesn't work because taskGraph isn't ready yet. gradle.taskGraph.whenReady { tasks.withType(Sign) { onlyIf { isReleaseBuild() } } } } } }
configure([ project(":gdx"), project(":backends:gdx-backend-android"), project(":backends:gdx-backend-headless"), project(":backends:gdx-backend-lwjgl"), project(":backends:gdx-backend-lwjgl3"), project(":backends:gdx-backend-robovm"), project(":backends:gdx-backend-robovm-metalangle"), project(":backends:gdx-backend-gwt"), project(":extensions:gdx-box2d-parent"), project(":extensions:gdx-box2d-parent:gdx-box2d"), project(":extensions:gdx-box2d-parent:gdx-box2d-gwt"), project(":extensions:gdx-bullet"), project(":extensions:gdx-freetype"), project(":extensions:gdx-lwjgl3-angle"), project(":extensions:gdx-lwjgl3-glfw-awt-macos"), project(":extensions:gdx-tools") ]) { apply plugin: 'maven-publish' apply plugin: 'signing' afterEvaluate { project -> //Workaround android not having components populated yet. afterEvaluate { publishing { publications { mavenJava(MavenPublication) { //Most normal java projects if(components.findByName("java") != null) from components.java //Android if(components.findByName("release") != null) { from components.release } versionMapping { usage('java-api') { fromResolutionOf('runtimeClasspath') } usage('java-runtime') { fromResolutionResult() } } pom { name = POM_NAME if(!POM_DESCRIPTION.isEmpty()) description = POM_DESCRIPTION url = POM_URL licenses { license { name = POM_LICENCE_NAME url = POM_LICENCE_URL distribution = POM_LICENCE_DIST } } developers { developer { id = "libGDX Developers" url = "https://github.com/libgdx/libgdx/graphs/contributors" } } scm { connection = POM_SCM_CONNECTION developerConnection = POM_SCM_DEV_CONNECTION url = POM_SCM_URL } } } //Libgdx natives all follow the "$name-platform" artifact structure. if(project.tasks.findByName('jnigen')) { mavenPlatform(MavenPublication) { artifactId = artifactId + "-platform" if(project.tasks.findByName('jnigenJarNativesDesktop')) artifact jnigenJarNativesDesktop { } [ 'arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86' ].each { id -> if(project.tasks.findByName("jnigenJarNativesAndroid${id}")) artifact "jnigenJarNativesAndroid${id}" { } } if(project.tasks.findByName('jnigenJarNativesIOS')) artifact jnigenJarNativesIOS { } pom { name = POM_NAME + " Native Libraries" if(!POM_DESCRIPTION.isEmpty()) description = POM_DESCRIPTION url = POM_URL licenses { license { name = POM_LICENCE_NAME url = POM_LICENCE_URL distribution = POM_LICENCE_DIST } } developers { developer { id = "libGDX Developers" url = "https://github.com/libgdx/libgdx/graphs/contributors" } } scm { connection = POM_SCM_CONNECTION developerConnection = POM_SCM_DEV_CONNECTION url = POM_SCM_URL } } } } } repositories { maven { url = version.endsWith('SNAPSHOT') ? getSnapshotRepositoryUrl() : getReleaseRepositoryUrl() if (getRepositoryUsername() || getRepositoryPassword()) { credentials { username = getRepositoryUsername() password = getRepositoryPassword() } } } } } signing { useGpgCmd() sign publishing.publications.mavenJava if(project.tasks.findByName('jnigen')) sign publishing.publications.mavenPlatform } //Simply using "required" in signing block doesn't work because taskGraph isn't ready yet. gradle.taskGraph.whenReady { tasks.withType(Sign) { onlyIf { isReleaseBuild() } } } } } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests-android/assets/data/i18n/message2.properties
msg=Default test message # Notice that single quotes aren't escaped anymore rootMsg=I'm from bundle's root # Notice that the same argument (index 2) can safely occur multiple times. # Also the first left curly bracket is escaped. msgWithArgs={{ string={0} - PI={1} - today={2} - time={2} }
msg=Default test message # Notice that single quotes aren't escaped anymore rootMsg=I'm from bundle's root # Notice that the same argument (index 2) can safely occur multiple times. # Also the first left curly bracket is escaped. msgWithArgs={{ string={0} - PI={1} - today={2} - time={2} }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./.github/FUNDING.yml
patreon: libgdx custom: https://libgdx.com/funding/
patreon: libgdx custom: https://libgdx.com/funding/
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-setup/res/com/badlogic/gdx/setup/resources/gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backends-gwt/gradle.properties
POM_NAME=libGDX GWT Backend
POM_NAME=libGDX GWT Backend
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests-android/assets/data/i18n/message2_en.properties
msg=English test message
msg=English test message
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-setup/res/com/badlogic/gdx/setup/resources/lwjgl2/build.gradle
sourceCompatibility = 1.7 sourceSets.main.java.srcDirs = [ "src/" ] sourceSets.main.resources.srcDirs = ["../%ASSET_PATH%"] project.ext.mainClassName = "%PACKAGE%.DesktopLauncher" project.ext.assetsDir = new File("../%ASSET_PATH%") tasks.register('run', JavaExec) { dependsOn classes mainClass = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir ignoreExitValue = true } tasks.register('debug', JavaExec) { dependsOn classes mainClass = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir ignoreExitValue = true debug = true } tasks.register('dist', Jar) { manifest { attributes 'Main-Class': project.mainClassName } dependsOn configurations.runtimeClasspath from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } with jar } dist.dependsOn classes eclipse.project.name = appName + "-legacy_desktop"
sourceCompatibility = 1.7 sourceSets.main.java.srcDirs = [ "src/" ] sourceSets.main.resources.srcDirs = ["../%ASSET_PATH%"] project.ext.mainClassName = "%PACKAGE%.DesktopLauncher" project.ext.assetsDir = new File("../%ASSET_PATH%") tasks.register('run', JavaExec) { dependsOn classes mainClass = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir ignoreExitValue = true } tasks.register('debug', JavaExec) { dependsOn classes mainClass = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir ignoreExitValue = true debug = true } tasks.register('dist', Jar) { manifest { attributes 'Main-Class': project.mainClassName } dependsOn configurations.runtimeClasspath from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } with jar } dist.dependsOn classes eclipse.project.name = appName + "-legacy_desktop"
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/lang/SecurityException.java
/* Copyright (c) 2008, Avian Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. There is NO WARRANTY for this software. See license.txt for details. */ package java.lang; public class SecurityException extends RuntimeException { public SecurityException (String message, Throwable cause) { super(message, cause); } public SecurityException (String message) { this(message, null); } public SecurityException (Throwable cause) { this(null, cause); } public SecurityException () { this(null, null); } }
/* Copyright (c) 2008, Avian Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. There is NO WARRANTY for this software. See license.txt for details. */ package java.lang; public class SecurityException extends RuntimeException { public SecurityException (String message, Throwable cause) { super(message, cause); } public SecurityException (String message) { this(message, null); } public SecurityException (Throwable cause) { this(null, cause); } public SecurityException () { this(null, null); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests-android/assets/data/g3d/checkboard.png
PNG  IHDR s;tEXtSoftwareAdobe ImageReadyqe<"iTXtXML:com.adobe.xmp<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27 "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmp:CreatorTool="Adobe Photoshop CS6 (Windows)" xmpMM:InstanceID="xmp.iid:458DB6AF56D711E291FBFD6D963DF621" xmpMM:DocumentID="xmp.did:458DB6B056D711E291FBFD6D963DF621"> <xmpMM:DerivedFrom stRef:instanceID="xmp.iid:458DB6AD56D711E291FBFD6D963DF621" stRef:documentID="xmp.did:458DB6AE56D711E291FBFD6D963DF621"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="r"?>C"IDATxڬQn1Dg-N 8?l8vs$ڝ=vۗo_q^/ˏO_~~ۇ~ͩ>5ۣg~ڷk{Lq拍}v։- X^ͺZjgǿMx]wߺ qL;}o~S15q3@-(5YPoQ́Ga֟F#.޼^w{/kU/zu;S}N<7^RaV 9q!Mې۟ۏqngzg+_'8U8&T0x.ڠ)ҡpt:Δp.p[q@5ohW}Xge*F~E)zHmT R ۟[ eN 򻊷p0CgVɌY582\t|Hج 0sLX1@<!>(zwj*oR!13*J;nWܙ 쬮!-Nyl6:\X(՚Kg3!K5l $?#ߌ'`/Z3/RP?qHgJB,(BR\]9=OnTz1+/y<^>c<zath\?9&g| tsh-/o8cͺrUֹL5XmTS8iB_` T= ey ā`~TfZ esap1jzG49ͬ^dq/e?Ǵt|N:%#AgoKΐJ5Qy`iO >2'=Qh)S^"&9TԚn_/S~ _j"ymR@$<SMM5Z6tvW1XZh n$.[Av8py9"WN|*g)ޥև̘'KMeyB|8n3HnaFv!:Nl$?oC:#PO]nj}:~f~htf:'=<&=|0֊ŊmyrZIb bD[Əǿ?hMj; \-IE=jQn[HSo?I>NzV_MvzdRa%јnIZSaT>_?ףm~0[nÏ9:?8 Ft{Vf'dvF/|:@pgjbVh7N O$]f%`“Z怓)s%u^_ Zh^='o jS3V ^Y[)9zZoK}*7I=o3 ];_s%`ߛ[GVE?LiXЁA~q2/YAGk|< LHvR-f#i(oKgByvr xAVھ(^\M~y(̸W8G ns?(㽯[_V21#:5Q <+-vtvV)O 跴Bx$ *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:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmp:CreatorTool="Adobe Photoshop CS6 (Windows)" xmpMM:InstanceID="xmp.iid:458DB6AF56D711E291FBFD6D963DF621" xmpMM:DocumentID="xmp.did:458DB6B056D711E291FBFD6D963DF621"> <xmpMM:DerivedFrom stRef:instanceID="xmp.iid:458DB6AD56D711E291FBFD6D963DF621" stRef:documentID="xmp.did:458DB6AE56D711E291FBFD6D963DF621"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="r"?>C"IDATxڬQn1Dg-N 8?l8vs$ڝ=vۗo_q^/ˏO_~~ۇ~ͩ>5ۣg~ڷk{Lq拍}v։- X^ͺZjgǿMx]wߺ qL;}o~S15q3@-(5YPoQ́Ga֟F#.޼^w{/kU/zu;S}N<7^RaV 9q!Mې۟ۏqngzg+_'8U8&T0x.ڠ)ҡpt:Δp.p[q@5ohW}Xge*F~E)zHmT R ۟[ eN 򻊷p0CgVɌY582\t|Hج 0sLX1@<!>(zwj*oR!13*J;nWܙ 쬮!-Nyl6:\X(՚Kg3!K5l $?#ߌ'`/Z3/RP?qHgJB,(BR\]9=OnTz1+/y<^>c<zath\?9&g| tsh-/o8cͺrUֹL5XmTS8iB_` T= ey ā`~TfZ esap1jzG49ͬ^dq/e?Ǵt|N:%#AgoKΐJ5Qy`iO >2'=Qh)S^"&9TԚn_/S~ _j"ymR@$<SMM5Z6tvW1XZh n$.[Av8py9"WN|*g)ޥև̘'KMeyB|8n3HnaFv!:Nl$?oC:#PO]nj}:~f~htf:'=<&=|0֊ŊmyrZIb bD[Əǿ?hMj; \-IE=jQn[HSo?I>NzV_MvzdRa%јnIZSaT>_?ףm~0[nÏ9:?8 Ft{Vf'dvF/|:@pgjbVh7N O$]f%`“Z怓)s%u^_ Zh^='o jS3V ^Y[)9zZoK}*7I=o3 ];_s%`ߛ[GVE?LiXЁA~q2/YAGk|< LHvR-f#i(oKgByvr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8ӏGԼ|N'Ա2qٍn^[nBna) ūr&x7)YI$KHŮWV]ǂ n+N=ic;Ȩ<$ Lz|+rN7hc3d*Y;%Lu37c`(fOz}y7%O~uNpS>2wDV]՗J6ॱ:U#h'0ڛ)T*] gl = 2~o|naXIŬM2 0ֲ%X{Qu "~G^L1w_C@"zJ5" Ǎ\~ZrX8G*?9AI1ϯo'$WqY- 9ɬ 2>|$aWFKr咲U<Qf:Rlk'ΰ塐.pjLVK%~yrW$ʷ.7C^ջNy#'3TDH%gge(OUW=u4k?wR,X,o\M>*9>75_^6B]W}kVT𶥂nWnk1MgL"X]pl4_ֹ)o[tYX.`Y\|W>UrA@4Or/f/+%;ϮM]:*ƒNeAy]Id tbd\hGa0ĉ8T;T"9)=cK',n~$Q[b }ә@$/0F@(u( {W‘;0+hHN؄@2w¾3;e@S% dK:UJD9-XX|3D! 1LFQ(dǗ+Tspq p L ZF@7.?DeN/Xnj/$<yAXݠ_~9.@XJQpa #K )p{9Ar<˰`\ !4$Q8I¼KO/\ ◱jĩd&/xnty啖sZQ;`7w/wv ’y[c'@%{! 9]6'9eh?'Ui]wGP' #}O받Gk}`yEl@XL&䄣`<I©9q0 P\1|A~a^5O1Xޭnm<87GWI2o;{1`*,#o׻,%sOHhsRr y)[Ft3šLʏ<.s¥ gpnBbߪuJns}v[ ,K>~W$XoՏ.adom,'ҁԍLjS?Q.")t0T[@2$̣w^~4 l|p4=^>rI}X7`KIJ풳Hn7Zg݄_8s獡i` Lh46q G>EpcS6%u= Y6$\ҘtQp %xTV&黢PY&a8.cϕĂ ,ˋ!|\}ypTl!QIENDB`
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-setup/res/com/badlogic/gdx/setup/resources/html/war/WEB-INF/web.xml
<?xml version="1.0" ?> <web-app> </web-app>
<?xml version="1.0" ?> <web-app> </web-app>
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphicsLiveWallpaper.java
/* * Copyright 2010 Mario Zechner ([email protected]), Nathan Sweet ([email protected]) * * Modified by Elijah Cornell * 2013.01 Modified by Jaroslaw Wisniewski <[email protected]> * 2014.04 Modified by davebaol * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package com.badlogic.gdx.backends.android; import android.opengl.GLSurfaceView.EGLConfigChooser; import android.util.Log; import android.view.SurfaceHolder; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20; import com.badlogic.gdx.backends.android.surfaceview.ResolutionStrategy; import com.badlogic.gdx.utils.GdxRuntimeException; /** A subclass of {@link AndroidGraphics} specialized for live wallpaper applications. * * @author mzechner */ public final class AndroidGraphicsLiveWallpaper extends AndroidGraphics { public AndroidGraphicsLiveWallpaper (AndroidLiveWallpaper lwp, AndroidApplicationConfiguration config, ResolutionStrategy resolutionStrategy) { super(lwp, config, resolutionStrategy, false); } // jw: I replaced GL..SurfaceViewLW classes with their original counterparts, if it will work // on known devices, on opengl 1.0 and 2.0, and all possible SDK versions.. You can remove // GL..SurfaceViewLW family of classes completely (there is no use for them). // -> specific for live wallpapers // jw: synchronized access to current wallpaper surface holder SurfaceHolder getSurfaceHolder () { synchronized (((AndroidLiveWallpaper)app).service.sync) { return ((AndroidLiveWallpaper)app).service.getSurfaceHolder(); } } // <- specific for live wallpapers // Grabbed from AndroidGraphics superclass and modified to override // getHolder in created GLSurfaceView20 instances @Override protected GLSurfaceView20 createGLSurfaceView (AndroidApplicationBase application, final ResolutionStrategy resolutionStrategy) { if (!checkGL20()) throw new GdxRuntimeException("libGDX requires OpenGL ES 2.0"); EGLConfigChooser configChooser = getEglConfigChooser(); GLSurfaceView20 view = new GLSurfaceView20(application.getContext(), resolutionStrategy) { @Override public SurfaceHolder getHolder () { return getSurfaceHolder(); } }; if (configChooser != null) view.setEGLConfigChooser(configChooser); else view.setEGLConfigChooser(config.r, config.g, config.b, config.a, config.depth, config.stencil); view.setRenderer(this); return view; } // kill the GLThread managed by GLSurfaceView (only for GLSurfaceView because GLSurffaceViewCupcake stops thread in // onPause events - which is not as easy and safe for GLSurfaceView) public void onDestroyGLSurfaceView () { if (view != null) { try { // onDetachedFromWindow stops GLThread by calling mGLThread.requestExitAndWait() view.onDetachedFromWindow(); if (AndroidLiveWallpaperService.DEBUG) Log.d(AndroidLiveWallpaperService.TAG, " > AndroidLiveWallpaper - onDestroy() stopped GLThread managed by GLSurfaceView"); } catch (Throwable t) { // error while scheduling exit of GLThread, GLThread will remain live and wallpaper service // wouldn't be able to shutdown completely Log.e(AndroidLiveWallpaperService.TAG, "failed to destroy GLSurfaceView's thread! GLSurfaceView.onDetachedFromWindow impl changed since API lvl 16!"); t.printStackTrace(); } } } @Override void resume () { synchronized (synch) { running = true; resume = true; while (resume) { try { requestRendering(); synch.wait(); } catch (InterruptedException ignored) { Gdx.app.log("AndroidGraphics", "waiting for resume synchronization failed!"); } } } } @Override public void onDrawFrame (javax.microedition.khronos.opengles.GL10 gl) { long time = System.nanoTime(); // After pause deltaTime can have somewhat huge value that destabilizes the mean, so let's cut it off if (!resume) { deltaTime = (time - lastFrameTime) / 1000000000.0f; } else { deltaTime = 0; } lastFrameTime = time; boolean lrunning = false; boolean lpause = false; boolean ldestroy = false; boolean lresume = false; synchronized (synch) { lrunning = running; lpause = pause; ldestroy = destroy; lresume = resume; if (resume) { resume = false; synch.notifyAll(); } if (pause) { pause = false; synch.notifyAll(); } if (destroy) { destroy = false; synch.notifyAll(); } } if (lresume) { // ((AndroidAudio)app.getAudio()).resume(); // jw: moved to AndroidLiveWallpaper.onResume app.getApplicationListener().resume(); Gdx.app.log("AndroidGraphics", "resumed"); } // HACK: added null check to handle set wallpaper from preview null // error in renderer // jw: this hack is not working always, renderer ends with error for some devices - because of uninitialized gl context // jw: now it shouldn't be necessary - after wallpaper backend refactoring:) if (lrunning) { // jw: changed synchronized (app.getRunnables()) { app.getExecutedRunnables().clear(); app.getExecutedRunnables().addAll(app.getRunnables()); app.getRunnables().clear(); for (int i = 0; i < app.getExecutedRunnables().size; i++) { try { app.getExecutedRunnables().get(i).run(); } catch (Throwable t) { t.printStackTrace(); } } } /* * synchronized (app.runnables) { for (int i = 0; i < app.runnables.size; i++) { app.runnables.get(i).run(); } * app.runnables.clear(); } */ app.getInput().processEvents(); frameId++; app.getApplicationListener().render(); } // jw: never called on lvp, why? see description in AndroidLiveWallpaper.onPause if (lpause) { app.getApplicationListener().pause(); // ((AndroidAudio)app.getAudio()).pause(); jw: moved to AndroidLiveWallpaper.onPause Gdx.app.log("AndroidGraphics", "paused"); } // jw: never called on lwp, why? see description in AndroidLiveWallpaper.onPause if (ldestroy) { app.getApplicationListener().dispose(); // ((AndroidAudio)app.getAudio()).dispose(); jw: moved to AndroidLiveWallpaper.onDestroy Gdx.app.log("AndroidGraphics", "destroyed"); } if (time - frameStart > 1000000000) { fps = frames; frames = 0; frameStart = time; } frames++; } @Override protected void logManagedCachesStatus () { // to prevent creating too many string buffers in live wallpapers if (AndroidLiveWallpaperService.DEBUG) { super.logManagedCachesStatus(); } } }
/* * Copyright 2010 Mario Zechner ([email protected]), Nathan Sweet ([email protected]) * * Modified by Elijah Cornell * 2013.01 Modified by Jaroslaw Wisniewski <[email protected]> * 2014.04 Modified by davebaol * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package com.badlogic.gdx.backends.android; import android.opengl.GLSurfaceView.EGLConfigChooser; import android.util.Log; import android.view.SurfaceHolder; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20; import com.badlogic.gdx.backends.android.surfaceview.ResolutionStrategy; import com.badlogic.gdx.utils.GdxRuntimeException; /** A subclass of {@link AndroidGraphics} specialized for live wallpaper applications. * * @author mzechner */ public final class AndroidGraphicsLiveWallpaper extends AndroidGraphics { public AndroidGraphicsLiveWallpaper (AndroidLiveWallpaper lwp, AndroidApplicationConfiguration config, ResolutionStrategy resolutionStrategy) { super(lwp, config, resolutionStrategy, false); } // jw: I replaced GL..SurfaceViewLW classes with their original counterparts, if it will work // on known devices, on opengl 1.0 and 2.0, and all possible SDK versions.. You can remove // GL..SurfaceViewLW family of classes completely (there is no use for them). // -> specific for live wallpapers // jw: synchronized access to current wallpaper surface holder SurfaceHolder getSurfaceHolder () { synchronized (((AndroidLiveWallpaper)app).service.sync) { return ((AndroidLiveWallpaper)app).service.getSurfaceHolder(); } } // <- specific for live wallpapers // Grabbed from AndroidGraphics superclass and modified to override // getHolder in created GLSurfaceView20 instances @Override protected GLSurfaceView20 createGLSurfaceView (AndroidApplicationBase application, final ResolutionStrategy resolutionStrategy) { if (!checkGL20()) throw new GdxRuntimeException("libGDX requires OpenGL ES 2.0"); EGLConfigChooser configChooser = getEglConfigChooser(); GLSurfaceView20 view = new GLSurfaceView20(application.getContext(), resolutionStrategy) { @Override public SurfaceHolder getHolder () { return getSurfaceHolder(); } }; if (configChooser != null) view.setEGLConfigChooser(configChooser); else view.setEGLConfigChooser(config.r, config.g, config.b, config.a, config.depth, config.stencil); view.setRenderer(this); return view; } // kill the GLThread managed by GLSurfaceView (only for GLSurfaceView because GLSurffaceViewCupcake stops thread in // onPause events - which is not as easy and safe for GLSurfaceView) public void onDestroyGLSurfaceView () { if (view != null) { try { // onDetachedFromWindow stops GLThread by calling mGLThread.requestExitAndWait() view.onDetachedFromWindow(); if (AndroidLiveWallpaperService.DEBUG) Log.d(AndroidLiveWallpaperService.TAG, " > AndroidLiveWallpaper - onDestroy() stopped GLThread managed by GLSurfaceView"); } catch (Throwable t) { // error while scheduling exit of GLThread, GLThread will remain live and wallpaper service // wouldn't be able to shutdown completely Log.e(AndroidLiveWallpaperService.TAG, "failed to destroy GLSurfaceView's thread! GLSurfaceView.onDetachedFromWindow impl changed since API lvl 16!"); t.printStackTrace(); } } } @Override void resume () { synchronized (synch) { running = true; resume = true; while (resume) { try { requestRendering(); synch.wait(); } catch (InterruptedException ignored) { Gdx.app.log("AndroidGraphics", "waiting for resume synchronization failed!"); } } } } @Override public void onDrawFrame (javax.microedition.khronos.opengles.GL10 gl) { long time = System.nanoTime(); // After pause deltaTime can have somewhat huge value that destabilizes the mean, so let's cut it off if (!resume) { deltaTime = (time - lastFrameTime) / 1000000000.0f; } else { deltaTime = 0; } lastFrameTime = time; boolean lrunning = false; boolean lpause = false; boolean ldestroy = false; boolean lresume = false; synchronized (synch) { lrunning = running; lpause = pause; ldestroy = destroy; lresume = resume; if (resume) { resume = false; synch.notifyAll(); } if (pause) { pause = false; synch.notifyAll(); } if (destroy) { destroy = false; synch.notifyAll(); } } if (lresume) { // ((AndroidAudio)app.getAudio()).resume(); // jw: moved to AndroidLiveWallpaper.onResume app.getApplicationListener().resume(); Gdx.app.log("AndroidGraphics", "resumed"); } // HACK: added null check to handle set wallpaper from preview null // error in renderer // jw: this hack is not working always, renderer ends with error for some devices - because of uninitialized gl context // jw: now it shouldn't be necessary - after wallpaper backend refactoring:) if (lrunning) { // jw: changed synchronized (app.getRunnables()) { app.getExecutedRunnables().clear(); app.getExecutedRunnables().addAll(app.getRunnables()); app.getRunnables().clear(); for (int i = 0; i < app.getExecutedRunnables().size; i++) { try { app.getExecutedRunnables().get(i).run(); } catch (Throwable t) { t.printStackTrace(); } } } /* * synchronized (app.runnables) { for (int i = 0; i < app.runnables.size; i++) { app.runnables.get(i).run(); } * app.runnables.clear(); } */ app.getInput().processEvents(); frameId++; app.getApplicationListener().render(); } // jw: never called on lvp, why? see description in AndroidLiveWallpaper.onPause if (lpause) { app.getApplicationListener().pause(); // ((AndroidAudio)app.getAudio()).pause(); jw: moved to AndroidLiveWallpaper.onPause Gdx.app.log("AndroidGraphics", "paused"); } // jw: never called on lwp, why? see description in AndroidLiveWallpaper.onPause if (ldestroy) { app.getApplicationListener().dispose(); // ((AndroidAudio)app.getAudio()).dispose(); jw: moved to AndroidLiveWallpaper.onDestroy Gdx.app.log("AndroidGraphics", "destroyed"); } if (time - frameStart > 1000000000) { fps = frames; frames = 0; frameStart = time; } frames++; } @Override protected void logManagedCachesStatus () { // to prevent creating too many string buffers in live wallpapers if (AndroidLiveWallpaperService.DEBUG) { super.logManagedCachesStatus(); } } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/InternalTickTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.physics.bullet.collision.btCollisionObjectArray; import com.badlogic.gdx.physics.bullet.dynamics.InternalTickCallback; import com.badlogic.gdx.physics.bullet.dynamics.btDynamicsWorld; import com.badlogic.gdx.physics.bullet.dynamics.btRigidBody; /** @author xoppa */ public class InternalTickTest extends BaseBulletTest { static class TestInternalTickCallback extends InternalTickCallback { public TestInternalTickCallback (btDynamicsWorld dynamicsWorld) { super(dynamicsWorld, true); } @Override public void onInternalTick (btDynamicsWorld dynamicsWorld, float timeStep) { btCollisionObjectArray objs = dynamicsWorld.getCollisionObjectArray(); dynamicsWorld.clearForces(); int idx = 0; for (int i = 0; i < objs.size(); i++) { btRigidBody body = (btRigidBody)(objs.atConst(i)); if (body == null || body.isStaticOrKinematicObject()) continue; body.applyGravity(); body.applyCentralForce(tmpV1.set(0f, 8.0f + (float)(6.0 * Math.random()), 0f)); idx++; } } } final int BOXCOUNT_X = 5; final int BOXCOUNT_Y = 5; final int BOXCOUNT_Z = 1; final float BOXOFFSET_X = -2.5f; final float BOXOFFSET_Y = 0.5f; final float BOXOFFSET_Z = 0f; TestInternalTickCallback internalTickCallback; @Override public void create () { super.create(); internalTickCallback = new TestInternalTickCallback((btDynamicsWorld)world.collisionWorld); // Create the entities world.add("ground", 0f, 0f, 0f).setColor(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { for (int z = 0; z < BOXCOUNT_Z; z++) { world.add("box", BOXOFFSET_X + x, BOXOFFSET_Y + y, BOXOFFSET_Z + z).setColor(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 1f); } } } } @Override public void dispose () { super.dispose(); if (internalTickCallback != null) internalTickCallback.dispose(); internalTickCallback = null; } float toggleTime = 0f; boolean toggleAttach = false; @Override public void render () { super.render(); if (internalTickCallback == null) return; if ((toggleTime += Gdx.graphics.getDeltaTime()) > 1.0f) { toggleTime -= 1.0f; if (toggleAttach) internalTickCallback.detach(); else internalTickCallback.attach(); toggleAttach = !toggleAttach; } } @Override public boolean tap (float x, float y, int count, int button) { shoot(x, y); return true; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.physics.bullet.collision.btCollisionObjectArray; import com.badlogic.gdx.physics.bullet.dynamics.InternalTickCallback; import com.badlogic.gdx.physics.bullet.dynamics.btDynamicsWorld; import com.badlogic.gdx.physics.bullet.dynamics.btRigidBody; /** @author xoppa */ public class InternalTickTest extends BaseBulletTest { static class TestInternalTickCallback extends InternalTickCallback { public TestInternalTickCallback (btDynamicsWorld dynamicsWorld) { super(dynamicsWorld, true); } @Override public void onInternalTick (btDynamicsWorld dynamicsWorld, float timeStep) { btCollisionObjectArray objs = dynamicsWorld.getCollisionObjectArray(); dynamicsWorld.clearForces(); int idx = 0; for (int i = 0; i < objs.size(); i++) { btRigidBody body = (btRigidBody)(objs.atConst(i)); if (body == null || body.isStaticOrKinematicObject()) continue; body.applyGravity(); body.applyCentralForce(tmpV1.set(0f, 8.0f + (float)(6.0 * Math.random()), 0f)); idx++; } } } final int BOXCOUNT_X = 5; final int BOXCOUNT_Y = 5; final int BOXCOUNT_Z = 1; final float BOXOFFSET_X = -2.5f; final float BOXOFFSET_Y = 0.5f; final float BOXOFFSET_Z = 0f; TestInternalTickCallback internalTickCallback; @Override public void create () { super.create(); internalTickCallback = new TestInternalTickCallback((btDynamicsWorld)world.collisionWorld); // Create the entities world.add("ground", 0f, 0f, 0f).setColor(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { for (int z = 0; z < BOXCOUNT_Z; z++) { world.add("box", BOXOFFSET_X + x, BOXOFFSET_Y + y, BOXOFFSET_Z + z).setColor(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 1f); } } } } @Override public void dispose () { super.dispose(); if (internalTickCallback != null) internalTickCallback.dispose(); internalTickCallback = null; } float toggleTime = 0f; boolean toggleAttach = false; @Override public void render () { super.render(); if (internalTickCallback == null) return; if ((toggleTime += Gdx.graphics.getDeltaTime()) > 1.0f) { toggleTime -= 1.0f; if (toggleAttach) internalTickCallback.detach(); else internalTickCallback.attach(); toggleAttach = !toggleAttach; } } @Override public boolean tap (float x, float y, int count, int button) { shoot(x, y); return true; } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/scenes/scene2d/actions/IntAction.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.scenes.scene2d.actions; import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.utils.Null; /** An action that has an int, whose value is transitioned over time. * @author Nathan Sweet */ public class IntAction extends TemporalAction { private int start, end; private int value; /** Creates an IntAction that transitions from 0 to 1. */ public IntAction () { start = 0; end = 1; } /** Creates an IntAction that transitions from start to end. */ public IntAction (int start, int end) { this.start = start; this.end = end; } /** Creates a FloatAction that transitions from start to end. */ public IntAction (int start, int end, float duration) { super(duration); this.start = start; this.end = end; } /** Creates a FloatAction that transitions from start to end. */ public IntAction (int start, int end, float duration, @Null Interpolation interpolation) { super(duration, interpolation); this.start = start; this.end = end; } protected void begin () { value = start; } protected void update (float percent) { if (percent == 0) value = start; else if (percent == 1) value = end; else value = (int)(start + (end - start) * percent); } /** Gets the current int value. */ public int getValue () { return value; } /** Sets the current int value. */ public void setValue (int value) { this.value = value; } public int getStart () { return start; } /** Sets the value to transition from. */ public void setStart (int start) { this.start = start; } public int getEnd () { return end; } /** Sets the value to transition to. */ public void setEnd (int end) { this.end = end; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.scenes.scene2d.actions; import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.utils.Null; /** An action that has an int, whose value is transitioned over time. * @author Nathan Sweet */ public class IntAction extends TemporalAction { private int start, end; private int value; /** Creates an IntAction that transitions from 0 to 1. */ public IntAction () { start = 0; end = 1; } /** Creates an IntAction that transitions from start to end. */ public IntAction (int start, int end) { this.start = start; this.end = end; } /** Creates a FloatAction that transitions from start to end. */ public IntAction (int start, int end, float duration) { super(duration); this.start = start; this.end = end; } /** Creates a FloatAction that transitions from start to end. */ public IntAction (int start, int end, float duration, @Null Interpolation interpolation) { super(duration, interpolation); this.start = start; this.end = end; } protected void begin () { value = start; } protected void update (float percent) { if (percent == 0) value = start; else if (percent == 1) value = end; else value = (int)(start + (end - start) * percent); } /** Gets the current int value. */ public int getValue () { return value; } /** Sets the current int value. */ public void setValue (int value) { this.value = value; } public int getStart () { return start; } /** Sets the value to transition from. */ public void setStart (int start) { this.start = start; } public int getEnd () { return end; } /** Sets the value to transition to. */ public void setEnd (int end) { this.end = end; } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests/src/com/badlogic/gdx/tests/utils/PerspectiveCamController.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.utils; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputAdapter; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Plane; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; public class PerspectiveCamController extends InputAdapter { private final static Vector3 tmpV = new Vector3(); public PerspectiveCamera cam; enum TransformMode { Rotate, Translate, Zoom, None } Vector3 lookAt = new Vector3(); TransformMode mode = TransformMode.Translate; boolean translated = false; public PerspectiveCamController (PerspectiveCamera cam) { this.cam = cam; } @Override public boolean touchDown (int x, int y, int pointer, int button) { mode = TransformMode.Rotate; last.set(x, y); tCurr.set(x, y); return true; } @Override public boolean touchUp (int x, int y, int pointer, int button) { mode = TransformMode.None; return true; } Vector2 tCurr = new Vector2(); Vector2 last = new Vector2(); Vector2 delta = new Vector2(); Vector2 currWindow = new Vector2(); Vector2 lastWindow = new Vector2(); Vector3 curr3 = new Vector3(); Vector3 delta3 = new Vector3(); Plane lookAtPlane = new Plane(new Vector3(0, 1, 0), 0); Matrix4 rotMatrix = new Matrix4(); Vector3 xAxis = new Vector3(1, 0, 0); Vector3 yAxis = new Vector3(0, 1, 0); Vector3 point = new Vector3(); @Override public boolean touchDragged (int x, int y, int pointer) { if (pointer != 0) return false; delta.set(x, y).sub(last); if (mode == TransformMode.Rotate) { point.set(cam.position).sub(lookAt); if (tmpV.set(point).nor().dot(yAxis) < 0.9999f) { xAxis.set(cam.direction).crs(yAxis).nor(); rotMatrix.setToRotation(xAxis, delta.y / 5); point.mul(rotMatrix); } rotMatrix.setToRotation(yAxis, -delta.x / 5); point.mul(rotMatrix); cam.position.set(point.add(lookAt)); cam.lookAt(lookAt.x, lookAt.y, lookAt.z); } if (mode == TransformMode.Zoom) { cam.fieldOfView -= -delta.y / 10; } if (mode == TransformMode.Translate) { tCurr.set(x, y); translated = true; } cam.update(); last.set(x, y); return true; } @Override public boolean scrolled (float amountX, float amountY) { cam.fieldOfView -= -amountY * Gdx.graphics.getDeltaTime() * 100; cam.update(); return true; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.utils; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputAdapter; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Plane; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; public class PerspectiveCamController extends InputAdapter { private final static Vector3 tmpV = new Vector3(); public PerspectiveCamera cam; enum TransformMode { Rotate, Translate, Zoom, None } Vector3 lookAt = new Vector3(); TransformMode mode = TransformMode.Translate; boolean translated = false; public PerspectiveCamController (PerspectiveCamera cam) { this.cam = cam; } @Override public boolean touchDown (int x, int y, int pointer, int button) { mode = TransformMode.Rotate; last.set(x, y); tCurr.set(x, y); return true; } @Override public boolean touchUp (int x, int y, int pointer, int button) { mode = TransformMode.None; return true; } Vector2 tCurr = new Vector2(); Vector2 last = new Vector2(); Vector2 delta = new Vector2(); Vector2 currWindow = new Vector2(); Vector2 lastWindow = new Vector2(); Vector3 curr3 = new Vector3(); Vector3 delta3 = new Vector3(); Plane lookAtPlane = new Plane(new Vector3(0, 1, 0), 0); Matrix4 rotMatrix = new Matrix4(); Vector3 xAxis = new Vector3(1, 0, 0); Vector3 yAxis = new Vector3(0, 1, 0); Vector3 point = new Vector3(); @Override public boolean touchDragged (int x, int y, int pointer) { if (pointer != 0) return false; delta.set(x, y).sub(last); if (mode == TransformMode.Rotate) { point.set(cam.position).sub(lookAt); if (tmpV.set(point).nor().dot(yAxis) < 0.9999f) { xAxis.set(cam.direction).crs(yAxis).nor(); rotMatrix.setToRotation(xAxis, delta.y / 5); point.mul(rotMatrix); } rotMatrix.setToRotation(yAxis, -delta.x / 5); point.mul(rotMatrix); cam.position.set(point.add(lookAt)); cam.lookAt(lookAt.x, lookAt.y, lookAt.z); } if (mode == TransformMode.Zoom) { cam.fieldOfView -= -delta.y / 10; } if (mode == TransformMode.Translate) { tCurr.set(x, y); translated = true; } cam.update(); last.set(x, y); return true; } @Override public boolean scrolled (float amountX, float amountY) { cam.fieldOfView -= -amountY * Gdx.graphics.getDeltaTime() * 100; cam.update(); return true; } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests-android/assets/data/stones.jpg
JFIF``hExifMM*>F(1N``Paint.NET v3.5.8C$<'$!!$J58,<XM\[VMUSamvaghSUyz^tC$ $G''GdUd" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?§%-H 4 8P(IP)3F%=j3QۮXX ֒ g"r=2F2rMK+dTPi4|'j]"4:Hg5`;4fK ի{llIsRmQӚx57 sFielfiLҨ.Tda]XO iؤ@</<j%)Tʕ|0"6.H ݍ  {ʷkBn-ڣIsZ`z 8zb Za]˵J-B &2ʸzu<FusSDCKHiipA Αxl'p5"ڮyN{Ԕ*.$ҦRcl*2SOHܜϯZ`QbCNDzLC月pG9娸ߓVRMXs֚i\df tIs@"ϵ!Ph)@%(8yq<!9BiH[$8SNmAPn`*uL *0xv(^GLT4<uAS[6K 8g8z(#Ey`ƥ/F2R҃4 >2VlG&?;PA#(HJ| Q3i.=@u㚅9<gM8?Gy($%޳bjSީަ8B_5[QHL950dt->NÒu9n8(t|qH3ZhzB Զ8튊sRO1ҘƣcdgOsMczd1 ץ+h?Zb#ly4rGǡKXۺ2+"U*} l.1 YlBeZ(47C@N jv1sf^ծR#{v`t`dP xEv9}ji8$PS@TQ zt$Uh!Ʊ繠ךar1n{қLKIZAh# 4ɦf@ җ#ijaj<*7zk=0X!欃UWR bρL-QXsRp~QM&{b#)asN+E%jw 1PVrn=*S0:S81N){Q9z☆ 4QʚP;;`G"('ݩ*$Sހ:R4]Ӊ;Hr*uclQ@Fr3zE!G˜{R;AH~RҀ2=)Sٶ(sO|ݪ vܝq@j#f^VF i@Rt'JJ{',A{Ґ1PNM08e'`ӊ\qEf9^KQ5~rB)ӀN@xM&i.bf_Zlð[i<ջg.[47˅ޣu;d!<9$69xTm4L`rj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e܀hH01ڱ(v- 2a5U-V.@( u4#T *C/~:#mKT?yx4Q3=E! |@\YJk|V|Җ8*%S#cF)VIfL5VzÅl 2S}2~jm!3f3 [CV|/ _ՒJ/(A2 9⁑B曓iZbzkMWf y"dŜW$;'PsGZ< V6FsL"8jYzM!4i 5oNs4}ޕLp+^-zh;JҪ >gl(۲1M'Nh&4SI4yiǚi N,)9E6p)`RRVZ`HqQN3ނ?J1#>@ۘ hyNjCQR"5>r*XȎAXl5 g Oq5<J3fSAjl;\S쓞`zy&rr2p#6TG  v<L+^nҠv1$CQ>SYh@*HXSZ.G)=_O'5 7.M\asU HOk1)+E~qa(Ѷdѥ\D&iѲHd">5!wl]xȪ^*Ҁ&zK]'o&ܞI.^Q!VI^(Xqn>M5 #MBƟ'SQ50i4i=^uƒrkF|3U9Ew 3Q(=?1ɤ'iғILi(J9Ա q֐4f N<+sHM2U@SP;JL H GNSL AF &fv#5 `Q)3HaJiUKZ`/AR!8**[AfR2u* 4GJ 8HԾch(4$1) i֯BylHP9N Eʱ5bD*zXBt@Ozc.ީkֵqf1.+]”RRw "zd &Kބ M9Ȧw]cJoRTg8Qooy$UԐXM6 d ӷ.1Rr)Do5l"R4Mʰ15:cO&aҐP#l٭KZ'iƱ94iN)ƖeʶANfbcj\Z@!4@ A├S 0 J)@W&4q4R4iޔi cii~P)s!*MJ:R( dMxz.+S4SSfQ@EznM[٧ 4y\*}#z<S 2)@:r*():(®ިƻ¨8T"ugAH"a=i]Te{u{Ua;x3N Cž*u`Px34$ hR]04iMr?pu$Xb M$Ap bݨE!4ȦH~zP$H[a mi`G>T$4IOI ZйYEWM4bn}Dj[sɠ DnF9橳aL@5U4b3qM%M@ZP <SW @ Lu SM4!)N
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/assets/loaders/resolvers/ResolutionFileResolver.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.assets.loaders.resolvers; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.assets.loaders.FileHandleResolver; import com.badlogic.gdx.files.FileHandle; /** This {@link FileHandleResolver} uses a given list of {@link Resolution}s to determine the best match based on the current back * buffer size. An example of how this resolver works: * * <p> * Let's assume that we have only a single {@link Resolution} added to this resolver. This resolution has the following * properties: * </p> * * <ul> * <li>{@code portraitWidth = 1920}</li> * <li>{@code portraitHeight = 1080}</li> * <li>{@code folder = "1920x1080"}</li> * </ul> * * <p> * One would now supply a file to be found to the resolver. For this example, we assume it is "{@code textures/walls/brick.png}". * Since there is only a single {@link Resolution}, this will be the best match for any screen size. The resolver will now try to * find the file in the following ways: * </p> * * <ul> * <li>{@code "textures/walls/1920x1080/brick.png"}</li> * <li>{@code "textures/walls/brick.png"}</li> * </ul> * * <p> * The files are ultimately resolved via the given {{@link #baseResolver}. In case the first version cannot be resolved, the * fallback will try to search for the file without the resolution folder. * </p> */ public class ResolutionFileResolver implements FileHandleResolver { public static class Resolution { public final int portraitWidth; public final int portraitHeight; /** The name of the folder, where the assets which fit this resolution, are located. */ public final String folder; /** Constructs a {@code Resolution}. * @param portraitWidth This resolution's width. * @param portraitHeight This resolution's height. * @param folder The name of the folder, where the assets which fit this resolution, are located. */ public Resolution (int portraitWidth, int portraitHeight, String folder) { this.portraitWidth = portraitWidth; this.portraitHeight = portraitHeight; this.folder = folder; } } protected final FileHandleResolver baseResolver; protected final Resolution[] descriptors; /** Creates a {@code ResolutionFileResolver} based on a given {@link FileHandleResolver} and a list of {@link Resolution}s. * @param baseResolver The {@link FileHandleResolver} that will ultimately used to resolve the file. * @param descriptors A list of {@link Resolution}s. At least one has to be supplied. */ public ResolutionFileResolver (FileHandleResolver baseResolver, Resolution... descriptors) { if (descriptors.length == 0) throw new IllegalArgumentException("At least one Resolution needs to be supplied."); this.baseResolver = baseResolver; this.descriptors = descriptors; } @Override public FileHandle resolve (String fileName) { Resolution bestResolution = choose(descriptors); FileHandle originalHandle = new FileHandle(fileName); FileHandle handle = baseResolver.resolve(resolve(originalHandle, bestResolution.folder)); if (!handle.exists()) handle = baseResolver.resolve(fileName); return handle; } protected String resolve (FileHandle originalHandle, String suffix) { String parentString = ""; FileHandle parent = originalHandle.parent(); if (parent != null && !parent.name().equals("")) { parentString = parent + "/"; } return parentString + suffix + "/" + originalHandle.name(); } static public Resolution choose (Resolution... descriptors) { int w = Gdx.graphics.getBackBufferWidth(), h = Gdx.graphics.getBackBufferHeight(); // Prefer the shortest side. Resolution best = descriptors[0]; if (w < h) { for (int i = 0, n = descriptors.length; i < n; i++) { Resolution other = descriptors[i]; if (w >= other.portraitWidth && other.portraitWidth >= best.portraitWidth && h >= other.portraitHeight && other.portraitHeight >= best.portraitHeight) best = descriptors[i]; } } else { for (int i = 0, n = descriptors.length; i < n; i++) { Resolution other = descriptors[i]; if (w >= other.portraitHeight && other.portraitHeight >= best.portraitHeight && h >= other.portraitWidth && other.portraitWidth >= best.portraitWidth) best = descriptors[i]; } } return best; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.assets.loaders.resolvers; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.assets.loaders.FileHandleResolver; import com.badlogic.gdx.files.FileHandle; /** This {@link FileHandleResolver} uses a given list of {@link Resolution}s to determine the best match based on the current back * buffer size. An example of how this resolver works: * * <p> * Let's assume that we have only a single {@link Resolution} added to this resolver. This resolution has the following * properties: * </p> * * <ul> * <li>{@code portraitWidth = 1920}</li> * <li>{@code portraitHeight = 1080}</li> * <li>{@code folder = "1920x1080"}</li> * </ul> * * <p> * One would now supply a file to be found to the resolver. For this example, we assume it is "{@code textures/walls/brick.png}". * Since there is only a single {@link Resolution}, this will be the best match for any screen size. The resolver will now try to * find the file in the following ways: * </p> * * <ul> * <li>{@code "textures/walls/1920x1080/brick.png"}</li> * <li>{@code "textures/walls/brick.png"}</li> * </ul> * * <p> * The files are ultimately resolved via the given {{@link #baseResolver}. In case the first version cannot be resolved, the * fallback will try to search for the file without the resolution folder. * </p> */ public class ResolutionFileResolver implements FileHandleResolver { public static class Resolution { public final int portraitWidth; public final int portraitHeight; /** The name of the folder, where the assets which fit this resolution, are located. */ public final String folder; /** Constructs a {@code Resolution}. * @param portraitWidth This resolution's width. * @param portraitHeight This resolution's height. * @param folder The name of the folder, where the assets which fit this resolution, are located. */ public Resolution (int portraitWidth, int portraitHeight, String folder) { this.portraitWidth = portraitWidth; this.portraitHeight = portraitHeight; this.folder = folder; } } protected final FileHandleResolver baseResolver; protected final Resolution[] descriptors; /** Creates a {@code ResolutionFileResolver} based on a given {@link FileHandleResolver} and a list of {@link Resolution}s. * @param baseResolver The {@link FileHandleResolver} that will ultimately used to resolve the file. * @param descriptors A list of {@link Resolution}s. At least one has to be supplied. */ public ResolutionFileResolver (FileHandleResolver baseResolver, Resolution... descriptors) { if (descriptors.length == 0) throw new IllegalArgumentException("At least one Resolution needs to be supplied."); this.baseResolver = baseResolver; this.descriptors = descriptors; } @Override public FileHandle resolve (String fileName) { Resolution bestResolution = choose(descriptors); FileHandle originalHandle = new FileHandle(fileName); FileHandle handle = baseResolver.resolve(resolve(originalHandle, bestResolution.folder)); if (!handle.exists()) handle = baseResolver.resolve(fileName); return handle; } protected String resolve (FileHandle originalHandle, String suffix) { String parentString = ""; FileHandle parent = originalHandle.parent(); if (parent != null && !parent.name().equals("")) { parentString = parent + "/"; } return parentString + suffix + "/" + originalHandle.name(); } static public Resolution choose (Resolution... descriptors) { int w = Gdx.graphics.getBackBufferWidth(), h = Gdx.graphics.getBackBufferHeight(); // Prefer the shortest side. Resolution best = descriptors[0]; if (w < h) { for (int i = 0, n = descriptors.length; i < n; i++) { Resolution other = descriptors[i]; if (w >= other.portraitWidth && other.portraitWidth >= best.portraitWidth && h >= other.portraitHeight && other.portraitHeight >= best.portraitHeight) best = descriptors[i]; } } else { for (int i = 0, n = descriptors.length; i < n; i++) { Resolution other = descriptors[i]; if (w >= other.portraitHeight && other.portraitHeight >= best.portraitHeight && h >= other.portraitWidth && other.portraitWidth >= best.portraitWidth) best = descriptors[i]; } } return best; } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/graphics/g3d/utils/TextureDescriptor.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.utils; import com.badlogic.gdx.graphics.GLTexture; import com.badlogic.gdx.graphics.Texture; public class TextureDescriptor<T extends GLTexture> implements Comparable<TextureDescriptor<T>> { public T texture = null; public Texture.TextureFilter minFilter; public Texture.TextureFilter magFilter; public Texture.TextureWrap uWrap; public Texture.TextureWrap vWrap; // TODO add other values, see http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml public TextureDescriptor (final T texture, final Texture.TextureFilter minFilter, final Texture.TextureFilter magFilter, final Texture.TextureWrap uWrap, final Texture.TextureWrap vWrap) { set(texture, minFilter, magFilter, uWrap, vWrap); } public TextureDescriptor (final T texture) { this(texture, null, null, null, null); } public TextureDescriptor () { } public void set (final T texture, final Texture.TextureFilter minFilter, final Texture.TextureFilter magFilter, final Texture.TextureWrap uWrap, final Texture.TextureWrap vWrap) { this.texture = texture; this.minFilter = minFilter; this.magFilter = magFilter; this.uWrap = uWrap; this.vWrap = vWrap; } public <V extends T> void set (final TextureDescriptor<V> other) { texture = other.texture; minFilter = other.minFilter; magFilter = other.magFilter; uWrap = other.uWrap; vWrap = other.vWrap; } @Override public boolean equals (Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof TextureDescriptor)) return false; final TextureDescriptor<?> other = (TextureDescriptor<?>)obj; return other.texture == texture && other.minFilter == minFilter && other.magFilter == magFilter && other.uWrap == uWrap && other.vWrap == vWrap; } @Override public int hashCode () { long result = (texture == null ? 0 : texture.glTarget); result = 811 * result + (texture == null ? 0 : texture.getTextureObjectHandle()); result = 811 * result + (minFilter == null ? 0 : minFilter.getGLEnum()); result = 811 * result + (magFilter == null ? 0 : magFilter.getGLEnum()); result = 811 * result + (uWrap == null ? 0 : uWrap.getGLEnum()); result = 811 * result + (vWrap == null ? 0 : vWrap.getGLEnum()); return (int)(result ^ (result >> 32)); } @Override public int compareTo (TextureDescriptor<T> o) { if (o == this) return 0; int t1 = texture == null ? 0 : texture.glTarget; int t2 = o.texture == null ? 0 : o.texture.glTarget; if (t1 != t2) return t1 - t2; int h1 = texture == null ? 0 : texture.getTextureObjectHandle(); int h2 = o.texture == null ? 0 : o.texture.getTextureObjectHandle(); if (h1 != h2) return h1 - h2; if (minFilter != o.minFilter) return (minFilter == null ? 0 : minFilter.getGLEnum()) - (o.minFilter == null ? 0 : o.minFilter.getGLEnum()); if (magFilter != o.magFilter) return (magFilter == null ? 0 : magFilter.getGLEnum()) - (o.magFilter == null ? 0 : o.magFilter.getGLEnum()); if (uWrap != o.uWrap) return (uWrap == null ? 0 : uWrap.getGLEnum()) - (o.uWrap == null ? 0 : o.uWrap.getGLEnum()); if (vWrap != o.vWrap) return (vWrap == null ? 0 : vWrap.getGLEnum()) - (o.vWrap == null ? 0 : o.vWrap.getGLEnum()); return 0; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.utils; import com.badlogic.gdx.graphics.GLTexture; import com.badlogic.gdx.graphics.Texture; public class TextureDescriptor<T extends GLTexture> implements Comparable<TextureDescriptor<T>> { public T texture = null; public Texture.TextureFilter minFilter; public Texture.TextureFilter magFilter; public Texture.TextureWrap uWrap; public Texture.TextureWrap vWrap; // TODO add other values, see http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml public TextureDescriptor (final T texture, final Texture.TextureFilter minFilter, final Texture.TextureFilter magFilter, final Texture.TextureWrap uWrap, final Texture.TextureWrap vWrap) { set(texture, minFilter, magFilter, uWrap, vWrap); } public TextureDescriptor (final T texture) { this(texture, null, null, null, null); } public TextureDescriptor () { } public void set (final T texture, final Texture.TextureFilter minFilter, final Texture.TextureFilter magFilter, final Texture.TextureWrap uWrap, final Texture.TextureWrap vWrap) { this.texture = texture; this.minFilter = minFilter; this.magFilter = magFilter; this.uWrap = uWrap; this.vWrap = vWrap; } public <V extends T> void set (final TextureDescriptor<V> other) { texture = other.texture; minFilter = other.minFilter; magFilter = other.magFilter; uWrap = other.uWrap; vWrap = other.vWrap; } @Override public boolean equals (Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof TextureDescriptor)) return false; final TextureDescriptor<?> other = (TextureDescriptor<?>)obj; return other.texture == texture && other.minFilter == minFilter && other.magFilter == magFilter && other.uWrap == uWrap && other.vWrap == vWrap; } @Override public int hashCode () { long result = (texture == null ? 0 : texture.glTarget); result = 811 * result + (texture == null ? 0 : texture.getTextureObjectHandle()); result = 811 * result + (minFilter == null ? 0 : minFilter.getGLEnum()); result = 811 * result + (magFilter == null ? 0 : magFilter.getGLEnum()); result = 811 * result + (uWrap == null ? 0 : uWrap.getGLEnum()); result = 811 * result + (vWrap == null ? 0 : vWrap.getGLEnum()); return (int)(result ^ (result >> 32)); } @Override public int compareTo (TextureDescriptor<T> o) { if (o == this) return 0; int t1 = texture == null ? 0 : texture.glTarget; int t2 = o.texture == null ? 0 : o.texture.glTarget; if (t1 != t2) return t1 - t2; int h1 = texture == null ? 0 : texture.getTextureObjectHandle(); int h2 = o.texture == null ? 0 : o.texture.getTextureObjectHandle(); if (h1 != h2) return h1 - h2; if (minFilter != o.minFilter) return (minFilter == null ? 0 : minFilter.getGLEnum()) - (o.minFilter == null ? 0 : o.minFilter.getGLEnum()); if (magFilter != o.magFilter) return (magFilter == null ? 0 : magFilter.getGLEnum()) - (o.magFilter == null ? 0 : o.magFilter.getGLEnum()); if (uWrap != o.uWrap) return (uWrap == null ? 0 : uWrap.getGLEnum()) - (o.uWrap == null ? 0 : o.uWrap.getGLEnum()); if (vWrap != o.vWrap) return (vWrap == null ? 0 : vWrap.getGLEnum()) - (o.vWrap == null ? 0 : o.vWrap.getGLEnum()); return 0; } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/utils/IntFloatMap.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils; import java.util.Arrays; import java.util.Iterator; import java.util.NoSuchElementException; import static com.badlogic.gdx.utils.ObjectSet.tableSize; /** An unordered map where the keys are unboxed ints and values are unboxed floats. No allocation is done except when growing the * table size. * <p> * This class performs fast contains and remove (typically O(1), worst case O(n) but that is rare in practice). Add may be * slightly slower, depending on hash collisions. Hashcodes are rehashed to reduce collisions and the need to resize. Load factors * greater than 0.91 greatly increase the chances to resize to the next higher POT size. * <p> * Unordered sets and maps are not designed to provide especially fast iteration. Iteration is faster with OrderedSet and * OrderedMap. * <p> * This implementation uses linear probing with the backward shift algorithm for removal. Hashcodes are rehashed using Fibonacci * hashing, instead of the more common power-of-two mask, to better distribute poor hashCodes (see <a href= * "https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/">Malte * Skarupke's blog post</a>). Linear probing continues to work even when all hashCodes collide, just more slowly. * @author Nathan Sweet * @author Tommy Ettinger */ public class IntFloatMap implements Iterable<IntFloatMap.Entry> { public int size; int[] keyTable; float[] valueTable; float zeroValue; boolean hasZeroValue; private final float loadFactor; private int threshold; /** Used by {@link #place(int)} to bit shift the upper bits of a {@code long} into a usable range (&gt;= 0 and &lt;= * {@link #mask}). The shift can be negative, which is convenient to match the number of bits in mask: if mask is a 7-bit * number, a shift of -7 shifts the upper 7 bits into the lowest 7 positions. This class sets the shift &gt; 32 and &lt; 64, * which if used with an int will still move the upper bits of an int to the lower bits due to Java's implicit modulus on * shifts. * <p> * {@link #mask} can also be used to mask the low bits of a number, which may be faster for some hashcodes, if * {@link #place(int)} is overridden. */ protected int shift; /** A bitmask used to confine hashcodes to the size of the table. Must be all 1 bits in its low positions, ie a power of two * minus 1. If {@link #place(int)} is overriden, this can be used instead of {@link #shift} to isolate usable bits of a * hash. */ protected int mask; private transient Entries entries1, entries2; private transient Values values1, values2; private transient Keys keys1, keys2; /** Creates a new map with an initial capacity of 51 and a load factor of 0.8. */ public IntFloatMap () { this(51, 0.8f); } /** Creates a new map with a load factor of 0.8. * * @param initialCapacity The backing array size is initialCapacity / loadFactor, increased to the next power of two. */ public IntFloatMap (int initialCapacity) { this(initialCapacity, 0.8f); } /** Creates a new map with the specified initial capacity and load factor. This map will hold initialCapacity items before * growing the backing table. * @param initialCapacity The backing array size is initialCapacity / loadFactor, increased to the next power of two. */ public IntFloatMap (int initialCapacity, float loadFactor) { if (loadFactor <= 0f || loadFactor >= 1f) throw new IllegalArgumentException("loadFactor must be > 0 and < 1: " + loadFactor); this.loadFactor = loadFactor; int tableSize = tableSize(initialCapacity, loadFactor); threshold = (int)(tableSize * loadFactor); mask = tableSize - 1; shift = Long.numberOfLeadingZeros(mask); keyTable = new int[tableSize]; valueTable = new float[tableSize]; } /** Creates a new map identical to the specified map. */ public IntFloatMap (IntFloatMap map) { this((int)(map.keyTable.length * map.loadFactor), map.loadFactor); System.arraycopy(map.keyTable, 0, keyTable, 0, map.keyTable.length); System.arraycopy(map.valueTable, 0, valueTable, 0, map.valueTable.length); size = map.size; zeroValue = map.zeroValue; hasZeroValue = map.hasZeroValue; } /** Returns an index >= 0 and <= {@link #mask} for the specified {@code item}. * <p> * The default implementation uses Fibonacci hashing on the item's {@link Object#hashCode()}: the hashcode is multiplied by a * long constant (2 to the 64th, divided by the golden ratio) then the uppermost bits are shifted into the lowest positions to * obtain an index in the desired range. Multiplication by a long may be slower than int (eg on GWT) but greatly improves * rehashing, allowing even very poor hashcodes, such as those that only differ in their upper bits, to be used without high * collision rates. Fibonacci hashing has increased collision rates when all or most hashcodes are multiples of larger * Fibonacci numbers (see <a href= * "https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/">Malte * Skarupke's blog post</a>). * <p> * This method can be overriden to customizing hashing. This may be useful eg in the unlikely event that most hashcodes are * Fibonacci numbers, if keys provide poor or incorrect hashcodes, or to simplify hashing if keys provide high quality * hashcodes and don't need Fibonacci hashing: {@code return item.hashCode() & mask;} */ protected int place (int item) { return (int)(item * 0x9E3779B97F4A7C15L >>> shift); } /** Returns the index of the key if already present, else -(index + 1) for the next empty index. This can be overridden in this * pacakge to compare for equality differently than {@link Object#equals(Object)}. */ private int locateKey (int key) { int[] keyTable = this.keyTable; for (int i = place(key);; i = i + 1 & mask) { int other = keyTable[i]; if (other == 0) return -(i + 1); // Empty space is available. if (other == key) return i; // Same key was found. } } public void put (int key, float value) { if (key == 0) { zeroValue = value; if (!hasZeroValue) { hasZeroValue = true; size++; } return; } int i = locateKey(key); if (i >= 0) { // Existing key was found. valueTable[i] = value; return; } i = -(i + 1); // Empty space was found. keyTable[i] = key; valueTable[i] = value; if (++size >= threshold) resize(keyTable.length << 1); } /** Returns the old value associated with the specified key, or the specified default value. * @param defaultValue {@link Float#NaN} can be used for a value unlikely to be in the map. */ public float put (int key, float value, float defaultValue) { if (key == 0) { float oldValue = zeroValue; zeroValue = value; if (!hasZeroValue) { hasZeroValue = true; size++; return defaultValue; } return oldValue; } int i = locateKey(key); if (i >= 0) { // Existing key was found. float oldValue = valueTable[i]; valueTable[i] = value; return oldValue; } i = -(i + 1); // Empty space was found. keyTable[i] = key; valueTable[i] = value; if (++size >= threshold) resize(keyTable.length << 1); return defaultValue; } public void putAll (IntFloatMap map) { ensureCapacity(map.size); if (map.hasZeroValue) put(0, map.zeroValue); int[] keyTable = map.keyTable; float[] valueTable = map.valueTable; for (int i = 0, n = keyTable.length; i < n; i++) { int key = keyTable[i]; if (key != 0) put(key, valueTable[i]); } } /** Skips checks for existing keys, doesn't increment size, doesn't need to handle key 0. */ private void putResize (int key, float value) { int[] keyTable = this.keyTable; for (int i = place(key);; i = (i + 1) & mask) { if (keyTable[i] == 0) { keyTable[i] = key; valueTable[i] = value; return; } } } /** @param defaultValue {@link Float#NaN} can be used for a value unlikely to be in the map. */ public float get (int key, float defaultValue) { if (key == 0) return hasZeroValue ? zeroValue : defaultValue; int i = locateKey(key); return i >= 0 ? valueTable[i] : defaultValue; } /** Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is * put into the map and defaultValue is returned. */ public float getAndIncrement (int key, float defaultValue, float increment) { if (key == 0) { if (!hasZeroValue) { hasZeroValue = true; zeroValue = defaultValue + increment; size++; return defaultValue; } float oldValue = zeroValue; zeroValue += increment; return oldValue; } int i = locateKey(key); if (i >= 0) { // Existing key was found. float oldValue = valueTable[i]; valueTable[i] += increment; return oldValue; } i = -(i + 1); // Empty space was found. keyTable[i] = key; valueTable[i] = defaultValue + increment; if (++size >= threshold) resize(keyTable.length << 1); return defaultValue; } /** Returns the value for the removed key, or the default value if the key is not in the map. * @param defaultValue {@link Float#NaN} can be used for a value unlikely to be in the map. */ public float remove (int key, float defaultValue) { if (key == 0) { if (!hasZeroValue) return defaultValue; hasZeroValue = false; size--; return zeroValue; } int i = locateKey(key); if (i < 0) return defaultValue; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; float oldValue = valueTable[i]; int mask = this.mask, next = i + 1 & mask; while ((key = keyTable[next]) != 0) { int placement = place(key); if ((next - placement & mask) > (i - placement & mask)) { keyTable[i] = key; valueTable[i] = valueTable[next]; i = next; } next = next + 1 & mask; } keyTable[i] = 0; size--; return oldValue; } /** Returns true if the map has one or more items. */ public boolean notEmpty () { return size > 0; } /** Returns true if the map is empty. */ public boolean isEmpty () { return size == 0; } /** Reduces the size of the backing arrays to be the specified capacity / loadFactor, or less. If the capacity is already less, * nothing is done. If the map contains more items than the specified capacity, the next highest power of two capacity is used * instead. */ public void shrink (int maximumCapacity) { if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity); int tableSize = tableSize(maximumCapacity, loadFactor); if (keyTable.length > tableSize) resize(tableSize); } /** Clears the map and reduces the size of the backing arrays to be the specified capacity / loadFactor, if they are larger. */ public void clear (int maximumCapacity) { int tableSize = tableSize(maximumCapacity, loadFactor); if (keyTable.length <= tableSize) { clear(); return; } size = 0; hasZeroValue = false; resize(tableSize); } public void clear () { if (size == 0) return; Arrays.fill(keyTable, 0); size = 0; hasZeroValue = false; } /** Returns true if the specified value is in the map. Note this traverses the entire map and compares every value, which may * be an expensive operation. */ public boolean containsValue (float value) { if (hasZeroValue && zeroValue == value) return true; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && valueTable[i] == value) return true; return false; } /** Returns true if the specified value is in the map. Note this traverses the entire map and compares every value, which may * be an expensive operation. */ public boolean containsValue (float value, float epsilon) { if (hasZeroValue && Math.abs(zeroValue - value) <= epsilon) return true; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && Math.abs(valueTable[i] - value) <= epsilon) return true; return false; } public boolean containsKey (int key) { if (key == 0) return hasZeroValue; return locateKey(key) >= 0; } /** Returns the key for the specified value, or notFound if it is not in the map. Note this traverses the entire map and * compares every value, which may be an expensive operation. */ public int findKey (float value, int notFound) { if (hasZeroValue && zeroValue == value) return 0; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && valueTable[i] == value) return keyTable[i]; return notFound; } /** Returns the key for the specified value, or notFound if it is not in the map. Note this traverses the entire map and * compares every value, which may be an expensive operation. */ public int findKey (float value, float epsilon, int notFound) { if (hasZeroValue && Math.abs(zeroValue - value) <= epsilon) return 0; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && Math.abs(valueTable[i] - value) <= epsilon) return keyTable[i]; return notFound; } /** Increases the size of the backing array to accommodate the specified number of additional items / loadFactor. Useful before * adding many items to avoid multiple backing array resizes. */ public void ensureCapacity (int additionalCapacity) { int tableSize = tableSize(size + additionalCapacity, loadFactor); if (keyTable.length < tableSize) resize(tableSize); } private void resize (int newSize) { int oldCapacity = keyTable.length; threshold = (int)(newSize * loadFactor); mask = newSize - 1; shift = Long.numberOfLeadingZeros(mask); int[] oldKeyTable = keyTable; float[] oldValueTable = valueTable; keyTable = new int[newSize]; valueTable = new float[newSize]; if (size > 0) { for (int i = 0; i < oldCapacity; i++) { int key = oldKeyTable[i]; if (key != 0) putResize(key, oldValueTable[i]); } } } public int hashCode () { int h = size; if (hasZeroValue) h += NumberUtils.floatToRawIntBits(zeroValue); int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = 0, n = keyTable.length; i < n; i++) { int key = keyTable[i]; if (key != 0) h += key * 31 + NumberUtils.floatToRawIntBits(valueTable[i]); } return h; } public boolean equals (Object obj) { if (obj == this) return true; if (!(obj instanceof IntFloatMap)) return false; IntFloatMap other = (IntFloatMap)obj; if (other.size != size) return false; if (other.hasZeroValue != hasZeroValue) return false; if (hasZeroValue) { if (other.zeroValue != zeroValue) return false; } int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = 0, n = keyTable.length; i < n; i++) { int key = keyTable[i]; if (key != 0) { float otherValue = other.get(key, 0f); if (otherValue == 0f && !other.containsKey(key)) return false; if (otherValue != valueTable[i]) return false; } } return true; } public String toString () { if (size == 0) return "[]"; java.lang.StringBuilder buffer = new java.lang.StringBuilder(32); buffer.append('['); int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; int i = keyTable.length; if (hasZeroValue) { buffer.append("0="); buffer.append(zeroValue); } else { while (i-- > 0) { int key = keyTable[i]; if (key == 0) continue; buffer.append(key); buffer.append('='); buffer.append(valueTable[i]); break; } } while (i-- > 0) { int key = keyTable[i]; if (key == 0) continue; buffer.append(", "); buffer.append(key); buffer.append('='); buffer.append(valueTable[i]); } buffer.append(']'); return buffer.toString(); } public Iterator<Entry> iterator () { return entries(); } /** Returns an iterator for the entries in the map. Remove is supported. * <p> * If {@link Collections#allocateIterators} is false, the same iterator instance is returned each time this method is called. * Use the {@link Entries} constructor for nested or multithreaded iteration. */ public Entries entries () { if (Collections.allocateIterators) return new Entries(this); if (entries1 == null) { entries1 = new Entries(this); entries2 = new Entries(this); } if (!entries1.valid) { entries1.reset(); entries1.valid = true; entries2.valid = false; return entries1; } entries2.reset(); entries2.valid = true; entries1.valid = false; return entries2; } /** Returns an iterator for the values in the map. Remove is supported. * <p> * If {@link Collections#allocateIterators} is false, the same iterator instance is returned each time this method is called. * Use the {@link Entries} constructor for nested or multithreaded iteration. */ public Values values () { if (Collections.allocateIterators) return new Values(this); if (values1 == null) { values1 = new Values(this); values2 = new Values(this); } if (!values1.valid) { values1.reset(); values1.valid = true; values2.valid = false; return values1; } values2.reset(); values2.valid = true; values1.valid = false; return values2; } /** Returns an iterator for the keys in the map. Remove is supported. * <p> * If {@link Collections#allocateIterators} is false, the same iterator instance is returned each time this method is called. * Use the {@link Entries} constructor for nested or multithreaded iteration. */ public Keys keys () { if (Collections.allocateIterators) return new Keys(this); if (keys1 == null) { keys1 = new Keys(this); keys2 = new Keys(this); } if (!keys1.valid) { keys1.reset(); keys1.valid = true; keys2.valid = false; return keys1; } keys2.reset(); keys2.valid = true; keys1.valid = false; return keys2; } static public class Entry { public int key; public float value; public String toString () { return key + "=" + value; } } static private class MapIterator { static private final int INDEX_ILLEGAL = -2; static final int INDEX_ZERO = -1; public boolean hasNext; final IntFloatMap map; int nextIndex, currentIndex; boolean valid = true; public MapIterator (IntFloatMap map) { this.map = map; reset(); } public void reset () { currentIndex = INDEX_ILLEGAL; nextIndex = INDEX_ZERO; if (map.hasZeroValue) hasNext = true; else findNextIndex(); } void findNextIndex () { int[] keyTable = map.keyTable; for (int n = keyTable.length; ++nextIndex < n;) { if (keyTable[nextIndex] != 0) { hasNext = true; return; } } hasNext = false; } public void remove () { int i = currentIndex; if (i == INDEX_ZERO && map.hasZeroValue) { map.hasZeroValue = false; } else if (i < 0) { throw new IllegalStateException("next must be called before remove."); } else { int[] keyTable = map.keyTable; float[] valueTable = map.valueTable; int mask = map.mask, next = i + 1 & mask, key; while ((key = keyTable[next]) != 0) { int placement = map.place(key); if ((next - placement & mask) > (i - placement & mask)) { keyTable[i] = key; valueTable[i] = valueTable[next]; i = next; } next = next + 1 & mask; } keyTable[i] = 0; if (i != currentIndex) --nextIndex; } currentIndex = INDEX_ILLEGAL; map.size--; } } static public class Entries extends MapIterator implements Iterable<Entry>, Iterator<Entry> { private final Entry entry = new Entry(); public Entries (IntFloatMap map) { super(map); } /** Note the same entry instance is returned each time this method is called. */ public Entry next () { if (!hasNext) throw new NoSuchElementException(); if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); int[] keyTable = map.keyTable; if (nextIndex == INDEX_ZERO) { entry.key = 0; entry.value = map.zeroValue; } else { entry.key = keyTable[nextIndex]; entry.value = map.valueTable[nextIndex]; } currentIndex = nextIndex; findNextIndex(); return entry; } public boolean hasNext () { if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); return hasNext; } public Iterator<Entry> iterator () { return this; } public void remove () { super.remove(); } } static public class Values extends MapIterator { public Values (IntFloatMap map) { super(map); } public boolean hasNext () { if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); return hasNext; } public float next () { if (!hasNext) throw new NoSuchElementException(); if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); float value = nextIndex == INDEX_ZERO ? map.zeroValue : map.valueTable[nextIndex]; currentIndex = nextIndex; findNextIndex(); return value; } public Values iterator () { return this; } /** Returns a new array containing the remaining values. */ public FloatArray toArray () { FloatArray array = new FloatArray(true, map.size); while (hasNext) array.add(next()); return array; } /** Adds the remaining values to the specified array. */ public FloatArray toArray (FloatArray array) { while (hasNext) array.add(next()); return array; } } static public class Keys extends MapIterator { public Keys (IntFloatMap map) { super(map); } public int next () { if (!hasNext) throw new NoSuchElementException(); if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); int key = nextIndex == INDEX_ZERO ? 0 : map.keyTable[nextIndex]; currentIndex = nextIndex; findNextIndex(); return key; } /** Returns a new array containing the remaining keys. */ public IntArray toArray () { IntArray array = new IntArray(true, map.size); while (hasNext) array.add(next()); return array; } /** Adds the remaining values to the specified array. */ public IntArray toArray (IntArray array) { while (hasNext) array.add(next()); return array; } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils; import java.util.Arrays; import java.util.Iterator; import java.util.NoSuchElementException; import static com.badlogic.gdx.utils.ObjectSet.tableSize; /** An unordered map where the keys are unboxed ints and values are unboxed floats. No allocation is done except when growing the * table size. * <p> * This class performs fast contains and remove (typically O(1), worst case O(n) but that is rare in practice). Add may be * slightly slower, depending on hash collisions. Hashcodes are rehashed to reduce collisions and the need to resize. Load factors * greater than 0.91 greatly increase the chances to resize to the next higher POT size. * <p> * Unordered sets and maps are not designed to provide especially fast iteration. Iteration is faster with OrderedSet and * OrderedMap. * <p> * This implementation uses linear probing with the backward shift algorithm for removal. Hashcodes are rehashed using Fibonacci * hashing, instead of the more common power-of-two mask, to better distribute poor hashCodes (see <a href= * "https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/">Malte * Skarupke's blog post</a>). Linear probing continues to work even when all hashCodes collide, just more slowly. * @author Nathan Sweet * @author Tommy Ettinger */ public class IntFloatMap implements Iterable<IntFloatMap.Entry> { public int size; int[] keyTable; float[] valueTable; float zeroValue; boolean hasZeroValue; private final float loadFactor; private int threshold; /** Used by {@link #place(int)} to bit shift the upper bits of a {@code long} into a usable range (&gt;= 0 and &lt;= * {@link #mask}). The shift can be negative, which is convenient to match the number of bits in mask: if mask is a 7-bit * number, a shift of -7 shifts the upper 7 bits into the lowest 7 positions. This class sets the shift &gt; 32 and &lt; 64, * which if used with an int will still move the upper bits of an int to the lower bits due to Java's implicit modulus on * shifts. * <p> * {@link #mask} can also be used to mask the low bits of a number, which may be faster for some hashcodes, if * {@link #place(int)} is overridden. */ protected int shift; /** A bitmask used to confine hashcodes to the size of the table. Must be all 1 bits in its low positions, ie a power of two * minus 1. If {@link #place(int)} is overriden, this can be used instead of {@link #shift} to isolate usable bits of a * hash. */ protected int mask; private transient Entries entries1, entries2; private transient Values values1, values2; private transient Keys keys1, keys2; /** Creates a new map with an initial capacity of 51 and a load factor of 0.8. */ public IntFloatMap () { this(51, 0.8f); } /** Creates a new map with a load factor of 0.8. * * @param initialCapacity The backing array size is initialCapacity / loadFactor, increased to the next power of two. */ public IntFloatMap (int initialCapacity) { this(initialCapacity, 0.8f); } /** Creates a new map with the specified initial capacity and load factor. This map will hold initialCapacity items before * growing the backing table. * @param initialCapacity The backing array size is initialCapacity / loadFactor, increased to the next power of two. */ public IntFloatMap (int initialCapacity, float loadFactor) { if (loadFactor <= 0f || loadFactor >= 1f) throw new IllegalArgumentException("loadFactor must be > 0 and < 1: " + loadFactor); this.loadFactor = loadFactor; int tableSize = tableSize(initialCapacity, loadFactor); threshold = (int)(tableSize * loadFactor); mask = tableSize - 1; shift = Long.numberOfLeadingZeros(mask); keyTable = new int[tableSize]; valueTable = new float[tableSize]; } /** Creates a new map identical to the specified map. */ public IntFloatMap (IntFloatMap map) { this((int)(map.keyTable.length * map.loadFactor), map.loadFactor); System.arraycopy(map.keyTable, 0, keyTable, 0, map.keyTable.length); System.arraycopy(map.valueTable, 0, valueTable, 0, map.valueTable.length); size = map.size; zeroValue = map.zeroValue; hasZeroValue = map.hasZeroValue; } /** Returns an index >= 0 and <= {@link #mask} for the specified {@code item}. * <p> * The default implementation uses Fibonacci hashing on the item's {@link Object#hashCode()}: the hashcode is multiplied by a * long constant (2 to the 64th, divided by the golden ratio) then the uppermost bits are shifted into the lowest positions to * obtain an index in the desired range. Multiplication by a long may be slower than int (eg on GWT) but greatly improves * rehashing, allowing even very poor hashcodes, such as those that only differ in their upper bits, to be used without high * collision rates. Fibonacci hashing has increased collision rates when all or most hashcodes are multiples of larger * Fibonacci numbers (see <a href= * "https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/">Malte * Skarupke's blog post</a>). * <p> * This method can be overriden to customizing hashing. This may be useful eg in the unlikely event that most hashcodes are * Fibonacci numbers, if keys provide poor or incorrect hashcodes, or to simplify hashing if keys provide high quality * hashcodes and don't need Fibonacci hashing: {@code return item.hashCode() & mask;} */ protected int place (int item) { return (int)(item * 0x9E3779B97F4A7C15L >>> shift); } /** Returns the index of the key if already present, else -(index + 1) for the next empty index. This can be overridden in this * pacakge to compare for equality differently than {@link Object#equals(Object)}. */ private int locateKey (int key) { int[] keyTable = this.keyTable; for (int i = place(key);; i = i + 1 & mask) { int other = keyTable[i]; if (other == 0) return -(i + 1); // Empty space is available. if (other == key) return i; // Same key was found. } } public void put (int key, float value) { if (key == 0) { zeroValue = value; if (!hasZeroValue) { hasZeroValue = true; size++; } return; } int i = locateKey(key); if (i >= 0) { // Existing key was found. valueTable[i] = value; return; } i = -(i + 1); // Empty space was found. keyTable[i] = key; valueTable[i] = value; if (++size >= threshold) resize(keyTable.length << 1); } /** Returns the old value associated with the specified key, or the specified default value. * @param defaultValue {@link Float#NaN} can be used for a value unlikely to be in the map. */ public float put (int key, float value, float defaultValue) { if (key == 0) { float oldValue = zeroValue; zeroValue = value; if (!hasZeroValue) { hasZeroValue = true; size++; return defaultValue; } return oldValue; } int i = locateKey(key); if (i >= 0) { // Existing key was found. float oldValue = valueTable[i]; valueTable[i] = value; return oldValue; } i = -(i + 1); // Empty space was found. keyTable[i] = key; valueTable[i] = value; if (++size >= threshold) resize(keyTable.length << 1); return defaultValue; } public void putAll (IntFloatMap map) { ensureCapacity(map.size); if (map.hasZeroValue) put(0, map.zeroValue); int[] keyTable = map.keyTable; float[] valueTable = map.valueTable; for (int i = 0, n = keyTable.length; i < n; i++) { int key = keyTable[i]; if (key != 0) put(key, valueTable[i]); } } /** Skips checks for existing keys, doesn't increment size, doesn't need to handle key 0. */ private void putResize (int key, float value) { int[] keyTable = this.keyTable; for (int i = place(key);; i = (i + 1) & mask) { if (keyTable[i] == 0) { keyTable[i] = key; valueTable[i] = value; return; } } } /** @param defaultValue {@link Float#NaN} can be used for a value unlikely to be in the map. */ public float get (int key, float defaultValue) { if (key == 0) return hasZeroValue ? zeroValue : defaultValue; int i = locateKey(key); return i >= 0 ? valueTable[i] : defaultValue; } /** Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is * put into the map and defaultValue is returned. */ public float getAndIncrement (int key, float defaultValue, float increment) { if (key == 0) { if (!hasZeroValue) { hasZeroValue = true; zeroValue = defaultValue + increment; size++; return defaultValue; } float oldValue = zeroValue; zeroValue += increment; return oldValue; } int i = locateKey(key); if (i >= 0) { // Existing key was found. float oldValue = valueTable[i]; valueTable[i] += increment; return oldValue; } i = -(i + 1); // Empty space was found. keyTable[i] = key; valueTable[i] = defaultValue + increment; if (++size >= threshold) resize(keyTable.length << 1); return defaultValue; } /** Returns the value for the removed key, or the default value if the key is not in the map. * @param defaultValue {@link Float#NaN} can be used for a value unlikely to be in the map. */ public float remove (int key, float defaultValue) { if (key == 0) { if (!hasZeroValue) return defaultValue; hasZeroValue = false; size--; return zeroValue; } int i = locateKey(key); if (i < 0) return defaultValue; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; float oldValue = valueTable[i]; int mask = this.mask, next = i + 1 & mask; while ((key = keyTable[next]) != 0) { int placement = place(key); if ((next - placement & mask) > (i - placement & mask)) { keyTable[i] = key; valueTable[i] = valueTable[next]; i = next; } next = next + 1 & mask; } keyTable[i] = 0; size--; return oldValue; } /** Returns true if the map has one or more items. */ public boolean notEmpty () { return size > 0; } /** Returns true if the map is empty. */ public boolean isEmpty () { return size == 0; } /** Reduces the size of the backing arrays to be the specified capacity / loadFactor, or less. If the capacity is already less, * nothing is done. If the map contains more items than the specified capacity, the next highest power of two capacity is used * instead. */ public void shrink (int maximumCapacity) { if (maximumCapacity < 0) throw new IllegalArgumentException("maximumCapacity must be >= 0: " + maximumCapacity); int tableSize = tableSize(maximumCapacity, loadFactor); if (keyTable.length > tableSize) resize(tableSize); } /** Clears the map and reduces the size of the backing arrays to be the specified capacity / loadFactor, if they are larger. */ public void clear (int maximumCapacity) { int tableSize = tableSize(maximumCapacity, loadFactor); if (keyTable.length <= tableSize) { clear(); return; } size = 0; hasZeroValue = false; resize(tableSize); } public void clear () { if (size == 0) return; Arrays.fill(keyTable, 0); size = 0; hasZeroValue = false; } /** Returns true if the specified value is in the map. Note this traverses the entire map and compares every value, which may * be an expensive operation. */ public boolean containsValue (float value) { if (hasZeroValue && zeroValue == value) return true; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && valueTable[i] == value) return true; return false; } /** Returns true if the specified value is in the map. Note this traverses the entire map and compares every value, which may * be an expensive operation. */ public boolean containsValue (float value, float epsilon) { if (hasZeroValue && Math.abs(zeroValue - value) <= epsilon) return true; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && Math.abs(valueTable[i] - value) <= epsilon) return true; return false; } public boolean containsKey (int key) { if (key == 0) return hasZeroValue; return locateKey(key) >= 0; } /** Returns the key for the specified value, or notFound if it is not in the map. Note this traverses the entire map and * compares every value, which may be an expensive operation. */ public int findKey (float value, int notFound) { if (hasZeroValue && zeroValue == value) return 0; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && valueTable[i] == value) return keyTable[i]; return notFound; } /** Returns the key for the specified value, or notFound if it is not in the map. Note this traverses the entire map and * compares every value, which may be an expensive operation. */ public int findKey (float value, float epsilon, int notFound) { if (hasZeroValue && Math.abs(zeroValue - value) <= epsilon) return 0; int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = valueTable.length - 1; i >= 0; i--) if (keyTable[i] != 0 && Math.abs(valueTable[i] - value) <= epsilon) return keyTable[i]; return notFound; } /** Increases the size of the backing array to accommodate the specified number of additional items / loadFactor. Useful before * adding many items to avoid multiple backing array resizes. */ public void ensureCapacity (int additionalCapacity) { int tableSize = tableSize(size + additionalCapacity, loadFactor); if (keyTable.length < tableSize) resize(tableSize); } private void resize (int newSize) { int oldCapacity = keyTable.length; threshold = (int)(newSize * loadFactor); mask = newSize - 1; shift = Long.numberOfLeadingZeros(mask); int[] oldKeyTable = keyTable; float[] oldValueTable = valueTable; keyTable = new int[newSize]; valueTable = new float[newSize]; if (size > 0) { for (int i = 0; i < oldCapacity; i++) { int key = oldKeyTable[i]; if (key != 0) putResize(key, oldValueTable[i]); } } } public int hashCode () { int h = size; if (hasZeroValue) h += NumberUtils.floatToRawIntBits(zeroValue); int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = 0, n = keyTable.length; i < n; i++) { int key = keyTable[i]; if (key != 0) h += key * 31 + NumberUtils.floatToRawIntBits(valueTable[i]); } return h; } public boolean equals (Object obj) { if (obj == this) return true; if (!(obj instanceof IntFloatMap)) return false; IntFloatMap other = (IntFloatMap)obj; if (other.size != size) return false; if (other.hasZeroValue != hasZeroValue) return false; if (hasZeroValue) { if (other.zeroValue != zeroValue) return false; } int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; for (int i = 0, n = keyTable.length; i < n; i++) { int key = keyTable[i]; if (key != 0) { float otherValue = other.get(key, 0f); if (otherValue == 0f && !other.containsKey(key)) return false; if (otherValue != valueTable[i]) return false; } } return true; } public String toString () { if (size == 0) return "[]"; java.lang.StringBuilder buffer = new java.lang.StringBuilder(32); buffer.append('['); int[] keyTable = this.keyTable; float[] valueTable = this.valueTable; int i = keyTable.length; if (hasZeroValue) { buffer.append("0="); buffer.append(zeroValue); } else { while (i-- > 0) { int key = keyTable[i]; if (key == 0) continue; buffer.append(key); buffer.append('='); buffer.append(valueTable[i]); break; } } while (i-- > 0) { int key = keyTable[i]; if (key == 0) continue; buffer.append(", "); buffer.append(key); buffer.append('='); buffer.append(valueTable[i]); } buffer.append(']'); return buffer.toString(); } public Iterator<Entry> iterator () { return entries(); } /** Returns an iterator for the entries in the map. Remove is supported. * <p> * If {@link Collections#allocateIterators} is false, the same iterator instance is returned each time this method is called. * Use the {@link Entries} constructor for nested or multithreaded iteration. */ public Entries entries () { if (Collections.allocateIterators) return new Entries(this); if (entries1 == null) { entries1 = new Entries(this); entries2 = new Entries(this); } if (!entries1.valid) { entries1.reset(); entries1.valid = true; entries2.valid = false; return entries1; } entries2.reset(); entries2.valid = true; entries1.valid = false; return entries2; } /** Returns an iterator for the values in the map. Remove is supported. * <p> * If {@link Collections#allocateIterators} is false, the same iterator instance is returned each time this method is called. * Use the {@link Entries} constructor for nested or multithreaded iteration. */ public Values values () { if (Collections.allocateIterators) return new Values(this); if (values1 == null) { values1 = new Values(this); values2 = new Values(this); } if (!values1.valid) { values1.reset(); values1.valid = true; values2.valid = false; return values1; } values2.reset(); values2.valid = true; values1.valid = false; return values2; } /** Returns an iterator for the keys in the map. Remove is supported. * <p> * If {@link Collections#allocateIterators} is false, the same iterator instance is returned each time this method is called. * Use the {@link Entries} constructor for nested or multithreaded iteration. */ public Keys keys () { if (Collections.allocateIterators) return new Keys(this); if (keys1 == null) { keys1 = new Keys(this); keys2 = new Keys(this); } if (!keys1.valid) { keys1.reset(); keys1.valid = true; keys2.valid = false; return keys1; } keys2.reset(); keys2.valid = true; keys1.valid = false; return keys2; } static public class Entry { public int key; public float value; public String toString () { return key + "=" + value; } } static private class MapIterator { static private final int INDEX_ILLEGAL = -2; static final int INDEX_ZERO = -1; public boolean hasNext; final IntFloatMap map; int nextIndex, currentIndex; boolean valid = true; public MapIterator (IntFloatMap map) { this.map = map; reset(); } public void reset () { currentIndex = INDEX_ILLEGAL; nextIndex = INDEX_ZERO; if (map.hasZeroValue) hasNext = true; else findNextIndex(); } void findNextIndex () { int[] keyTable = map.keyTable; for (int n = keyTable.length; ++nextIndex < n;) { if (keyTable[nextIndex] != 0) { hasNext = true; return; } } hasNext = false; } public void remove () { int i = currentIndex; if (i == INDEX_ZERO && map.hasZeroValue) { map.hasZeroValue = false; } else if (i < 0) { throw new IllegalStateException("next must be called before remove."); } else { int[] keyTable = map.keyTable; float[] valueTable = map.valueTable; int mask = map.mask, next = i + 1 & mask, key; while ((key = keyTable[next]) != 0) { int placement = map.place(key); if ((next - placement & mask) > (i - placement & mask)) { keyTable[i] = key; valueTable[i] = valueTable[next]; i = next; } next = next + 1 & mask; } keyTable[i] = 0; if (i != currentIndex) --nextIndex; } currentIndex = INDEX_ILLEGAL; map.size--; } } static public class Entries extends MapIterator implements Iterable<Entry>, Iterator<Entry> { private final Entry entry = new Entry(); public Entries (IntFloatMap map) { super(map); } /** Note the same entry instance is returned each time this method is called. */ public Entry next () { if (!hasNext) throw new NoSuchElementException(); if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); int[] keyTable = map.keyTable; if (nextIndex == INDEX_ZERO) { entry.key = 0; entry.value = map.zeroValue; } else { entry.key = keyTable[nextIndex]; entry.value = map.valueTable[nextIndex]; } currentIndex = nextIndex; findNextIndex(); return entry; } public boolean hasNext () { if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); return hasNext; } public Iterator<Entry> iterator () { return this; } public void remove () { super.remove(); } } static public class Values extends MapIterator { public Values (IntFloatMap map) { super(map); } public boolean hasNext () { if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); return hasNext; } public float next () { if (!hasNext) throw new NoSuchElementException(); if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); float value = nextIndex == INDEX_ZERO ? map.zeroValue : map.valueTable[nextIndex]; currentIndex = nextIndex; findNextIndex(); return value; } public Values iterator () { return this; } /** Returns a new array containing the remaining values. */ public FloatArray toArray () { FloatArray array = new FloatArray(true, map.size); while (hasNext) array.add(next()); return array; } /** Adds the remaining values to the specified array. */ public FloatArray toArray (FloatArray array) { while (hasNext) array.add(next()); return array; } } static public class Keys extends MapIterator { public Keys (IntFloatMap map) { super(map); } public int next () { if (!hasNext) throw new NoSuchElementException(); if (!valid) throw new GdxRuntimeException("#iterator() cannot be used nested."); int key = nextIndex == INDEX_ZERO ? 0 : map.keyTable[nextIndex]; currentIndex = nextIndex; findNextIndex(); return key; } /** Returns a new array containing the remaining keys. */ public IntArray toArray () { IntArray array = new IntArray(true, map.size); while (hasNext) array.add(next()); return array; } /** Adds the remaining values to the specified array. */ public IntArray toArray (IntArray array) { while (hasNext) array.add(next()); return array; } } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests/src/com/badlogic/gdx/tests/ParticleEmittersTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputAdapter; import com.badlogic.gdx.InputMultiplexer; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.ParticleEffect; import com.badlogic.gdx.graphics.g2d.ParticleEffectPool; import com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect; import com.badlogic.gdx.graphics.g2d.ParticleEmitter; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Button; import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.viewport.ExtendViewport; public class ParticleEmittersTest extends GdxTest { private SpriteBatch spriteBatch; ParticleEffect effect; ParticleEffectPool effectPool; Array<PooledEffect> effects = new Array(); PooledEffect latestEffect; float fpsCounter; Stage ui; CheckBox skipCleanup; Button clearEmitters, scaleEffects; Label logLabel; @Override public void create () { spriteBatch = new SpriteBatch(); effect = new ParticleEffect(); effect.load(Gdx.files.internal("data/singleTextureAllAdditive.p"), Gdx.files.internal("data")); effect.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2); effectPool = new ParticleEffectPool(effect, 20, 20); setupUI(); InputProcessor inputProcessor = new InputAdapter() { public boolean touchDragged (int x, int y, int pointer) { if (latestEffect != null) latestEffect.setPosition(x, Gdx.graphics.getHeight() - y); return false; } public boolean touchDown (int x, int y, int pointer, int newParam) { latestEffect = effectPool.obtain(); latestEffect.setEmittersCleanUpBlendFunction(!skipCleanup.isChecked()); latestEffect.setPosition(x, Gdx.graphics.getHeight() - y); effects.add(latestEffect); return false; } }; InputMultiplexer multiplexer = new InputMultiplexer(); multiplexer.addProcessor(ui); multiplexer.addProcessor(inputProcessor); Gdx.input.setInputProcessor(multiplexer); } @Override public void dispose () { spriteBatch.dispose(); effect.dispose(); } @Override public void resize (int width, int height) { ui.getViewport().update(width, height); } public void render () { ui.act(); spriteBatch.getProjectionMatrix().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); float delta = Gdx.graphics.getDeltaTime(); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); spriteBatch.begin(); for (ParticleEffect e : effects) e.draw(spriteBatch, delta); spriteBatch.end(); fpsCounter += delta; if (fpsCounter > 3) { fpsCounter = 0; String log = effects.size + " particle effects, FPS: " + Gdx.graphics.getFramesPerSecond() + ", Render calls: " + spriteBatch.renderCalls; Gdx.app.log("libGDX", log); logLabel.setText(log); } ui.draw(); } public boolean needsGL20 () { return false; } private void setupUI () { ui = new Stage(new ExtendViewport(640, 480)); Skin skin = new Skin(Gdx.files.internal("data/uiskin.json")); skipCleanup = new CheckBox("Skip blend function clean-up", skin); skipCleanup.addListener(listener); logLabel = new Label("", skin.get(LabelStyle.class)); clearEmitters = new TextButton("Clear screen", skin); clearEmitters.addListener(listener); scaleEffects = new TextButton("Scale existing effects", skin); scaleEffects.addListener(listener); Table table = new Table(); table.setTransform(false); table.setFillParent(true); table.defaults().padTop(5).left(); table.top().left().padLeft(5); table.add(skipCleanup).colspan(2).row(); table.add(clearEmitters).spaceRight(10); table.add(scaleEffects).row(); table.add(logLabel).colspan(2); ui.addActor(table); } void updateSkipCleanupState () { for (ParticleEffect eff : effects) { for (ParticleEmitter e : eff.getEmitters()) e.setCleansUpBlendFunction(!skipCleanup.isChecked()); } } ChangeListener listener = new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { if (actor == skipCleanup) { updateSkipCleanupState(); } else if (actor == clearEmitters) { for (PooledEffect e : effects) e.free(); effects.clear(); } else if (actor == scaleEffects) { for (ParticleEffect eff : effects) { eff.scaleEffect(1.5f); } } } }; }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputAdapter; import com.badlogic.gdx.InputMultiplexer; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.ParticleEffect; import com.badlogic.gdx.graphics.g2d.ParticleEffectPool; import com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect; import com.badlogic.gdx.graphics.g2d.ParticleEmitter; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Button; import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.viewport.ExtendViewport; public class ParticleEmittersTest extends GdxTest { private SpriteBatch spriteBatch; ParticleEffect effect; ParticleEffectPool effectPool; Array<PooledEffect> effects = new Array(); PooledEffect latestEffect; float fpsCounter; Stage ui; CheckBox skipCleanup; Button clearEmitters, scaleEffects; Label logLabel; @Override public void create () { spriteBatch = new SpriteBatch(); effect = new ParticleEffect(); effect.load(Gdx.files.internal("data/singleTextureAllAdditive.p"), Gdx.files.internal("data")); effect.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2); effectPool = new ParticleEffectPool(effect, 20, 20); setupUI(); InputProcessor inputProcessor = new InputAdapter() { public boolean touchDragged (int x, int y, int pointer) { if (latestEffect != null) latestEffect.setPosition(x, Gdx.graphics.getHeight() - y); return false; } public boolean touchDown (int x, int y, int pointer, int newParam) { latestEffect = effectPool.obtain(); latestEffect.setEmittersCleanUpBlendFunction(!skipCleanup.isChecked()); latestEffect.setPosition(x, Gdx.graphics.getHeight() - y); effects.add(latestEffect); return false; } }; InputMultiplexer multiplexer = new InputMultiplexer(); multiplexer.addProcessor(ui); multiplexer.addProcessor(inputProcessor); Gdx.input.setInputProcessor(multiplexer); } @Override public void dispose () { spriteBatch.dispose(); effect.dispose(); } @Override public void resize (int width, int height) { ui.getViewport().update(width, height); } public void render () { ui.act(); spriteBatch.getProjectionMatrix().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); float delta = Gdx.graphics.getDeltaTime(); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); spriteBatch.begin(); for (ParticleEffect e : effects) e.draw(spriteBatch, delta); spriteBatch.end(); fpsCounter += delta; if (fpsCounter > 3) { fpsCounter = 0; String log = effects.size + " particle effects, FPS: " + Gdx.graphics.getFramesPerSecond() + ", Render calls: " + spriteBatch.renderCalls; Gdx.app.log("libGDX", log); logLabel.setText(log); } ui.draw(); } public boolean needsGL20 () { return false; } private void setupUI () { ui = new Stage(new ExtendViewport(640, 480)); Skin skin = new Skin(Gdx.files.internal("data/uiskin.json")); skipCleanup = new CheckBox("Skip blend function clean-up", skin); skipCleanup.addListener(listener); logLabel = new Label("", skin.get(LabelStyle.class)); clearEmitters = new TextButton("Clear screen", skin); clearEmitters.addListener(listener); scaleEffects = new TextButton("Scale existing effects", skin); scaleEffects.addListener(listener); Table table = new Table(); table.setTransform(false); table.setFillParent(true); table.defaults().padTop(5).left(); table.top().left().padLeft(5); table.add(skipCleanup).colspan(2).row(); table.add(clearEmitters).spaceRight(10); table.add(scaleEffects).row(); table.add(logLabel).colspan(2); ui.addActor(table); } void updateSkipCleanupState () { for (ParticleEffect eff : effects) { for (ParticleEmitter e : eff.getEmitters()) e.setCleansUpBlendFunction(!skipCleanup.isChecked()); } } ChangeListener listener = new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { if (actor == skipCleanup) { updateSkipCleanupState(); } else if (actor == clearEmitters) { for (PooledEffect e : effects) e.free(); effects.clear(); } else if (actor == scaleEffects) { for (ParticleEffect eff : effects) { eff.scaleEffect(1.5f); } } } }; }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-bullet/jni/src/bullet/BulletCollision/CollisionDispatch/btGhostObject.cpp
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2008 Erwin Coumans http://bulletphysics.com This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btGhostObject.h" #include "btCollisionWorld.h" #include "BulletCollision/CollisionShapes/btConvexShape.h" #include "LinearMath/btAabbUtil2.h" btGhostObject::btGhostObject() { m_internalType = CO_GHOST_OBJECT; } btGhostObject::~btGhostObject() { ///btGhostObject should have been removed from the world, so no overlapping objects btAssert(!m_overlappingObjects.size()); } void btGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy) { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); ///if this linearSearch becomes too slow (too many overlapping objects) we should add a more appropriate data structure int index = m_overlappingObjects.findLinearSearch(otherObject); if (index==m_overlappingObjects.size()) { //not found m_overlappingObjects.push_back(otherObject); } } void btGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy) { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); int index = m_overlappingObjects.findLinearSearch(otherObject); if (index<m_overlappingObjects.size()) { m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1]; m_overlappingObjects.pop_back(); } } btPairCachingGhostObject::btPairCachingGhostObject() { m_hashPairCache = new (btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache(); } btPairCachingGhostObject::~btPairCachingGhostObject() { m_hashPairCache->~btHashedOverlappingPairCache(); btAlignedFree( m_hashPairCache ); } void btPairCachingGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy) { btBroadphaseProxy*actualThisProxy = thisProxy ? thisProxy : getBroadphaseHandle(); btAssert(actualThisProxy); btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); int index = m_overlappingObjects.findLinearSearch(otherObject); if (index==m_overlappingObjects.size()) { m_overlappingObjects.push_back(otherObject); m_hashPairCache->addOverlappingPair(actualThisProxy,otherProxy); } } void btPairCachingGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy1) { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btBroadphaseProxy* actualThisProxy = thisProxy1 ? thisProxy1 : getBroadphaseHandle(); btAssert(actualThisProxy); btAssert(otherObject); int index = m_overlappingObjects.findLinearSearch(otherObject); if (index<m_overlappingObjects.size()) { m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1]; m_overlappingObjects.pop_back(); m_hashPairCache->removeOverlappingPair(actualThisProxy,otherProxy,dispatcher); } } void btGhostObject::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const { btTransform convexFromTrans,convexToTrans; convexFromTrans = convexFromWorld; convexToTrans = convexToWorld; btVector3 castShapeAabbMin, castShapeAabbMax; /* Compute AABB that encompasses angular movement */ { btVector3 linVel, angVel; btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel); btTransform R; R.setIdentity (); R.setRotation (convexFromTrans.getRotation()); castShape->calculateTemporalAabb (R, linVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax); } /// go over all objects, and if the ray intersects their aabb + cast shape aabb, // do a ray-shape query using convexCaster (CCD) int i; for (i=0;i<m_overlappingObjects.size();i++) { btCollisionObject* collisionObject= m_overlappingObjects[i]; //only perform raycast if filterMask matches if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) { //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject(); btVector3 collisionObjectAabbMin,collisionObjectAabbMax; collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax); AabbExpand (collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax); btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing btVector3 hitNormal; if (btRayAabb(convexFromWorld.getOrigin(),convexToWorld.getOrigin(),collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal)) { btCollisionWorld::objectQuerySingle(castShape, convexFromTrans,convexToTrans, collisionObject, collisionObject->getCollisionShape(), collisionObject->getWorldTransform(), resultCallback, allowedCcdPenetration); } } } } void btGhostObject::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const { btTransform rayFromTrans; rayFromTrans.setIdentity(); rayFromTrans.setOrigin(rayFromWorld); btTransform rayToTrans; rayToTrans.setIdentity(); rayToTrans.setOrigin(rayToWorld); int i; for (i=0;i<m_overlappingObjects.size();i++) { btCollisionObject* collisionObject= m_overlappingObjects[i]; //only perform raycast if filterMask matches if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) { btCollisionWorld::rayTestSingle(rayFromTrans,rayToTrans, collisionObject, collisionObject->getCollisionShape(), collisionObject->getWorldTransform(), resultCallback); } } }
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2008 Erwin Coumans http://bulletphysics.com This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btGhostObject.h" #include "btCollisionWorld.h" #include "BulletCollision/CollisionShapes/btConvexShape.h" #include "LinearMath/btAabbUtil2.h" btGhostObject::btGhostObject() { m_internalType = CO_GHOST_OBJECT; } btGhostObject::~btGhostObject() { ///btGhostObject should have been removed from the world, so no overlapping objects btAssert(!m_overlappingObjects.size()); } void btGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy) { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); ///if this linearSearch becomes too slow (too many overlapping objects) we should add a more appropriate data structure int index = m_overlappingObjects.findLinearSearch(otherObject); if (index==m_overlappingObjects.size()) { //not found m_overlappingObjects.push_back(otherObject); } } void btGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy) { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); int index = m_overlappingObjects.findLinearSearch(otherObject); if (index<m_overlappingObjects.size()) { m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1]; m_overlappingObjects.pop_back(); } } btPairCachingGhostObject::btPairCachingGhostObject() { m_hashPairCache = new (btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache(); } btPairCachingGhostObject::~btPairCachingGhostObject() { m_hashPairCache->~btHashedOverlappingPairCache(); btAlignedFree( m_hashPairCache ); } void btPairCachingGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy) { btBroadphaseProxy*actualThisProxy = thisProxy ? thisProxy : getBroadphaseHandle(); btAssert(actualThisProxy); btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); int index = m_overlappingObjects.findLinearSearch(otherObject); if (index==m_overlappingObjects.size()) { m_overlappingObjects.push_back(otherObject); m_hashPairCache->addOverlappingPair(actualThisProxy,otherProxy); } } void btPairCachingGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy1) { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btBroadphaseProxy* actualThisProxy = thisProxy1 ? thisProxy1 : getBroadphaseHandle(); btAssert(actualThisProxy); btAssert(otherObject); int index = m_overlappingObjects.findLinearSearch(otherObject); if (index<m_overlappingObjects.size()) { m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1]; m_overlappingObjects.pop_back(); m_hashPairCache->removeOverlappingPair(actualThisProxy,otherProxy,dispatcher); } } void btGhostObject::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const { btTransform convexFromTrans,convexToTrans; convexFromTrans = convexFromWorld; convexToTrans = convexToWorld; btVector3 castShapeAabbMin, castShapeAabbMax; /* Compute AABB that encompasses angular movement */ { btVector3 linVel, angVel; btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel); btTransform R; R.setIdentity (); R.setRotation (convexFromTrans.getRotation()); castShape->calculateTemporalAabb (R, linVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax); } /// go over all objects, and if the ray intersects their aabb + cast shape aabb, // do a ray-shape query using convexCaster (CCD) int i; for (i=0;i<m_overlappingObjects.size();i++) { btCollisionObject* collisionObject= m_overlappingObjects[i]; //only perform raycast if filterMask matches if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) { //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject(); btVector3 collisionObjectAabbMin,collisionObjectAabbMax; collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax); AabbExpand (collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax); btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing btVector3 hitNormal; if (btRayAabb(convexFromWorld.getOrigin(),convexToWorld.getOrigin(),collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal)) { btCollisionWorld::objectQuerySingle(castShape, convexFromTrans,convexToTrans, collisionObject, collisionObject->getCollisionShape(), collisionObject->getWorldTransform(), resultCallback, allowedCcdPenetration); } } } } void btGhostObject::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const { btTransform rayFromTrans; rayFromTrans.setIdentity(); rayFromTrans.setOrigin(rayFromWorld); btTransform rayToTrans; rayToTrans.setIdentity(); rayToTrans.setOrigin(rayToWorld); int i; for (i=0;i<m_overlappingObjects.size();i++) { btCollisionObject* collisionObject= m_overlappingObjects[i]; //only perform raycast if filterMask matches if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) { btCollisionWorld::rayTestSingle(rayFromTrans,rayToTrans, collisionObject, collisionObject->getCollisionShape(), collisionObject->getWorldTransform(), resultCallback); } } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ContactCallbackTest2.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.physics.bullet.collision.ContactListener; import com.badlogic.gdx.utils.Array; public class ContactCallbackTest2 extends BaseBulletTest { public static class TestContactListener extends ContactListener { public Array<BulletEntity> entities; @Override public void onContactStarted (int userValue0, boolean match0, int userValue1, boolean match1) { if (match0) { final BulletEntity e = (BulletEntity)(entities.get(userValue0)); e.setColor(Color.RED); Gdx.app.log("ContactCallbackTest", "Contact started " + userValue0); } if (match1) { final BulletEntity e = (BulletEntity)(entities.get(userValue1)); e.setColor(Color.RED); Gdx.app.log("ContactCallbackTest", "Contact started " + userValue1); } } @Override public void onContactEnded (int userValue0, boolean match0, int userValue1, boolean match1) { if (match0) { final BulletEntity e = (BulletEntity)(entities.get(userValue0)); e.setColor(Color.BLUE); Gdx.app.log("ContactCallbackTest", "Contact ended " + userValue0); } if (match1) { final BulletEntity e = (BulletEntity)(entities.get(userValue1)); e.setColor(Color.BLUE); Gdx.app.log("ContactCallbackTest", "Contact ended " + userValue1); } } } final int BOXCOUNT_X = 5; final int BOXCOUNT_Y = 1; final int BOXCOUNT_Z = 5; final float BOXOFFSET_X = -5f; final float BOXOFFSET_Y = 0.5f; final float BOXOFFSET_Z = -5f; TestContactListener contactListener; @Override public void create () { super.create(); // Create the entities world.add("ground", 0f, 0f, 0f).setColor(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { for (int z = 0; z < BOXCOUNT_Z; z++) { final BulletEntity e = (BulletEntity)world.add("box", BOXOFFSET_X + x * 2f, BOXOFFSET_Y + y * 2f, BOXOFFSET_Z + z * 2f); e.setColor(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 1f); e.body.setContactCallbackFlag(2); e.body.setContactCallbackFilter(2); } } } // Creating a contact listener, also enables that particular type of contact listener and sets it active. contactListener = new TestContactListener(); contactListener.entities = world.entities; } @Override public boolean tap (float x, float y, int count, int button) { shoot(x, y); return true; } @Override public void dispose () { // Deleting the active contact listener, also disables that particular type of contact listener. if (contactListener != null) contactListener.dispose(); contactListener = null; super.dispose(); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.physics.bullet.collision.ContactListener; import com.badlogic.gdx.utils.Array; public class ContactCallbackTest2 extends BaseBulletTest { public static class TestContactListener extends ContactListener { public Array<BulletEntity> entities; @Override public void onContactStarted (int userValue0, boolean match0, int userValue1, boolean match1) { if (match0) { final BulletEntity e = (BulletEntity)(entities.get(userValue0)); e.setColor(Color.RED); Gdx.app.log("ContactCallbackTest", "Contact started " + userValue0); } if (match1) { final BulletEntity e = (BulletEntity)(entities.get(userValue1)); e.setColor(Color.RED); Gdx.app.log("ContactCallbackTest", "Contact started " + userValue1); } } @Override public void onContactEnded (int userValue0, boolean match0, int userValue1, boolean match1) { if (match0) { final BulletEntity e = (BulletEntity)(entities.get(userValue0)); e.setColor(Color.BLUE); Gdx.app.log("ContactCallbackTest", "Contact ended " + userValue0); } if (match1) { final BulletEntity e = (BulletEntity)(entities.get(userValue1)); e.setColor(Color.BLUE); Gdx.app.log("ContactCallbackTest", "Contact ended " + userValue1); } } } final int BOXCOUNT_X = 5; final int BOXCOUNT_Y = 1; final int BOXCOUNT_Z = 5; final float BOXOFFSET_X = -5f; final float BOXOFFSET_Y = 0.5f; final float BOXOFFSET_Z = -5f; TestContactListener contactListener; @Override public void create () { super.create(); // Create the entities world.add("ground", 0f, 0f, 0f).setColor(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { for (int z = 0; z < BOXCOUNT_Z; z++) { final BulletEntity e = (BulletEntity)world.add("box", BOXOFFSET_X + x * 2f, BOXOFFSET_Y + y * 2f, BOXOFFSET_Z + z * 2f); e.setColor(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 1f); e.body.setContactCallbackFlag(2); e.body.setContactCallbackFilter(2); } } } // Creating a contact listener, also enables that particular type of contact listener and sets it active. contactListener = new TestContactListener(); contactListener.entities = world.entities; } @Override public boolean tap (float x, float y, int count, int button) { shoot(x, y); return true; } @Override public void dispose () { // Deleting the active contact listener, also disables that particular type of contact listener. if (contactListener != null) contactListener.dispose(); contactListener = null; super.dispose(); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests/src/com/badlogic/gdx/tests/SystemCursorTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Cursor; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.ScreenUtils; import com.badlogic.gdx.utils.viewport.ScreenViewport; public class SystemCursorTest extends GdxTest { private Stage stage; private Skin skin; @Override public void create () { super.create(); stage = new Stage(new ScreenViewport()); skin = new Skin(Gdx.files.internal("data/uiskin.json")); Gdx.input.setInputProcessor(stage); Table table = new Table(); table.setFillParent(true); stage.addActor(table); for (final Cursor.SystemCursor cursor : Cursor.SystemCursor.values()) { TextButton button = new TextButton(cursor.name(), skin); button.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { Gdx.graphics.setSystemCursor(cursor); } }); table.add(button).row(); } } @Override public void render () { super.render(); ScreenUtils.clear(Color.BLACK); stage.act(); stage.draw(); } @Override public void resize (int width, int height) { super.resize(width, height); stage.getViewport().update(width, height, true); } @Override public void dispose () { super.dispose(); stage.dispose(); skin.dispose(); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Cursor; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.ScreenUtils; import com.badlogic.gdx.utils.viewport.ScreenViewport; public class SystemCursorTest extends GdxTest { private Stage stage; private Skin skin; @Override public void create () { super.create(); stage = new Stage(new ScreenViewport()); skin = new Skin(Gdx.files.internal("data/uiskin.json")); Gdx.input.setInputProcessor(stage); Table table = new Table(); table.setFillParent(true); stage.addActor(table); for (final Cursor.SystemCursor cursor : Cursor.SystemCursor.values()) { TextButton button = new TextButton(cursor.name(), skin); button.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { Gdx.graphics.setSystemCursor(cursor); } }); table.add(button).row(); } } @Override public void render () { super.render(); ScreenUtils.clear(Color.BLACK); stage.act(); stage.draw(); } @Override public void resize (int width, int height) { super.resize(width, height); stage.getViewport().update(width, height, true); } @Override public void dispose () { super.dispose(); stage.dispose(); skin.dispose(); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests/src/com/badlogic/gdx/tests/box2d/Pyramid.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ /* * Copyright 2010 Mario Zechner ([email protected]), Nathan Sweet ([email protected]) * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package com.badlogic.gdx.tests.box2d; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; import com.badlogic.gdx.physics.box2d.EdgeShape; import com.badlogic.gdx.physics.box2d.PolygonShape; import com.badlogic.gdx.physics.box2d.World; public class Pyramid extends Box2DTest { @Override protected void createWorld (World world) { { BodyDef bd = new BodyDef(); Body ground = world.createBody(bd); EdgeShape shape = new EdgeShape(); shape.set(new Vector2(-40, 0), new Vector2(40, 0)); ground.createFixture(shape, 0.0f); shape.dispose(); } { float a = 0.5f; PolygonShape shape = new PolygonShape(); shape.setAsBox(a, a); Vector2 x = new Vector2(-7.0f, 0.75f); Vector2 y = new Vector2(); Vector2 deltaX = new Vector2(0.5625f, 1.25f); Vector2 deltaY = new Vector2(1.125f, 0.0f); for (int i = 0; i < 20; i++) { y.set(x); for (int j = i; j < 20; j++) { BodyDef bd = new BodyDef(); bd.type = BodyType.DynamicBody; bd.position.set(y); Body body = world.createBody(bd); body.createFixture(shape, 5.0f); y.add(deltaY); } x.add(deltaX); } } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ /* * Copyright 2010 Mario Zechner ([email protected]), Nathan Sweet ([email protected]) * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package com.badlogic.gdx.tests.box2d; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; import com.badlogic.gdx.physics.box2d.EdgeShape; import com.badlogic.gdx.physics.box2d.PolygonShape; import com.badlogic.gdx.physics.box2d.World; public class Pyramid extends Box2DTest { @Override protected void createWorld (World world) { { BodyDef bd = new BodyDef(); Body ground = world.createBody(bd); EdgeShape shape = new EdgeShape(); shape.set(new Vector2(-40, 0), new Vector2(40, 0)); ground.createFixture(shape, 0.0f); shape.dispose(); } { float a = 0.5f; PolygonShape shape = new PolygonShape(); shape.setAsBox(a, a); Vector2 x = new Vector2(-7.0f, 0.75f); Vector2 y = new Vector2(); Vector2 deltaX = new Vector2(0.5625f, 1.25f); Vector2 deltaY = new Vector2(1.125f, 0.0f); for (int i = 0; i < 20; i++) { y.set(x); for (int j = i; j < 20; j++) { BodyDef bd = new BodyDef(); bd.type = BodyType.DynamicBody; bd.position.set(y); Body body = world.createBody(bd); body.createFixture(shape, 5.0f); y.add(deltaY); } x.add(deltaX); } } } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCursor.java
package com.badlogic.gdx.backends.lwjgl; import java.nio.ByteOrder; import java.nio.IntBuffer; import org.lwjgl.LWJGLException; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Cursor; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.SharedLibraryLoader; public class LwjglCursor implements Cursor { org.lwjgl.input.Cursor lwjglCursor = null; public LwjglCursor (Pixmap pixmap, int xHotspot, int yHotspot) { if (((LwjglGraphics)Gdx.graphics).canvas != null && SharedLibraryLoader.isMac) { return; } try { if (pixmap == null) { lwjglCursor = null; return; } if (pixmap.getFormat() != Pixmap.Format.RGBA8888) { throw new GdxRuntimeException("Cursor image pixmap is not in RGBA8888 format."); } if ((pixmap.getWidth() & (pixmap.getWidth() - 1)) != 0) { throw new GdxRuntimeException( "Cursor image pixmap width of " + pixmap.getWidth() + " is not a power-of-two greater than zero."); } if ((pixmap.getHeight() & (pixmap.getHeight() - 1)) != 0) { throw new GdxRuntimeException( "Cursor image pixmap height of " + pixmap.getHeight() + " is not a power-of-two greater than zero."); } if (xHotspot < 0 || xHotspot >= pixmap.getWidth()) { throw new GdxRuntimeException( "xHotspot coordinate of " + xHotspot + " is not within image width bounds: [0, " + pixmap.getWidth() + ")."); } if (yHotspot < 0 || yHotspot >= pixmap.getHeight()) { throw new GdxRuntimeException( "yHotspot coordinate of " + yHotspot + " is not within image height bounds: [0, " + pixmap.getHeight() + ")."); } // Convert from RGBA8888 to ARGB8888 and flip vertically IntBuffer pixelBuffer = pixmap.getPixels().asIntBuffer(); int[] pixelsRGBA = new int[pixelBuffer.capacity()]; pixelBuffer.get(pixelsRGBA); int[] pixelsARGBflipped = new int[pixelBuffer.capacity()]; int pixel; if (pixelBuffer.order() == ByteOrder.BIG_ENDIAN) { for (int y = 0; y < pixmap.getHeight(); ++y) { for (int x = 0; x < pixmap.getWidth(); ++x) { pixel = pixelsRGBA[x + (y * pixmap.getWidth())]; pixelsARGBflipped[x + ((pixmap.getHeight() - 1 - y) * pixmap.getWidth())] = ((pixel >> 8) & 0x00FFFFFF) | ((pixel << 24) & 0xFF000000); } } } else { for (int y = 0; y < pixmap.getHeight(); ++y) { for (int x = 0; x < pixmap.getWidth(); ++x) { pixel = pixelsRGBA[x + (y * pixmap.getWidth())]; pixelsARGBflipped[x + ((pixmap.getHeight() - 1 - y) * pixmap.getWidth())] = ((pixel & 0xFF) << 16) | ((pixel & 0xFF0000) >> 16) | (pixel & 0xFF00FF00); } } } lwjglCursor = new org.lwjgl.input.Cursor(pixmap.getWidth(), pixmap.getHeight(), xHotspot, pixmap.getHeight() - yHotspot - 1, 1, IntBuffer.wrap(pixelsARGBflipped), null); } catch (LWJGLException e) { throw new GdxRuntimeException("Could not create cursor image.", e); } } @Override public void dispose () { } }
package com.badlogic.gdx.backends.lwjgl; import java.nio.ByteOrder; import java.nio.IntBuffer; import org.lwjgl.LWJGLException; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Cursor; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.SharedLibraryLoader; public class LwjglCursor implements Cursor { org.lwjgl.input.Cursor lwjglCursor = null; public LwjglCursor (Pixmap pixmap, int xHotspot, int yHotspot) { if (((LwjglGraphics)Gdx.graphics).canvas != null && SharedLibraryLoader.isMac) { return; } try { if (pixmap == null) { lwjglCursor = null; return; } if (pixmap.getFormat() != Pixmap.Format.RGBA8888) { throw new GdxRuntimeException("Cursor image pixmap is not in RGBA8888 format."); } if ((pixmap.getWidth() & (pixmap.getWidth() - 1)) != 0) { throw new GdxRuntimeException( "Cursor image pixmap width of " + pixmap.getWidth() + " is not a power-of-two greater than zero."); } if ((pixmap.getHeight() & (pixmap.getHeight() - 1)) != 0) { throw new GdxRuntimeException( "Cursor image pixmap height of " + pixmap.getHeight() + " is not a power-of-two greater than zero."); } if (xHotspot < 0 || xHotspot >= pixmap.getWidth()) { throw new GdxRuntimeException( "xHotspot coordinate of " + xHotspot + " is not within image width bounds: [0, " + pixmap.getWidth() + ")."); } if (yHotspot < 0 || yHotspot >= pixmap.getHeight()) { throw new GdxRuntimeException( "yHotspot coordinate of " + yHotspot + " is not within image height bounds: [0, " + pixmap.getHeight() + ")."); } // Convert from RGBA8888 to ARGB8888 and flip vertically IntBuffer pixelBuffer = pixmap.getPixels().asIntBuffer(); int[] pixelsRGBA = new int[pixelBuffer.capacity()]; pixelBuffer.get(pixelsRGBA); int[] pixelsARGBflipped = new int[pixelBuffer.capacity()]; int pixel; if (pixelBuffer.order() == ByteOrder.BIG_ENDIAN) { for (int y = 0; y < pixmap.getHeight(); ++y) { for (int x = 0; x < pixmap.getWidth(); ++x) { pixel = pixelsRGBA[x + (y * pixmap.getWidth())]; pixelsARGBflipped[x + ((pixmap.getHeight() - 1 - y) * pixmap.getWidth())] = ((pixel >> 8) & 0x00FFFFFF) | ((pixel << 24) & 0xFF000000); } } } else { for (int y = 0; y < pixmap.getHeight(); ++y) { for (int x = 0; x < pixmap.getWidth(); ++x) { pixel = pixelsRGBA[x + (y * pixmap.getWidth())]; pixelsARGBflipped[x + ((pixmap.getHeight() - 1 - y) * pixmap.getWidth())] = ((pixel & 0xFF) << 16) | ((pixel & 0xFF0000) >> 16) | (pixel & 0xFF00FF00); } } } lwjglCursor = new org.lwjgl.input.Cursor(pixmap.getWidth(), pixmap.getHeight(), xHotspot, pixmap.getHeight() - yHotspot - 1, 1, IntBuffer.wrap(pixelsARGBflipped), null); } catch (LWJGLException e) { throw new GdxRuntimeException("Could not create cursor image.", e); } } @Override public void dispose () { } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests/src/com/badlogic/gdx/tests/CullTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import java.util.Random; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.ModelInstance; import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; public class CullTest extends GdxTest implements ApplicationListener { Model sphere; Camera cam; SpriteBatch batch; ModelBatch modelBatch; BitmapFont font; ModelInstance[] instances = new ModelInstance[100]; final Vector3 pos = new Vector3(); @Override public void create () { ModelBuilder builder = new ModelBuilder(); sphere = builder.createSphere(2f, 2f, 2f, 16, 16, new Material(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)), Usage.Position | Usage.Normal); // cam = new PerspectiveCamera(45, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam = new OrthographicCamera(45, 45 * (Gdx.graphics.getWidth() / (float)Gdx.graphics.getHeight())); cam.near = 1; cam.far = 200; Random rand = new Random(); for (int i = 0; i < instances.length; i++) { pos.set(rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * -100 - 3); instances[i] = new ModelInstance(sphere, pos); } modelBatch = new ModelBatch(); batch = new SpriteBatch(); font = new BitmapFont(); // Gdx.graphics.setVSync(true); // Gdx.app.log("CullTest", "" + Gdx.graphics.getBufferFormat().toString()); } @Override public void render () { GL20 gl = Gdx.gl20; gl.glClearColor(0, 0, 0, 0); gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); gl.glEnable(GL20.GL_DEPTH_TEST); cam.update(); modelBatch.begin(cam); int visible = 0; for (int i = 0; i < instances.length; i++) { instances[i].transform.getTranslation(pos); if (cam.frustum.sphereInFrustum(pos, 1)) { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.WHITE); visible++; } else { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.RED); } modelBatch.render(instances[i]); } modelBatch.end(); if (Gdx.input.isKeyPressed(Keys.A)) cam.rotate(20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); if (Gdx.input.isKeyPressed(Keys.D)) cam.rotate(-20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); gl.glDisable(GL20.GL_DEPTH_TEST); batch.begin(); font.draw(batch, "visible: " + visible + "/100" + ", fps: " + Gdx.graphics.getFramesPerSecond(), 0, 20); batch.end(); } @Override public void dispose () { batch.dispose(); font.dispose(); sphere.dispose(); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import java.util.Random; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.ModelInstance; import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; public class CullTest extends GdxTest implements ApplicationListener { Model sphere; Camera cam; SpriteBatch batch; ModelBatch modelBatch; BitmapFont font; ModelInstance[] instances = new ModelInstance[100]; final Vector3 pos = new Vector3(); @Override public void create () { ModelBuilder builder = new ModelBuilder(); sphere = builder.createSphere(2f, 2f, 2f, 16, 16, new Material(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)), Usage.Position | Usage.Normal); // cam = new PerspectiveCamera(45, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam = new OrthographicCamera(45, 45 * (Gdx.graphics.getWidth() / (float)Gdx.graphics.getHeight())); cam.near = 1; cam.far = 200; Random rand = new Random(); for (int i = 0; i < instances.length; i++) { pos.set(rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * -100 - 3); instances[i] = new ModelInstance(sphere, pos); } modelBatch = new ModelBatch(); batch = new SpriteBatch(); font = new BitmapFont(); // Gdx.graphics.setVSync(true); // Gdx.app.log("CullTest", "" + Gdx.graphics.getBufferFormat().toString()); } @Override public void render () { GL20 gl = Gdx.gl20; gl.glClearColor(0, 0, 0, 0); gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); gl.glEnable(GL20.GL_DEPTH_TEST); cam.update(); modelBatch.begin(cam); int visible = 0; for (int i = 0; i < instances.length; i++) { instances[i].transform.getTranslation(pos); if (cam.frustum.sphereInFrustum(pos, 1)) { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.WHITE); visible++; } else { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.RED); } modelBatch.render(instances[i]); } modelBatch.end(); if (Gdx.input.isKeyPressed(Keys.A)) cam.rotate(20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); if (Gdx.input.isKeyPressed(Keys.D)) cam.rotate(-20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); gl.glDisable(GL20.GL_DEPTH_TEST); batch.begin(); font.draw(batch, "visible: " + visible + "/100" + ", fps: " + Gdx.graphics.getFramesPerSecond(), 0, 20); batch.end(); } @Override public void dispose () { batch.dispose(); font.dispose(); sphere.dispose(); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-box2d/gdx-box2d-gwt/src/com/badlogic/gdx/physics/box2d/gwt/emu/org/jbox2d/dynamics/contacts/EdgeAndPolygonContact.java
/******************************************************************************* * Copyright (c) 2013, Daniel Murphy * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ package org.jbox2d.dynamics.contacts; import org.jbox2d.collision.Manifold; import org.jbox2d.collision.shapes.EdgeShape; import org.jbox2d.collision.shapes.PolygonShape; import org.jbox2d.collision.shapes.ShapeType; import org.jbox2d.common.Transform; import org.jbox2d.dynamics.Fixture; import org.jbox2d.pooling.IWorldPool; public class EdgeAndPolygonContact extends Contact { public EdgeAndPolygonContact (IWorldPool argPool) { super(argPool); } @Override public void init (Fixture fA, int indexA, Fixture fB, int indexB) { super.init(fA, indexA, fB, indexB); assert (m_fixtureA.getType() == ShapeType.EDGE); assert (m_fixtureB.getType() == ShapeType.POLYGON); } @Override public void evaluate (Manifold manifold, Transform xfA, Transform xfB) { pool.getCollision().collideEdgeAndPolygon(manifold, (EdgeShape)m_fixtureA.getShape(), xfA, (PolygonShape)m_fixtureB.getShape(), xfB); } }
/******************************************************************************* * Copyright (c) 2013, Daniel Murphy * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ package org.jbox2d.dynamics.contacts; import org.jbox2d.collision.Manifold; import org.jbox2d.collision.shapes.EdgeShape; import org.jbox2d.collision.shapes.PolygonShape; import org.jbox2d.collision.shapes.ShapeType; import org.jbox2d.common.Transform; import org.jbox2d.dynamics.Fixture; import org.jbox2d.pooling.IWorldPool; public class EdgeAndPolygonContact extends Contact { public EdgeAndPolygonContact (IWorldPool argPool) { super(argPool); } @Override public void init (Fixture fA, int indexA, Fixture fB, int indexB) { super.init(fA, indexA, fB, indexB); assert (m_fixtureA.getType() == ShapeType.EDGE); assert (m_fixtureB.getType() == ShapeType.POLYGON); } @Override public void evaluate (Manifold manifold, Transform xfA, Transform xfB) { pool.getCollision().collideEdgeAndPolygon(manifold, (EdgeShape)m_fixtureA.getShape(), xfA, (PolygonShape)m_fixtureB.getShape(), xfB); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-bullet/jni/vs/Glut/EmptyGL/GL/egl_defs.h
#ifndef EGL_DEFS_H #define EGL_DEFS_H typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; typedef signed char GLbyte; typedef short GLshort; typedef int GLint; typedef unsigned char GLubyte; typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; typedef float GLfloat; typedef float GLclampf; typedef double GLdouble; typedef double GLclampd; #define __gl_h_ #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 #define GL_VERSION_1_3 1 #define GL_ARB_imaging 1 #define GL_FALSE 0x0 #define GL_TRUE 0x1 #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 #define GL_UNSIGNED_SHORT 0x1403 #define GL_INT 0x1404 #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 #define GL_2_BYTES 0x1407 #define GL_3_BYTES 0x1408 #define GL_4_BYTES 0x1409 #define GL_DOUBLE 0x140A #define GL_POINTS 0x0000 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 #define GL_LINE_STRIP 0x0003 #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 #define GL_QUADS 0x0007 #define GL_QUAD_STRIP 0x0008 #define GL_POLYGON 0x0009 #define GL_VERTEX_ARRAY 0x8074 #define GL_NORMAL_ARRAY 0x8075 #define GL_COLOR_ARRAY 0x8076 #define GL_INDEX_ARRAY 0x8077 #define GL_TEXTURE_COORD_ARRAY 0x8078 #define GL_EDGE_FLAG_ARRAY 0x8079 #define GL_VERTEX_ARRAY_SIZE 0x807A #define GL_VERTEX_ARRAY_TYPE 0x807B #define GL_VERTEX_ARRAY_STRIDE 0x807C #define GL_NORMAL_ARRAY_TYPE 0x807E #define GL_NORMAL_ARRAY_STRIDE 0x807F #define GL_COLOR_ARRAY_SIZE 0x8081 #define GL_COLOR_ARRAY_TYPE 0x8082 #define GL_COLOR_ARRAY_STRIDE 0x8083 #define GL_INDEX_ARRAY_TYPE 0x8085 #define GL_INDEX_ARRAY_STRIDE 0x8086 #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A #define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C #define GL_VERTEX_ARRAY_POINTER 0x808E #define GL_NORMAL_ARRAY_POINTER 0x808F #define GL_COLOR_ARRAY_POINTER 0x8090 #define GL_INDEX_ARRAY_POINTER 0x8091 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 #define GL_V2F 0x2A20 #define GL_V3F 0x2A21 #define GL_C4UB_V2F 0x2A22 #define GL_C4UB_V3F 0x2A23 #define GL_C3F_V3F 0x2A24 #define GL_N3F_V3F 0x2A25 #define GL_C4F_N3F_V3F 0x2A26 #define GL_T2F_V3F 0x2A27 #define GL_T4F_V4F 0x2A28 #define GL_T2F_C4UB_V3F 0x2A29 #define GL_T2F_C3F_V3F 0x2A2A #define GL_T2F_N3F_V3F 0x2A2B #define GL_T2F_C4F_N3F_V3F 0x2A2C #define GL_T4F_C4F_N3F_V4F 0x2A2D #define GL_MATRIX_MODE 0x0BA0 #define GL_MODELVIEW 0x1700 #define GL_PROJECTION 0x1701 #define GL_TEXTURE 0x1702 #define GL_POINT_SMOOTH 0x0B10 #define GL_POINT_SIZE 0x0B11 #define GL_POINT_SIZE_GRANULARITY 0x0B13 #define GL_POINT_SIZE_RANGE 0x0B12 #define GL_LINE_SMOOTH 0x0B20 #define GL_LINE_STIPPLE 0x0B24 #define GL_LINE_STIPPLE_PATTERN 0x0B25 #define GL_LINE_STIPPLE_REPEAT 0x0B26 #define GL_LINE_WIDTH 0x0B21 #define GL_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_LINE_WIDTH_RANGE 0x0B22 #define GL_POINT 0x1B00 #define GL_LINE 0x1B01 #define GL_FILL 0x1B02 #define GL_CW 0x0900 #define GL_CCW 0x0901 #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_POLYGON_MODE 0x0B40 #define GL_POLYGON_SMOOTH 0x0B41 #define GL_POLYGON_STIPPLE 0x0B42 #define GL_EDGE_FLAG 0x0B43 #define GL_CULL_FACE 0x0B44 #define GL_CULL_FACE_MODE 0x0B45 #define GL_FRONT_FACE 0x0B46 #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_POLYGON_OFFSET_UNITS 0x2A00 #define GL_POLYGON_OFFSET_POINT 0x2A01 #define GL_POLYGON_OFFSET_LINE 0x2A02 #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_COMPILE 0x1300 #define GL_COMPILE_AND_EXECUTE 0x1301 #define GL_LIST_BASE 0x0B32 #define GL_LIST_INDEX 0x0B33 #define GL_LIST_MODE 0x0B30 #define GL_NEVER 0x0200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 #define GL_DEPTH_TEST 0x0B71 #define GL_DEPTH_BITS 0x0D56 #define GL_DEPTH_CLEAR_VALUE 0x0B73 #define GL_DEPTH_FUNC 0x0B74 #define GL_DEPTH_RANGE 0x0B70 #define GL_DEPTH_WRITEMASK 0x0B72 #define GL_DEPTH_COMPONENT 0x1902 #define GL_LIGHTING 0x0B50 #define GL_LIGHT0 0x4000 #define GL_LIGHT1 0x4001 #define GL_LIGHT2 0x4002 #define GL_LIGHT3 0x4003 #define GL_LIGHT4 0x4004 #define GL_LIGHT5 0x4005 #define GL_LIGHT6 0x4006 #define GL_LIGHT7 0x4007 #define GL_SPOT_EXPONENT 0x1205 #define GL_SPOT_CUTOFF 0x1206 #define GL_CONSTANT_ATTENUATION 0x1207 #define GL_LINEAR_ATTENUATION 0x1208 #define GL_QUADRATIC_ATTENUATION 0x1209 #define GL_AMBIENT 0x1200 #define GL_DIFFUSE 0x1201 #define GL_SPECULAR 0x1202 #define GL_SHININESS 0x1601 #define GL_EMISSION 0x1600 #define GL_POSITION 0x1203 #define GL_SPOT_DIRECTION 0x1204 #define GL_AMBIENT_AND_DIFFUSE 0x1602 #define GL_COLOR_INDEXES 0x1603 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 #define GL_LIGHT_MODEL_AMBIENT 0x0B53 #define GL_FRONT_AND_BACK 0x0408 #define GL_SHADE_MODEL 0x0B54 #define GL_FLAT 0x1D00 #define GL_SMOOTH 0x1D01 #define GL_COLOR_MATERIAL 0x0B57 #define GL_COLOR_MATERIAL_FACE 0x0B55 #define GL_COLOR_MATERIAL_PARAMETER 0x0B56 #define GL_NORMALIZE 0x0BA1 #define GL_CLIP_PLANE0 0x3000 #define GL_CLIP_PLANE1 0x3001 #define GL_CLIP_PLANE2 0x3002 #define GL_CLIP_PLANE3 0x3003 #define GL_CLIP_PLANE4 0x3004 #define GL_CLIP_PLANE5 0x3005 #define GL_ACCUM_RED_BITS 0x0D58 #define GL_ACCUM_GREEN_BITS 0x0D59 #define GL_ACCUM_BLUE_BITS 0x0D5A #define GL_ACCUM_ALPHA_BITS 0x0D5B #define GL_ACCUM_CLEAR_VALUE 0x0B80 #define GL_ACCUM 0x0100 #define GL_ADD 0x0104 #define GL_LOAD 0x0101 #define GL_MULT 0x0103 #define GL_RETURN 0x0102 #define GL_ALPHA_TEST 0x0BC0 #define GL_ALPHA_TEST_REF 0x0BC2 #define GL_ALPHA_TEST_FUNC 0x0BC1 #define GL_BLEND 0x0BE2 #define GL_BLEND_SRC 0x0BE1 #define GL_BLEND_DST 0x0BE0 #define GL_ZERO 0x0 #define GL_ONE 0x1 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 #define GL_FEEDBACK 0x1C01 #define GL_RENDER 0x1C00 #define GL_SELECT 0x1C02 #define GL_2D 0x0600 #define GL_3D 0x0601 #define GL_3D_COLOR 0x0602 #define GL_3D_COLOR_TEXTURE 0x0603 #define GL_4D_COLOR_TEXTURE 0x0604 #define GL_POINT_TOKEN 0x0701 #define GL_LINE_TOKEN 0x0702 #define GL_LINE_RESET_TOKEN 0x0707 #define GL_POLYGON_TOKEN 0x0703 #define GL_BITMAP_TOKEN 0x0704 #define GL_DRAW_PIXEL_TOKEN 0x0705 #define GL_COPY_PIXEL_TOKEN 0x0706 #define GL_PASS_THROUGH_TOKEN 0x0700 #define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 #define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 #define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 #define GL_SELECTION_BUFFER_POINTER 0x0DF3 #define GL_SELECTION_BUFFER_SIZE 0x0DF4 #define GL_FOG 0x0B60 #define GL_FOG_MODE 0x0B65 #define GL_FOG_DENSITY 0x0B62 #define GL_FOG_COLOR 0x0B66 #define GL_FOG_INDEX 0x0B61 #define GL_FOG_START 0x0B63 #define GL_FOG_END 0x0B64 #define GL_LINEAR 0x2601 #define GL_EXP 0x0800 #define GL_EXP2 0x0801 #define GL_LOGIC_OP 0x0BF1 #define GL_INDEX_LOGIC_OP 0x0BF1 #define GL_COLOR_LOGIC_OP 0x0BF2 #define GL_LOGIC_OP_MODE 0x0BF0 #define GL_CLEAR 0x1500 #define GL_SET 0x150F #define GL_COPY 0x1503 #define GL_COPY_INVERTED 0x150C #define GL_NOOP 0x1505 #define GL_INVERT 0x150A #define GL_AND 0x1501 #define GL_NAND 0x150E #define GL_OR 0x1507 #define GL_NOR 0x1508 #define GL_XOR 0x1506 #define GL_EQUIV 0x1509 #define GL_AND_REVERSE 0x1502 #define GL_AND_INVERTED 0x1504 #define GL_OR_REVERSE 0x150B #define GL_OR_INVERTED 0x150D #define GL_STENCIL_BITS 0x0D57 #define GL_STENCIL_TEST 0x0B90 #define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_VALUE_MASK 0x0B93 #define GL_STENCIL_FAIL 0x0B94 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_WRITEMASK 0x0B98 #define GL_STENCIL_INDEX 0x1901 #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 #define GL_DECR 0x1E03 #define GL_NONE 0x0 #define GL_LEFT 0x0406 #define GL_RIGHT 0x0407 #define GL_FRONT_LEFT 0x0400 #define GL_FRONT_RIGHT 0x0401 #define GL_BACK_LEFT 0x0402 #define GL_BACK_RIGHT 0x0403 #define GL_AUX0 0x0409 #define GL_AUX1 0x040A #define GL_AUX2 0x040B #define GL_AUX3 0x040C #define GL_COLOR_INDEX 0x1900 #define GL_RED 0x1903 #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_ALPHA 0x1906 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A #define GL_ALPHA_BITS 0x0D55 #define GL_RED_BITS 0x0D52 #define GL_GREEN_BITS 0x0D53 #define GL_BLUE_BITS 0x0D54 #define GL_INDEX_BITS 0x0D51 #define GL_SUBPIXEL_BITS 0x0D50 #define GL_AUX_BUFFERS 0x0C00 #define GL_READ_BUFFER 0x0C02 #define GL_DRAW_BUFFER 0x0C01 #define GL_DOUBLEBUFFER 0x0C32 #define GL_STEREO 0x0C33 #define GL_BITMAP 0x1A00 #define GL_COLOR 0x1800 #define GL_DEPTH 0x1801 #define GL_STENCIL 0x1802 #define GL_DITHER 0x0BD0 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_MAX_LIST_NESTING 0x0B31 #define GL_MAX_EVAL_ORDER 0x0D30 #define GL_MAX_LIGHTS 0x0D31 #define GL_MAX_CLIP_PLANES 0x0D32 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_PIXEL_MAP_TABLE 0x0D34 #define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 #define GL_MAX_NAME_STACK_DEPTH 0x0D37 #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B #define GL_ATTRIB_STACK_DEPTH 0x0BB0 #define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_CURRENT_INDEX 0x0B01 #define GL_CURRENT_COLOR 0x0B00 #define GL_CURRENT_NORMAL 0x0B02 #define GL_CURRENT_RASTER_COLOR 0x0B04 #define GL_CURRENT_RASTER_DISTANCE 0x0B09 #define GL_CURRENT_RASTER_INDEX 0x0B05 #define GL_CURRENT_RASTER_POSITION 0x0B07 #define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 #define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 #define GL_CURRENT_TEXTURE_COORDS 0x0B03 #define GL_INDEX_CLEAR_VALUE 0x0C20 #define GL_INDEX_MODE 0x0C30 #define GL_INDEX_WRITEMASK 0x0C21 #define GL_MODELVIEW_MATRIX 0x0BA6 #define GL_MODELVIEW_STACK_DEPTH 0x0BA3 #define GL_NAME_STACK_DEPTH 0x0D70 #define GL_PROJECTION_MATRIX 0x0BA7 #define GL_PROJECTION_STACK_DEPTH 0x0BA4 #define GL_RENDER_MODE 0x0C40 #define GL_RGBA_MODE 0x0C31 #define GL_TEXTURE_MATRIX 0x0BA8 #define GL_TEXTURE_STACK_DEPTH 0x0BA5 #define GL_VIEWPORT 0x0BA2 #define GL_AUTO_NORMAL 0x0D80 #define GL_MAP1_COLOR_4 0x0D90 #define GL_MAP1_INDEX 0x0D91 #define GL_MAP1_NORMAL 0x0D92 #define GL_MAP1_TEXTURE_COORD_1 0x0D93 #define GL_MAP1_TEXTURE_COORD_2 0x0D94 #define GL_MAP1_TEXTURE_COORD_3 0x0D95 #define GL_MAP1_TEXTURE_COORD_4 0x0D96 #define GL_MAP1_VERTEX_3 0x0D97 #define GL_MAP1_VERTEX_4 0x0D98 #define GL_MAP2_COLOR_4 0x0DB0 #define GL_MAP2_INDEX 0x0DB1 #define GL_MAP2_NORMAL 0x0DB2 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3 #define GL_MAP2_TEXTURE_COORD_2 0x0DB4 #define GL_MAP2_TEXTURE_COORD_3 0x0DB5 #define GL_MAP2_TEXTURE_COORD_4 0x0DB6 #define GL_MAP2_VERTEX_3 0x0DB7 #define GL_MAP2_VERTEX_4 0x0DB8 #define GL_MAP1_GRID_DOMAIN 0x0DD0 #define GL_MAP1_GRID_SEGMENTS 0x0DD1 #define GL_MAP2_GRID_DOMAIN 0x0DD2 #define GL_MAP2_GRID_SEGMENTS 0x0DD3 #define GL_COEFF 0x0A00 #define GL_ORDER 0x0A01 #define GL_DOMAIN 0x0A02 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #define GL_POINT_SMOOTH_HINT 0x0C51 #define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_POLYGON_SMOOTH_HINT 0x0C53 #define GL_FOG_HINT 0x0C54 #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 #define GL_SCISSOR_BOX 0x0C10 #define GL_SCISSOR_TEST 0x0C11 #define GL_MAP_COLOR 0x0D10 #define GL_MAP_STENCIL 0x0D11 #define GL_INDEX_SHIFT 0x0D12 #define GL_INDEX_OFFSET 0x0D13 #define GL_RED_SCALE 0x0D14 #define GL_RED_BIAS 0x0D15 #define GL_GREEN_SCALE 0x0D18 #define GL_GREEN_BIAS 0x0D19 #define GL_BLUE_SCALE 0x0D1A #define GL_BLUE_BIAS 0x0D1B #define GL_ALPHA_SCALE 0x0D1C #define GL_ALPHA_BIAS 0x0D1D #define GL_DEPTH_SCALE 0x0D1E #define GL_DEPTH_BIAS 0x0D1F #define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 #define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 #define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 #define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 #define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 #define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 #define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 #define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 #define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 #define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 #define GL_PIXEL_MAP_S_TO_S 0x0C71 #define GL_PIXEL_MAP_I_TO_I 0x0C70 #define GL_PIXEL_MAP_I_TO_R 0x0C72 #define GL_PIXEL_MAP_I_TO_G 0x0C73 #define GL_PIXEL_MAP_I_TO_B 0x0C74 #define GL_PIXEL_MAP_I_TO_A 0x0C75 #define GL_PIXEL_MAP_R_TO_R 0x0C76 #define GL_PIXEL_MAP_G_TO_G 0x0C77 #define GL_PIXEL_MAP_B_TO_B 0x0C78 #define GL_PIXEL_MAP_A_TO_A 0x0C79 #define GL_PACK_ALIGNMENT 0x0D05 #define GL_PACK_LSB_FIRST 0x0D01 #define GL_PACK_ROW_LENGTH 0x0D02 #define GL_PACK_SKIP_PIXELS 0x0D04 #define GL_PACK_SKIP_ROWS 0x0D03 #define GL_PACK_SWAP_BYTES 0x0D00 #define GL_UNPACK_ALIGNMENT 0x0CF5 #define GL_UNPACK_LSB_FIRST 0x0CF1 #define GL_UNPACK_ROW_LENGTH 0x0CF2 #define GL_UNPACK_SKIP_PIXELS 0x0CF4 #define GL_UNPACK_SKIP_ROWS 0x0CF3 #define GL_UNPACK_SWAP_BYTES 0x0CF0 #define GL_ZOOM_X 0x0D16 #define GL_ZOOM_Y 0x0D17 #define GL_TEXTURE_ENV 0x2300 #define GL_TEXTURE_ENV_MODE 0x2200 #define GL_TEXTURE_1D 0x0DE0 #define GL_TEXTURE_2D 0x0DE1 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_ENV_COLOR 0x2201 #define GL_TEXTURE_GEN_S 0x0C60 #define GL_TEXTURE_GEN_T 0x0C61 #define GL_TEXTURE_GEN_MODE 0x2500 #define GL_TEXTURE_BORDER_COLOR 0x1004 #define GL_TEXTURE_WIDTH 0x1000 #define GL_TEXTURE_HEIGHT 0x1001 #define GL_TEXTURE_BORDER 0x1005 #define GL_TEXTURE_COMPONENTS 0x1003 #define GL_TEXTURE_RED_SIZE 0x805C #define GL_TEXTURE_GREEN_SIZE 0x805D #define GL_TEXTURE_BLUE_SIZE 0x805E #define GL_TEXTURE_ALPHA_SIZE 0x805F #define GL_TEXTURE_LUMINANCE_SIZE 0x8060 #define GL_TEXTURE_INTENSITY_SIZE 0x8061 #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 #define GL_OBJECT_LINEAR 0x2401 #define GL_OBJECT_PLANE 0x2501 #define GL_EYE_LINEAR 0x2400 #define GL_EYE_PLANE 0x2502 #define GL_SPHERE_MAP 0x2402 #define GL_DECAL 0x2101 #define GL_MODULATE 0x2100 #define GL_NEAREST 0x2600 #define GL_REPEAT 0x2901 #define GL_CLAMP 0x2900 #define GL_S 0x2000 #define GL_T 0x2001 #define GL_R 0x2002 #define GL_Q 0x2003 #define GL_TEXTURE_GEN_R 0x0C62 #define GL_TEXTURE_GEN_Q 0x0C63 #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_NO_ERROR 0x0 #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 #define GL_OUT_OF_MEMORY 0x0505 #define GL_CURRENT_BIT 0x00000001 #define GL_POINT_BIT 0x00000002 #define GL_LINE_BIT 0x00000004 #define GL_POLYGON_BIT 0x00000008 #define GL_POLYGON_STIPPLE_BIT 0x00000010 #define GL_PIXEL_MODE_BIT 0x00000020 #define GL_LIGHTING_BIT 0x00000040 #define GL_FOG_BIT 0x00000080 #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_ACCUM_BUFFER_BIT 0x00000200 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_VIEWPORT_BIT 0x00000800 #define GL_TRANSFORM_BIT 0x00001000 #define GL_ENABLE_BIT 0x00002000 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_HINT_BIT 0x00008000 #define GL_EVAL_BIT 0x00010000 #define GL_LIST_BIT 0x00020000 #define GL_TEXTURE_BIT 0x00040000 #define GL_SCISSOR_BIT 0x00080000 #define GL_ALL_ATTRIB_BITS 0x000FFFFF #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 #define GL_TEXTURE_PRIORITY 0x8066 #define GL_TEXTURE_RESIDENT 0x8067 #define GL_TEXTURE_BINDING_1D 0x8068 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #define GL_ALPHA4 0x803B #define GL_ALPHA8 0x803C #define GL_ALPHA12 0x803D #define GL_ALPHA16 0x803E #define GL_LUMINANCE4 0x803F #define GL_LUMINANCE8 0x8040 #define GL_LUMINANCE12 0x8041 #define GL_LUMINANCE16 0x8042 #define GL_LUMINANCE4_ALPHA4 0x8043 #define GL_LUMINANCE6_ALPHA2 0x8044 #define GL_LUMINANCE8_ALPHA8 0x8045 #define GL_LUMINANCE12_ALPHA4 0x8046 #define GL_LUMINANCE12_ALPHA12 0x8047 #define GL_LUMINANCE16_ALPHA16 0x8048 #define GL_INTENSITY 0x8049 #define GL_INTENSITY4 0x804A #define GL_INTENSITY8 0x804B #define GL_INTENSITY12 0x804C #define GL_INTENSITY16 0x804D #define GL_R3_G3_B2 0x2A10 #define GL_RGB4 0x804F #define GL_RGB5 0x8050 #define GL_RGB8 0x8051 #define GL_RGB10 0x8052 #define GL_RGB12 0x8053 #define GL_RGB16 0x8054 #define GL_RGBA2 0x8055 #define GL_RGBA4 0x8056 #define GL_RGB5_A1 0x8057 #define GL_RGBA8 0x8058 #define GL_RGB10_A2 0x8059 #define GL_RGBA12 0x805A #define GL_RGBA16 0x805B #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 #define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF #define GL_RESCALE_NORMAL 0x803A #define GL_CLAMP_TO_EDGE 0x812F #define GL_MAX_ELEMENTS_VERTICES 0x80E8 #define GL_MAX_ELEMENTS_INDICES 0x80E9 #define GL_BGR 0x80E0 #define GL_BGRA 0x80E1 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 #define GL_UNSIGNED_INT_8_8_8_8 0x8035 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 #define GL_UNSIGNED_INT_10_10_10_2 0x8036 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #define GL_SINGLE_COLOR 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA #define GL_TEXTURE_MIN_LOD 0x813A #define GL_TEXTURE_MAX_LOD 0x813B #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #define GL_PACK_SKIP_IMAGES 0x806B #define GL_PACK_IMAGE_HEIGHT 0x806C #define GL_UNPACK_SKIP_IMAGES 0x806D #define GL_UNPACK_IMAGE_HEIGHT 0x806E #define GL_TEXTURE_3D 0x806F #define GL_PROXY_TEXTURE_3D 0x8070 #define GL_TEXTURE_DEPTH 0x8071 #define GL_TEXTURE_WRAP_R 0x8072 #define GL_MAX_3D_TEXTURE_SIZE 0x8073 #define GL_TEXTURE_BINDING_3D 0x806A #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_COLOR_TABLE 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 #define GL_PROXY_COLOR_TABLE 0x80D3 #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 #define GL_COLOR_TABLE_SCALE 0x80D6 #define GL_COLOR_TABLE_BIAS 0x80D7 #define GL_COLOR_TABLE_FORMAT 0x80D8 #define GL_COLOR_TABLE_WIDTH 0x80D9 #define GL_COLOR_TABLE_RED_SIZE 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF #define GL_CONVOLUTION_1D 0x8010 #define GL_CONVOLUTION_2D 0x8011 #define GL_SEPARABLE_2D 0x8012 #define GL_CONVOLUTION_BORDER_MODE 0x8013 #define GL_CONVOLUTION_FILTER_SCALE 0x8014 #define GL_CONVOLUTION_FILTER_BIAS 0x8015 #define GL_REDUCE 0x8016 #define GL_CONVOLUTION_FORMAT 0x8017 #define GL_CONVOLUTION_WIDTH 0x8018 #define GL_CONVOLUTION_HEIGHT 0x8019 #define GL_MAX_CONVOLUTION_WIDTH 0x801A #define GL_MAX_CONVOLUTION_HEIGHT 0x801B #define GL_POST_CONVOLUTION_RED_SCALE 0x801C #define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D #define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E #define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F #define GL_POST_CONVOLUTION_RED_BIAS 0x8020 #define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 #define GL_CONSTANT_BORDER 0x8151 #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 #define GL_COLOR_MATRIX 0x80B1 #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 #define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 #define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 #define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 #define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA #define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB #define GL_HISTOGRAM 0x8024 #define GL_PROXY_HISTOGRAM 0x8025 #define GL_HISTOGRAM_WIDTH 0x8026 #define GL_HISTOGRAM_FORMAT 0x8027 #define GL_HISTOGRAM_RED_SIZE 0x8028 #define GL_HISTOGRAM_GREEN_SIZE 0x8029 #define GL_HISTOGRAM_BLUE_SIZE 0x802A #define GL_HISTOGRAM_ALPHA_SIZE 0x802B #define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C #define GL_HISTOGRAM_SINK 0x802D #define GL_MINMAX 0x802E #define GL_MINMAX_FORMAT 0x802F #define GL_MINMAX_SINK 0x8030 #define GL_TABLE_TOO_LARGE 0x8031 #define GL_BLEND_EQUATION 0x8009 #define GL_MIN 0x8007 #define GL_MAX 0x8008 #define GL_FUNC_ADD 0x8006 #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B #define GL_BLEND_COLOR 0x8005 #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 #define GL_TEXTURE2_ARB 0x84C2 #define GL_TEXTURE3_ARB 0x84C3 #define GL_TEXTURE4_ARB 0x84C4 #define GL_TEXTURE5_ARB 0x84C5 #define GL_TEXTURE6_ARB 0x84C6 #define GL_TEXTURE7_ARB 0x84C7 #define GL_TEXTURE8_ARB 0x84C8 #define GL_TEXTURE9_ARB 0x84C9 #define GL_TEXTURE10_ARB 0x84CA #define GL_TEXTURE11_ARB 0x84CB #define GL_TEXTURE12_ARB 0x84CC #define GL_TEXTURE13_ARB 0x84CD #define GL_TEXTURE14_ARB 0x84CE #define GL_TEXTURE15_ARB 0x84CF #define GL_TEXTURE16_ARB 0x84D0 #define GL_TEXTURE17_ARB 0x84D1 #define GL_TEXTURE18_ARB 0x84D2 #define GL_TEXTURE19_ARB 0x84D3 #define GL_TEXTURE20_ARB 0x84D4 #define GL_TEXTURE21_ARB 0x84D5 #define GL_TEXTURE22_ARB 0x84D6 #define GL_TEXTURE23_ARB 0x84D7 #define GL_TEXTURE24_ARB 0x84D8 #define GL_TEXTURE25_ARB 0x84D9 #define GL_TEXTURE26_ARB 0x84DA #define GL_TEXTURE27_ARB 0x84DB #define GL_TEXTURE28_ARB 0x84DC #define GL_TEXTURE29_ARB 0x84DD #define GL_TEXTURE30_ARB 0x84DE #define GL_TEXTURE31_ARB 0x84DF #define GL_ACTIVE_TEXTURE_ARB 0x84E0 #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 #endif
#ifndef EGL_DEFS_H #define EGL_DEFS_H typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef void GLvoid; typedef signed char GLbyte; typedef short GLshort; typedef int GLint; typedef unsigned char GLubyte; typedef unsigned short GLushort; typedef unsigned int GLuint; typedef int GLsizei; typedef float GLfloat; typedef float GLclampf; typedef double GLdouble; typedef double GLclampd; #define __gl_h_ #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 #define GL_VERSION_1_3 1 #define GL_ARB_imaging 1 #define GL_FALSE 0x0 #define GL_TRUE 0x1 #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 #define GL_UNSIGNED_SHORT 0x1403 #define GL_INT 0x1404 #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 #define GL_2_BYTES 0x1407 #define GL_3_BYTES 0x1408 #define GL_4_BYTES 0x1409 #define GL_DOUBLE 0x140A #define GL_POINTS 0x0000 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 #define GL_LINE_STRIP 0x0003 #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 #define GL_QUADS 0x0007 #define GL_QUAD_STRIP 0x0008 #define GL_POLYGON 0x0009 #define GL_VERTEX_ARRAY 0x8074 #define GL_NORMAL_ARRAY 0x8075 #define GL_COLOR_ARRAY 0x8076 #define GL_INDEX_ARRAY 0x8077 #define GL_TEXTURE_COORD_ARRAY 0x8078 #define GL_EDGE_FLAG_ARRAY 0x8079 #define GL_VERTEX_ARRAY_SIZE 0x807A #define GL_VERTEX_ARRAY_TYPE 0x807B #define GL_VERTEX_ARRAY_STRIDE 0x807C #define GL_NORMAL_ARRAY_TYPE 0x807E #define GL_NORMAL_ARRAY_STRIDE 0x807F #define GL_COLOR_ARRAY_SIZE 0x8081 #define GL_COLOR_ARRAY_TYPE 0x8082 #define GL_COLOR_ARRAY_STRIDE 0x8083 #define GL_INDEX_ARRAY_TYPE 0x8085 #define GL_INDEX_ARRAY_STRIDE 0x8086 #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A #define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C #define GL_VERTEX_ARRAY_POINTER 0x808E #define GL_NORMAL_ARRAY_POINTER 0x808F #define GL_COLOR_ARRAY_POINTER 0x8090 #define GL_INDEX_ARRAY_POINTER 0x8091 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 #define GL_V2F 0x2A20 #define GL_V3F 0x2A21 #define GL_C4UB_V2F 0x2A22 #define GL_C4UB_V3F 0x2A23 #define GL_C3F_V3F 0x2A24 #define GL_N3F_V3F 0x2A25 #define GL_C4F_N3F_V3F 0x2A26 #define GL_T2F_V3F 0x2A27 #define GL_T4F_V4F 0x2A28 #define GL_T2F_C4UB_V3F 0x2A29 #define GL_T2F_C3F_V3F 0x2A2A #define GL_T2F_N3F_V3F 0x2A2B #define GL_T2F_C4F_N3F_V3F 0x2A2C #define GL_T4F_C4F_N3F_V4F 0x2A2D #define GL_MATRIX_MODE 0x0BA0 #define GL_MODELVIEW 0x1700 #define GL_PROJECTION 0x1701 #define GL_TEXTURE 0x1702 #define GL_POINT_SMOOTH 0x0B10 #define GL_POINT_SIZE 0x0B11 #define GL_POINT_SIZE_GRANULARITY 0x0B13 #define GL_POINT_SIZE_RANGE 0x0B12 #define GL_LINE_SMOOTH 0x0B20 #define GL_LINE_STIPPLE 0x0B24 #define GL_LINE_STIPPLE_PATTERN 0x0B25 #define GL_LINE_STIPPLE_REPEAT 0x0B26 #define GL_LINE_WIDTH 0x0B21 #define GL_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_LINE_WIDTH_RANGE 0x0B22 #define GL_POINT 0x1B00 #define GL_LINE 0x1B01 #define GL_FILL 0x1B02 #define GL_CW 0x0900 #define GL_CCW 0x0901 #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_POLYGON_MODE 0x0B40 #define GL_POLYGON_SMOOTH 0x0B41 #define GL_POLYGON_STIPPLE 0x0B42 #define GL_EDGE_FLAG 0x0B43 #define GL_CULL_FACE 0x0B44 #define GL_CULL_FACE_MODE 0x0B45 #define GL_FRONT_FACE 0x0B46 #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_POLYGON_OFFSET_UNITS 0x2A00 #define GL_POLYGON_OFFSET_POINT 0x2A01 #define GL_POLYGON_OFFSET_LINE 0x2A02 #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_COMPILE 0x1300 #define GL_COMPILE_AND_EXECUTE 0x1301 #define GL_LIST_BASE 0x0B32 #define GL_LIST_INDEX 0x0B33 #define GL_LIST_MODE 0x0B30 #define GL_NEVER 0x0200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 #define GL_DEPTH_TEST 0x0B71 #define GL_DEPTH_BITS 0x0D56 #define GL_DEPTH_CLEAR_VALUE 0x0B73 #define GL_DEPTH_FUNC 0x0B74 #define GL_DEPTH_RANGE 0x0B70 #define GL_DEPTH_WRITEMASK 0x0B72 #define GL_DEPTH_COMPONENT 0x1902 #define GL_LIGHTING 0x0B50 #define GL_LIGHT0 0x4000 #define GL_LIGHT1 0x4001 #define GL_LIGHT2 0x4002 #define GL_LIGHT3 0x4003 #define GL_LIGHT4 0x4004 #define GL_LIGHT5 0x4005 #define GL_LIGHT6 0x4006 #define GL_LIGHT7 0x4007 #define GL_SPOT_EXPONENT 0x1205 #define GL_SPOT_CUTOFF 0x1206 #define GL_CONSTANT_ATTENUATION 0x1207 #define GL_LINEAR_ATTENUATION 0x1208 #define GL_QUADRATIC_ATTENUATION 0x1209 #define GL_AMBIENT 0x1200 #define GL_DIFFUSE 0x1201 #define GL_SPECULAR 0x1202 #define GL_SHININESS 0x1601 #define GL_EMISSION 0x1600 #define GL_POSITION 0x1203 #define GL_SPOT_DIRECTION 0x1204 #define GL_AMBIENT_AND_DIFFUSE 0x1602 #define GL_COLOR_INDEXES 0x1603 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 #define GL_LIGHT_MODEL_AMBIENT 0x0B53 #define GL_FRONT_AND_BACK 0x0408 #define GL_SHADE_MODEL 0x0B54 #define GL_FLAT 0x1D00 #define GL_SMOOTH 0x1D01 #define GL_COLOR_MATERIAL 0x0B57 #define GL_COLOR_MATERIAL_FACE 0x0B55 #define GL_COLOR_MATERIAL_PARAMETER 0x0B56 #define GL_NORMALIZE 0x0BA1 #define GL_CLIP_PLANE0 0x3000 #define GL_CLIP_PLANE1 0x3001 #define GL_CLIP_PLANE2 0x3002 #define GL_CLIP_PLANE3 0x3003 #define GL_CLIP_PLANE4 0x3004 #define GL_CLIP_PLANE5 0x3005 #define GL_ACCUM_RED_BITS 0x0D58 #define GL_ACCUM_GREEN_BITS 0x0D59 #define GL_ACCUM_BLUE_BITS 0x0D5A #define GL_ACCUM_ALPHA_BITS 0x0D5B #define GL_ACCUM_CLEAR_VALUE 0x0B80 #define GL_ACCUM 0x0100 #define GL_ADD 0x0104 #define GL_LOAD 0x0101 #define GL_MULT 0x0103 #define GL_RETURN 0x0102 #define GL_ALPHA_TEST 0x0BC0 #define GL_ALPHA_TEST_REF 0x0BC2 #define GL_ALPHA_TEST_FUNC 0x0BC1 #define GL_BLEND 0x0BE2 #define GL_BLEND_SRC 0x0BE1 #define GL_BLEND_DST 0x0BE0 #define GL_ZERO 0x0 #define GL_ONE 0x1 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 #define GL_FEEDBACK 0x1C01 #define GL_RENDER 0x1C00 #define GL_SELECT 0x1C02 #define GL_2D 0x0600 #define GL_3D 0x0601 #define GL_3D_COLOR 0x0602 #define GL_3D_COLOR_TEXTURE 0x0603 #define GL_4D_COLOR_TEXTURE 0x0604 #define GL_POINT_TOKEN 0x0701 #define GL_LINE_TOKEN 0x0702 #define GL_LINE_RESET_TOKEN 0x0707 #define GL_POLYGON_TOKEN 0x0703 #define GL_BITMAP_TOKEN 0x0704 #define GL_DRAW_PIXEL_TOKEN 0x0705 #define GL_COPY_PIXEL_TOKEN 0x0706 #define GL_PASS_THROUGH_TOKEN 0x0700 #define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 #define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 #define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 #define GL_SELECTION_BUFFER_POINTER 0x0DF3 #define GL_SELECTION_BUFFER_SIZE 0x0DF4 #define GL_FOG 0x0B60 #define GL_FOG_MODE 0x0B65 #define GL_FOG_DENSITY 0x0B62 #define GL_FOG_COLOR 0x0B66 #define GL_FOG_INDEX 0x0B61 #define GL_FOG_START 0x0B63 #define GL_FOG_END 0x0B64 #define GL_LINEAR 0x2601 #define GL_EXP 0x0800 #define GL_EXP2 0x0801 #define GL_LOGIC_OP 0x0BF1 #define GL_INDEX_LOGIC_OP 0x0BF1 #define GL_COLOR_LOGIC_OP 0x0BF2 #define GL_LOGIC_OP_MODE 0x0BF0 #define GL_CLEAR 0x1500 #define GL_SET 0x150F #define GL_COPY 0x1503 #define GL_COPY_INVERTED 0x150C #define GL_NOOP 0x1505 #define GL_INVERT 0x150A #define GL_AND 0x1501 #define GL_NAND 0x150E #define GL_OR 0x1507 #define GL_NOR 0x1508 #define GL_XOR 0x1506 #define GL_EQUIV 0x1509 #define GL_AND_REVERSE 0x1502 #define GL_AND_INVERTED 0x1504 #define GL_OR_REVERSE 0x150B #define GL_OR_INVERTED 0x150D #define GL_STENCIL_BITS 0x0D57 #define GL_STENCIL_TEST 0x0B90 #define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_VALUE_MASK 0x0B93 #define GL_STENCIL_FAIL 0x0B94 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_WRITEMASK 0x0B98 #define GL_STENCIL_INDEX 0x1901 #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 #define GL_DECR 0x1E03 #define GL_NONE 0x0 #define GL_LEFT 0x0406 #define GL_RIGHT 0x0407 #define GL_FRONT_LEFT 0x0400 #define GL_FRONT_RIGHT 0x0401 #define GL_BACK_LEFT 0x0402 #define GL_BACK_RIGHT 0x0403 #define GL_AUX0 0x0409 #define GL_AUX1 0x040A #define GL_AUX2 0x040B #define GL_AUX3 0x040C #define GL_COLOR_INDEX 0x1900 #define GL_RED 0x1903 #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_ALPHA 0x1906 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A #define GL_ALPHA_BITS 0x0D55 #define GL_RED_BITS 0x0D52 #define GL_GREEN_BITS 0x0D53 #define GL_BLUE_BITS 0x0D54 #define GL_INDEX_BITS 0x0D51 #define GL_SUBPIXEL_BITS 0x0D50 #define GL_AUX_BUFFERS 0x0C00 #define GL_READ_BUFFER 0x0C02 #define GL_DRAW_BUFFER 0x0C01 #define GL_DOUBLEBUFFER 0x0C32 #define GL_STEREO 0x0C33 #define GL_BITMAP 0x1A00 #define GL_COLOR 0x1800 #define GL_DEPTH 0x1801 #define GL_STENCIL 0x1802 #define GL_DITHER 0x0BD0 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_MAX_LIST_NESTING 0x0B31 #define GL_MAX_EVAL_ORDER 0x0D30 #define GL_MAX_LIGHTS 0x0D31 #define GL_MAX_CLIP_PLANES 0x0D32 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_PIXEL_MAP_TABLE 0x0D34 #define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 #define GL_MAX_NAME_STACK_DEPTH 0x0D37 #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B #define GL_ATTRIB_STACK_DEPTH 0x0BB0 #define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_CURRENT_INDEX 0x0B01 #define GL_CURRENT_COLOR 0x0B00 #define GL_CURRENT_NORMAL 0x0B02 #define GL_CURRENT_RASTER_COLOR 0x0B04 #define GL_CURRENT_RASTER_DISTANCE 0x0B09 #define GL_CURRENT_RASTER_INDEX 0x0B05 #define GL_CURRENT_RASTER_POSITION 0x0B07 #define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 #define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 #define GL_CURRENT_TEXTURE_COORDS 0x0B03 #define GL_INDEX_CLEAR_VALUE 0x0C20 #define GL_INDEX_MODE 0x0C30 #define GL_INDEX_WRITEMASK 0x0C21 #define GL_MODELVIEW_MATRIX 0x0BA6 #define GL_MODELVIEW_STACK_DEPTH 0x0BA3 #define GL_NAME_STACK_DEPTH 0x0D70 #define GL_PROJECTION_MATRIX 0x0BA7 #define GL_PROJECTION_STACK_DEPTH 0x0BA4 #define GL_RENDER_MODE 0x0C40 #define GL_RGBA_MODE 0x0C31 #define GL_TEXTURE_MATRIX 0x0BA8 #define GL_TEXTURE_STACK_DEPTH 0x0BA5 #define GL_VIEWPORT 0x0BA2 #define GL_AUTO_NORMAL 0x0D80 #define GL_MAP1_COLOR_4 0x0D90 #define GL_MAP1_INDEX 0x0D91 #define GL_MAP1_NORMAL 0x0D92 #define GL_MAP1_TEXTURE_COORD_1 0x0D93 #define GL_MAP1_TEXTURE_COORD_2 0x0D94 #define GL_MAP1_TEXTURE_COORD_3 0x0D95 #define GL_MAP1_TEXTURE_COORD_4 0x0D96 #define GL_MAP1_VERTEX_3 0x0D97 #define GL_MAP1_VERTEX_4 0x0D98 #define GL_MAP2_COLOR_4 0x0DB0 #define GL_MAP2_INDEX 0x0DB1 #define GL_MAP2_NORMAL 0x0DB2 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3 #define GL_MAP2_TEXTURE_COORD_2 0x0DB4 #define GL_MAP2_TEXTURE_COORD_3 0x0DB5 #define GL_MAP2_TEXTURE_COORD_4 0x0DB6 #define GL_MAP2_VERTEX_3 0x0DB7 #define GL_MAP2_VERTEX_4 0x0DB8 #define GL_MAP1_GRID_DOMAIN 0x0DD0 #define GL_MAP1_GRID_SEGMENTS 0x0DD1 #define GL_MAP2_GRID_DOMAIN 0x0DD2 #define GL_MAP2_GRID_SEGMENTS 0x0DD3 #define GL_COEFF 0x0A00 #define GL_ORDER 0x0A01 #define GL_DOMAIN 0x0A02 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #define GL_POINT_SMOOTH_HINT 0x0C51 #define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_POLYGON_SMOOTH_HINT 0x0C53 #define GL_FOG_HINT 0x0C54 #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 #define GL_SCISSOR_BOX 0x0C10 #define GL_SCISSOR_TEST 0x0C11 #define GL_MAP_COLOR 0x0D10 #define GL_MAP_STENCIL 0x0D11 #define GL_INDEX_SHIFT 0x0D12 #define GL_INDEX_OFFSET 0x0D13 #define GL_RED_SCALE 0x0D14 #define GL_RED_BIAS 0x0D15 #define GL_GREEN_SCALE 0x0D18 #define GL_GREEN_BIAS 0x0D19 #define GL_BLUE_SCALE 0x0D1A #define GL_BLUE_BIAS 0x0D1B #define GL_ALPHA_SCALE 0x0D1C #define GL_ALPHA_BIAS 0x0D1D #define GL_DEPTH_SCALE 0x0D1E #define GL_DEPTH_BIAS 0x0D1F #define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 #define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 #define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 #define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 #define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 #define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 #define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 #define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 #define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 #define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 #define GL_PIXEL_MAP_S_TO_S 0x0C71 #define GL_PIXEL_MAP_I_TO_I 0x0C70 #define GL_PIXEL_MAP_I_TO_R 0x0C72 #define GL_PIXEL_MAP_I_TO_G 0x0C73 #define GL_PIXEL_MAP_I_TO_B 0x0C74 #define GL_PIXEL_MAP_I_TO_A 0x0C75 #define GL_PIXEL_MAP_R_TO_R 0x0C76 #define GL_PIXEL_MAP_G_TO_G 0x0C77 #define GL_PIXEL_MAP_B_TO_B 0x0C78 #define GL_PIXEL_MAP_A_TO_A 0x0C79 #define GL_PACK_ALIGNMENT 0x0D05 #define GL_PACK_LSB_FIRST 0x0D01 #define GL_PACK_ROW_LENGTH 0x0D02 #define GL_PACK_SKIP_PIXELS 0x0D04 #define GL_PACK_SKIP_ROWS 0x0D03 #define GL_PACK_SWAP_BYTES 0x0D00 #define GL_UNPACK_ALIGNMENT 0x0CF5 #define GL_UNPACK_LSB_FIRST 0x0CF1 #define GL_UNPACK_ROW_LENGTH 0x0CF2 #define GL_UNPACK_SKIP_PIXELS 0x0CF4 #define GL_UNPACK_SKIP_ROWS 0x0CF3 #define GL_UNPACK_SWAP_BYTES 0x0CF0 #define GL_ZOOM_X 0x0D16 #define GL_ZOOM_Y 0x0D17 #define GL_TEXTURE_ENV 0x2300 #define GL_TEXTURE_ENV_MODE 0x2200 #define GL_TEXTURE_1D 0x0DE0 #define GL_TEXTURE_2D 0x0DE1 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_ENV_COLOR 0x2201 #define GL_TEXTURE_GEN_S 0x0C60 #define GL_TEXTURE_GEN_T 0x0C61 #define GL_TEXTURE_GEN_MODE 0x2500 #define GL_TEXTURE_BORDER_COLOR 0x1004 #define GL_TEXTURE_WIDTH 0x1000 #define GL_TEXTURE_HEIGHT 0x1001 #define GL_TEXTURE_BORDER 0x1005 #define GL_TEXTURE_COMPONENTS 0x1003 #define GL_TEXTURE_RED_SIZE 0x805C #define GL_TEXTURE_GREEN_SIZE 0x805D #define GL_TEXTURE_BLUE_SIZE 0x805E #define GL_TEXTURE_ALPHA_SIZE 0x805F #define GL_TEXTURE_LUMINANCE_SIZE 0x8060 #define GL_TEXTURE_INTENSITY_SIZE 0x8061 #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 #define GL_OBJECT_LINEAR 0x2401 #define GL_OBJECT_PLANE 0x2501 #define GL_EYE_LINEAR 0x2400 #define GL_EYE_PLANE 0x2502 #define GL_SPHERE_MAP 0x2402 #define GL_DECAL 0x2101 #define GL_MODULATE 0x2100 #define GL_NEAREST 0x2600 #define GL_REPEAT 0x2901 #define GL_CLAMP 0x2900 #define GL_S 0x2000 #define GL_T 0x2001 #define GL_R 0x2002 #define GL_Q 0x2003 #define GL_TEXTURE_GEN_R 0x0C62 #define GL_TEXTURE_GEN_Q 0x0C63 #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_NO_ERROR 0x0 #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 #define GL_OUT_OF_MEMORY 0x0505 #define GL_CURRENT_BIT 0x00000001 #define GL_POINT_BIT 0x00000002 #define GL_LINE_BIT 0x00000004 #define GL_POLYGON_BIT 0x00000008 #define GL_POLYGON_STIPPLE_BIT 0x00000010 #define GL_PIXEL_MODE_BIT 0x00000020 #define GL_LIGHTING_BIT 0x00000040 #define GL_FOG_BIT 0x00000080 #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_ACCUM_BUFFER_BIT 0x00000200 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_VIEWPORT_BIT 0x00000800 #define GL_TRANSFORM_BIT 0x00001000 #define GL_ENABLE_BIT 0x00002000 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_HINT_BIT 0x00008000 #define GL_EVAL_BIT 0x00010000 #define GL_LIST_BIT 0x00020000 #define GL_TEXTURE_BIT 0x00040000 #define GL_SCISSOR_BIT 0x00080000 #define GL_ALL_ATTRIB_BITS 0x000FFFFF #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 #define GL_TEXTURE_PRIORITY 0x8066 #define GL_TEXTURE_RESIDENT 0x8067 #define GL_TEXTURE_BINDING_1D 0x8068 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #define GL_ALPHA4 0x803B #define GL_ALPHA8 0x803C #define GL_ALPHA12 0x803D #define GL_ALPHA16 0x803E #define GL_LUMINANCE4 0x803F #define GL_LUMINANCE8 0x8040 #define GL_LUMINANCE12 0x8041 #define GL_LUMINANCE16 0x8042 #define GL_LUMINANCE4_ALPHA4 0x8043 #define GL_LUMINANCE6_ALPHA2 0x8044 #define GL_LUMINANCE8_ALPHA8 0x8045 #define GL_LUMINANCE12_ALPHA4 0x8046 #define GL_LUMINANCE12_ALPHA12 0x8047 #define GL_LUMINANCE16_ALPHA16 0x8048 #define GL_INTENSITY 0x8049 #define GL_INTENSITY4 0x804A #define GL_INTENSITY8 0x804B #define GL_INTENSITY12 0x804C #define GL_INTENSITY16 0x804D #define GL_R3_G3_B2 0x2A10 #define GL_RGB4 0x804F #define GL_RGB5 0x8050 #define GL_RGB8 0x8051 #define GL_RGB10 0x8052 #define GL_RGB12 0x8053 #define GL_RGB16 0x8054 #define GL_RGBA2 0x8055 #define GL_RGBA4 0x8056 #define GL_RGB5_A1 0x8057 #define GL_RGBA8 0x8058 #define GL_RGB10_A2 0x8059 #define GL_RGBA12 0x805A #define GL_RGBA16 0x805B #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 #define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF #define GL_RESCALE_NORMAL 0x803A #define GL_CLAMP_TO_EDGE 0x812F #define GL_MAX_ELEMENTS_VERTICES 0x80E8 #define GL_MAX_ELEMENTS_INDICES 0x80E9 #define GL_BGR 0x80E0 #define GL_BGRA 0x80E1 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 #define GL_UNSIGNED_INT_8_8_8_8 0x8035 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 #define GL_UNSIGNED_INT_10_10_10_2 0x8036 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #define GL_SINGLE_COLOR 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA #define GL_TEXTURE_MIN_LOD 0x813A #define GL_TEXTURE_MAX_LOD 0x813B #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #define GL_PACK_SKIP_IMAGES 0x806B #define GL_PACK_IMAGE_HEIGHT 0x806C #define GL_UNPACK_SKIP_IMAGES 0x806D #define GL_UNPACK_IMAGE_HEIGHT 0x806E #define GL_TEXTURE_3D 0x806F #define GL_PROXY_TEXTURE_3D 0x8070 #define GL_TEXTURE_DEPTH 0x8071 #define GL_TEXTURE_WRAP_R 0x8072 #define GL_MAX_3D_TEXTURE_SIZE 0x8073 #define GL_TEXTURE_BINDING_3D 0x806A #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_COLOR_TABLE 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 #define GL_PROXY_COLOR_TABLE 0x80D3 #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 #define GL_COLOR_TABLE_SCALE 0x80D6 #define GL_COLOR_TABLE_BIAS 0x80D7 #define GL_COLOR_TABLE_FORMAT 0x80D8 #define GL_COLOR_TABLE_WIDTH 0x80D9 #define GL_COLOR_TABLE_RED_SIZE 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF #define GL_CONVOLUTION_1D 0x8010 #define GL_CONVOLUTION_2D 0x8011 #define GL_SEPARABLE_2D 0x8012 #define GL_CONVOLUTION_BORDER_MODE 0x8013 #define GL_CONVOLUTION_FILTER_SCALE 0x8014 #define GL_CONVOLUTION_FILTER_BIAS 0x8015 #define GL_REDUCE 0x8016 #define GL_CONVOLUTION_FORMAT 0x8017 #define GL_CONVOLUTION_WIDTH 0x8018 #define GL_CONVOLUTION_HEIGHT 0x8019 #define GL_MAX_CONVOLUTION_WIDTH 0x801A #define GL_MAX_CONVOLUTION_HEIGHT 0x801B #define GL_POST_CONVOLUTION_RED_SCALE 0x801C #define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D #define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E #define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F #define GL_POST_CONVOLUTION_RED_BIAS 0x8020 #define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 #define GL_CONSTANT_BORDER 0x8151 #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 #define GL_COLOR_MATRIX 0x80B1 #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 #define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 #define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 #define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 #define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA #define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB #define GL_HISTOGRAM 0x8024 #define GL_PROXY_HISTOGRAM 0x8025 #define GL_HISTOGRAM_WIDTH 0x8026 #define GL_HISTOGRAM_FORMAT 0x8027 #define GL_HISTOGRAM_RED_SIZE 0x8028 #define GL_HISTOGRAM_GREEN_SIZE 0x8029 #define GL_HISTOGRAM_BLUE_SIZE 0x802A #define GL_HISTOGRAM_ALPHA_SIZE 0x802B #define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C #define GL_HISTOGRAM_SINK 0x802D #define GL_MINMAX 0x802E #define GL_MINMAX_FORMAT 0x802F #define GL_MINMAX_SINK 0x8030 #define GL_TABLE_TOO_LARGE 0x8031 #define GL_BLEND_EQUATION 0x8009 #define GL_MIN 0x8007 #define GL_MAX 0x8008 #define GL_FUNC_ADD 0x8006 #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B #define GL_BLEND_COLOR 0x8005 #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 #define GL_TEXTURE2_ARB 0x84C2 #define GL_TEXTURE3_ARB 0x84C3 #define GL_TEXTURE4_ARB 0x84C4 #define GL_TEXTURE5_ARB 0x84C5 #define GL_TEXTURE6_ARB 0x84C6 #define GL_TEXTURE7_ARB 0x84C7 #define GL_TEXTURE8_ARB 0x84C8 #define GL_TEXTURE9_ARB 0x84C9 #define GL_TEXTURE10_ARB 0x84CA #define GL_TEXTURE11_ARB 0x84CB #define GL_TEXTURE12_ARB 0x84CC #define GL_TEXTURE13_ARB 0x84CD #define GL_TEXTURE14_ARB 0x84CE #define GL_TEXTURE15_ARB 0x84CF #define GL_TEXTURE16_ARB 0x84D0 #define GL_TEXTURE17_ARB 0x84D1 #define GL_TEXTURE18_ARB 0x84D2 #define GL_TEXTURE19_ARB 0x84D3 #define GL_TEXTURE20_ARB 0x84D4 #define GL_TEXTURE21_ARB 0x84D5 #define GL_TEXTURE22_ARB 0x84D6 #define GL_TEXTURE23_ARB 0x84D7 #define GL_TEXTURE24_ARB 0x84D8 #define GL_TEXTURE25_ARB 0x84D9 #define GL_TEXTURE26_ARB 0x84DA #define GL_TEXTURE27_ARB 0x84DB #define GL_TEXTURE28_ARB 0x84DC #define GL_TEXTURE29_ARB 0x84DD #define GL_TEXTURE30_ARB 0x84DE #define GL_TEXTURE31_ARB 0x84DF #define GL_ACTIVE_TEXTURE_ARB 0x84E0 #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 #endif
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-box2d/gdx-box2d-gwt/src/com/badlogic/gdx/physics/box2d/gwt/emu/org/jbox2d/callbacks/TreeCallback.java
/******************************************************************************* * Copyright (c) 2013, Daniel Murphy * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ package org.jbox2d.callbacks; import org.jbox2d.collision.broadphase.DynamicTree; // update to rev 100 /** callback for {@link DynamicTree} * @author Daniel Murphy */ public interface TreeCallback { /** Callback from a query request. * @param proxyId the id of the proxy * @return if the query should be continued */ public boolean treeCallback (int proxyId); }
/******************************************************************************* * Copyright (c) 2013, Daniel Murphy * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ package org.jbox2d.callbacks; import org.jbox2d.collision.broadphase.DynamicTree; // update to rev 100 /** callback for {@link DynamicTree} * @author Daniel Murphy */ public interface TreeCallback { /** Callback from a query request. * @param proxyId the id of the proxy * @return if the query should be continued */ public boolean treeCallback (int proxyId); }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests-android/assets/data/g3d/shaders/light_gouraud.glsl
#include "lights.glsl:default" #include "lights.glsl:ambient" #include ":dirLights" #include ":pointLights" #ifdef lightingFlag void applyLights(const in vec4 position, const in vec3 viewVec, const in vec3 normal, const in float shininess) { #if defined(ambientFlag) #if defined(separateAmbientFlag) g_lightAmbient = getAmbient(normal); #else g_lightDiffuse = getAmbient(normal); #endif #endif applyDirectionalLights(g_lightDiffuse, g_lightSpecular, viewVec, normal, shininess); applyPointLights(g_lightDiffuse, g_lightSpecular, position, viewVec, normal, shininess); } #else #define applyLights(position, viewVec, normal, shininess) nop() #endif [common] #define gouraudSpecularComponent(normal, lightDir, viewDir, shininess) pow(dot(normal, normalize((lightDir) + (viewDir))), shininess) [dirLights] #include "common.glsl:specularFlag" #include "common.glsl:nop" #include "lights.glsl:dirLights" #include ":common" #ifdef directionalLightsFlag /** Apply the directional lights to the diffuse argument using a basic lighting algorithm */ void applyDiffuseDirectionalLights(inout vec3 diffuse, const in vec3 normal) { for (int i = 0; i < numDirectionalLights; i++) { vec3 lightDir = -u_dirLights[i].direction; float NdotL = clamp(dot(normal, lightDir), 0.0, 1.0); diffuse += u_dirLights[i].color * NdotL; } } /** Apply the directional lights to both the diffuse and specular arguments using a basic lighting algorithm */ void applyDiffuseAndSpecularDirectionalLights(inout vec3 diffuse, inout vec3 specular, const in vec3 viewVec, const in vec3 normal, const in float shininess) { for (int i = 0; i < numDirectionalLights; i++) { vec3 lightDir = -u_dirLights[i].direction; float NdotL = clamp(dot(normal, lightDir), 0.0, 1.0); diffuse += u_dirLights[i].color * NdotL; specular += u_dirLights[i].color * NdotL * gouraudSpecularComponent(normal, lightDir, viewVec, shininess); //float halfDotView = dot(normal, normalize(lightDir + viewVec)); //specular += u_dirLights[i].color * clamp(NdotL * pow(halfDotView, shininess), 0.0, 1.0); } } #ifdef specularFlag #define applyDirectionalLights(diffuse, specular, viewVec, normal, shininess) applyDiffuseAndSpecularDirectionalLights(diffuse, specular, viewVec, normal, shininess) #else #define applyDirectionalLights(diffuse, specular, viewVec, normal, shininess) applyDiffuseDirectionalLights(diffuse, normal) #endif #else #define applyDiffuseDirectionalLights(diffuse, normal) nop() #define applyDiffuseAndSpecularDirectionalLights(diffuse, specular, viewVec, normal, shininess) nop() #define applyDirectionalLights(diffuse, specular, viewVec, normal, shininess) nop() #endif [pointLights] #include "common.glsl:nop" #include "common.glsl:specularFlag" #include "lights.glsl:pointLights" #include ":common" #ifdef pointLightsFlag void applyDiffusePointLights(inout vec3 diffuse, const in vec3 pos, const in vec3 normal) { for (int i = 0; i < numPointLights; i++) { vec3 lightDir = u_pointLights[i].position - pos; float dist2 = dot(lightDir, lightDir); lightDir *= inversesqrt(dist2); float NdotL = clamp(dot(normal, lightDir), 0.0, 2.0); float falloff = clamp(u_pointLights[i].intensity / (1.0 + dist2), 0.0, 2.0); // FIXME mul intensity on cpu diffuse += u_pointLights[i].color * (NdotL * falloff); } } void applyDiffusePointLights(inout vec3 diffuse, const in vec4 pos, const in vec3 normal) { applyDiffusePointLights(diffuse, pos.xyz, normal); } void applyDiffuseAndSpecularPointLights(inout vec3 diffuse, inout vec3 specular, const in vec3 pos, const in vec3 viewVec, const in vec3 normal, const in float shininess) { for (int i = 0; i < numPointLights; i++) { vec3 lightDir = u_pointLights[i].position - pos; float dist2 = dot(lightDir, lightDir); lightDir *= inversesqrt(dist2); float NdotL = clamp(dot(normal, lightDir), 0.0, 2.0); float falloff = clamp(u_pointLights[i].intensity / (1.0 + dist2), 0.0, 2.0); // FIXME mul intensity on cpu diffuse += u_pointLights[i].color * (NdotL * falloff); float halfDotView = clamp(dot(normal, normalize(lightDir + viewVec)), 0.0, 2.0); specular += u_pointLights[i].color * clamp(NdotL * pow(halfDotView, shininess) * falloff, 0.0, 2.0); } } void applyDiffuseAndSpecularPointLights(inout vec3 diffuse, inout vec3 specular, const in vec4 pos, const in vec3 viewVec, const in vec3 normal, const in float shininess) { applyDiffuseAndSpecularPointLights(diffuse, specular, pos.xyz, viewVec, normal, shininess); } #ifdef specularFlag #define applyPointLights(diffuse, specular, pos, viewVec, normal, shininess) applyDiffuseAndSpecularPointLights(diffuse, specular, pos, viewVec, normal, shininess) #else #define applyPointLights(diffuse, specular, pos, viewVec, normal, shininess) applyDiffusePointLights(diffuse, pos, normal) #endif #else #define applyDiffusePointLights(diffuse, pos, normal) nop() #define applyDiffuseAndSpecularPointLights(diffuse, specular, pos, viewVec, normal, shininess) nop() #define applyPointLights(diffuse, specular, pos, viewVec, normal, shininess) nop() #endif
#include "lights.glsl:default" #include "lights.glsl:ambient" #include ":dirLights" #include ":pointLights" #ifdef lightingFlag void applyLights(const in vec4 position, const in vec3 viewVec, const in vec3 normal, const in float shininess) { #if defined(ambientFlag) #if defined(separateAmbientFlag) g_lightAmbient = getAmbient(normal); #else g_lightDiffuse = getAmbient(normal); #endif #endif applyDirectionalLights(g_lightDiffuse, g_lightSpecular, viewVec, normal, shininess); applyPointLights(g_lightDiffuse, g_lightSpecular, position, viewVec, normal, shininess); } #else #define applyLights(position, viewVec, normal, shininess) nop() #endif [common] #define gouraudSpecularComponent(normal, lightDir, viewDir, shininess) pow(dot(normal, normalize((lightDir) + (viewDir))), shininess) [dirLights] #include "common.glsl:specularFlag" #include "common.glsl:nop" #include "lights.glsl:dirLights" #include ":common" #ifdef directionalLightsFlag /** Apply the directional lights to the diffuse argument using a basic lighting algorithm */ void applyDiffuseDirectionalLights(inout vec3 diffuse, const in vec3 normal) { for (int i = 0; i < numDirectionalLights; i++) { vec3 lightDir = -u_dirLights[i].direction; float NdotL = clamp(dot(normal, lightDir), 0.0, 1.0); diffuse += u_dirLights[i].color * NdotL; } } /** Apply the directional lights to both the diffuse and specular arguments using a basic lighting algorithm */ void applyDiffuseAndSpecularDirectionalLights(inout vec3 diffuse, inout vec3 specular, const in vec3 viewVec, const in vec3 normal, const in float shininess) { for (int i = 0; i < numDirectionalLights; i++) { vec3 lightDir = -u_dirLights[i].direction; float NdotL = clamp(dot(normal, lightDir), 0.0, 1.0); diffuse += u_dirLights[i].color * NdotL; specular += u_dirLights[i].color * NdotL * gouraudSpecularComponent(normal, lightDir, viewVec, shininess); //float halfDotView = dot(normal, normalize(lightDir + viewVec)); //specular += u_dirLights[i].color * clamp(NdotL * pow(halfDotView, shininess), 0.0, 1.0); } } #ifdef specularFlag #define applyDirectionalLights(diffuse, specular, viewVec, normal, shininess) applyDiffuseAndSpecularDirectionalLights(diffuse, specular, viewVec, normal, shininess) #else #define applyDirectionalLights(diffuse, specular, viewVec, normal, shininess) applyDiffuseDirectionalLights(diffuse, normal) #endif #else #define applyDiffuseDirectionalLights(diffuse, normal) nop() #define applyDiffuseAndSpecularDirectionalLights(diffuse, specular, viewVec, normal, shininess) nop() #define applyDirectionalLights(diffuse, specular, viewVec, normal, shininess) nop() #endif [pointLights] #include "common.glsl:nop" #include "common.glsl:specularFlag" #include "lights.glsl:pointLights" #include ":common" #ifdef pointLightsFlag void applyDiffusePointLights(inout vec3 diffuse, const in vec3 pos, const in vec3 normal) { for (int i = 0; i < numPointLights; i++) { vec3 lightDir = u_pointLights[i].position - pos; float dist2 = dot(lightDir, lightDir); lightDir *= inversesqrt(dist2); float NdotL = clamp(dot(normal, lightDir), 0.0, 2.0); float falloff = clamp(u_pointLights[i].intensity / (1.0 + dist2), 0.0, 2.0); // FIXME mul intensity on cpu diffuse += u_pointLights[i].color * (NdotL * falloff); } } void applyDiffusePointLights(inout vec3 diffuse, const in vec4 pos, const in vec3 normal) { applyDiffusePointLights(diffuse, pos.xyz, normal); } void applyDiffuseAndSpecularPointLights(inout vec3 diffuse, inout vec3 specular, const in vec3 pos, const in vec3 viewVec, const in vec3 normal, const in float shininess) { for (int i = 0; i < numPointLights; i++) { vec3 lightDir = u_pointLights[i].position - pos; float dist2 = dot(lightDir, lightDir); lightDir *= inversesqrt(dist2); float NdotL = clamp(dot(normal, lightDir), 0.0, 2.0); float falloff = clamp(u_pointLights[i].intensity / (1.0 + dist2), 0.0, 2.0); // FIXME mul intensity on cpu diffuse += u_pointLights[i].color * (NdotL * falloff); float halfDotView = clamp(dot(normal, normalize(lightDir + viewVec)), 0.0, 2.0); specular += u_pointLights[i].color * clamp(NdotL * pow(halfDotView, shininess) * falloff, 0.0, 2.0); } } void applyDiffuseAndSpecularPointLights(inout vec3 diffuse, inout vec3 specular, const in vec4 pos, const in vec3 viewVec, const in vec3 normal, const in float shininess) { applyDiffuseAndSpecularPointLights(diffuse, specular, pos.xyz, viewVec, normal, shininess); } #ifdef specularFlag #define applyPointLights(diffuse, specular, pos, viewVec, normal, shininess) applyDiffuseAndSpecularPointLights(diffuse, specular, pos, viewVec, normal, shininess) #else #define applyPointLights(diffuse, specular, pos, viewVec, normal, shininess) applyDiffusePointLights(diffuse, pos, normal) #endif #else #define applyDiffusePointLights(diffuse, pos, normal) nop() #define applyDiffuseAndSpecularPointLights(diffuse, specular, pos, viewVec, normal, shininess) nop() #define applyPointLights(diffuse, specular, pos, viewVec, normal, shininess) nop() #endif
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backend-headless/src/com/badlogic/gdx/backends/headless/HeadlessApplicationLogger.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.headless; import com.badlogic.gdx.ApplicationLogger; /** Default implementation of {@link ApplicationLogger} for headless */ public class HeadlessApplicationLogger implements ApplicationLogger { @Override public void log (String tag, String message) { System.out.println("[" + tag + "] " + message); } @Override public void log (String tag, String message, Throwable exception) { System.out.println("[" + tag + "] " + message); exception.printStackTrace(System.out); } @Override public void error (String tag, String message) { System.err.println("[" + tag + "] " + message); } @Override public void error (String tag, String message, Throwable exception) { System.err.println("[" + tag + "] " + message); exception.printStackTrace(System.err); } @Override public void debug (String tag, String message) { System.out.println("[" + tag + "] " + message); } @Override public void debug (String tag, String message, Throwable exception) { System.out.println("[" + tag + "] " + message); exception.printStackTrace(System.out); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.headless; import com.badlogic.gdx.ApplicationLogger; /** Default implementation of {@link ApplicationLogger} for headless */ public class HeadlessApplicationLogger implements ApplicationLogger { @Override public void log (String tag, String message) { System.out.println("[" + tag + "] " + message); } @Override public void log (String tag, String message, Throwable exception) { System.out.println("[" + tag + "] " + message); exception.printStackTrace(System.out); } @Override public void error (String tag, String message) { System.err.println("[" + tag + "] " + message); } @Override public void error (String tag, String message, Throwable exception) { System.err.println("[" + tag + "] " + message); exception.printStackTrace(System.err); } @Override public void debug (String tag, String message) { System.out.println("[" + tag + "] " + message); } @Override public void debug (String tag, String message, Throwable exception) { System.out.println("[" + tag + "] " + message); exception.printStackTrace(System.out); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./tests/gdx-tests-android/assets/data/test2_notwork.wav
RIFFBWAVEfmt DXLISTINFOIART DUMMY_NAMEdata`BA$:N7PV7ndT*wI>Z>~.qUs V:zZ+Z.ThwMCeI~%RrN#Qe p@V8o.I1R@%nM;$,`h$HP0H\p Vmil<?^9NJ{T8'Ya52e ?L71 x  N 2 I L . ) P+=qIPU,Z;@0z hk^]w/cJ(q4D[EV  GRg45#kAW/61= : k b + $ ^DP r+5< 9 j Xy +2elL!g"v#?%}'q),**,./g0012443(3$3m21F/-,,b*(S'B&$"!G>K1 >  # P(!jyT ~ڴ[/Ώճ;ےJ6ރrNr.c1m C8>"HRP ~kg8dfՁԱ~7ӢrȽ."?s˝ ΈJZ _ڙQ,ǹ)ڧF $B ;u'p'=:**7?H'RP7| >, Bԅ!]/̼bʟijw8݌7X4 YKsD }7tY T3 %++S020++1,m)! ]  e@= 2 P ; D @ 0   %6(&#""%)9,K+M(N'()+(E''^'$c$$#?""4%(B+,,.g1933N589=@BDDDC%CA?[;|6^1-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6>}moQ_GK:*-!":EE&I9HAS<h>sNYbQbL_XdrRyKV_?c;P?>H+L%C&:6#0963C3[L`\wlr!;CXawn %6;VRwq  )56;G>MFSWcTsZuc_k_bUWNZOPF@+>3.nd:Q+.xl]C:" 3HT_|u0F4Q=kGxNzayv|up|roswpe`k[^TbIN9@)3vs|o|}vwyzwvrqt\vLkSMO?D81/!A9 %.<2VQS_ddu_r~|x| ,1W=Y}   ux^TA0& (/!5@FTSdXa]feuf}pqcktnn`s`v_jnXzLpSh]^iXsgQj1T<NDH/:$+  %!"'.0.:4K7Q<YFIC<5;-3,$& "  2/ +  xtiaQG:).# / #  )H8h[wkv!'-8<BFNWPmUsio~~ ' :D%@19::I5R:YHMSEUFWBYATKFGCI<KC:3/-*   zrw[`LH99"$h^~ernfmk]odljgbgW\WVY[\ej`oWhdfmlliuvpz~~{kr&038K>QJU?R9P9H1CBAJBK=V3X'F060?)L!@0-2(       &%$',/=67D1G6@/2'/"  %   )$"1*3(+.#4!&&#   (. 3.:;:8G,D95B5?96<5F59L$X4IEF8Y8UADIG<H2<6*:/,B>%4/&2#6160('(/'=/;;CEADCP>R;I=B;P>N;U:T<>F2M6?D56?265-2!. %+:3"             $#       !! ! ' , )! ($ 6>*?G?*9,<)<4A5=?9F96N*Q'B./06/"(+!          *'  ""            &2& "%'3#  *#' ' " %  && ""%'!$(*& " )   !           "   
RIFFBWAVEfmt DXLISTINFOIART DUMMY_NAMEdata`BA$:N7PV7ndT*wI>Z>~.qUs V:zZ+Z.ThwMCeI~%RrN#Qe p@V8o.I1R@%nM;$,`h$HP0H\p Vmil<?^9NJ{T8'Ya52e ?L71 x  N 2 I L . ) P+=qIPU,Z;@0z hk^]w/cJ(q4D[EV  GRg45#kAW/61= : k b + $ ^DP r+5< 9 j Xy +2elL!g"v#?%}'q),**,./g0012443(3$3m21F/-,,b*(S'B&$"!G>K1 >  # P(!jyT ~ڴ[/Ώճ;ےJ6ރrNr.c1m C8>"HRP ~kg8dfՁԱ~7Ӣr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L.D(42& #E9^m~8Dr&DiJ+[N~ '$ u`OD1veG7}QC'bmJF;+-) (.RS*Ah52^g|{{yr~loknxjahRLSDK0C&zfiYPTIOKXPUQXFbIZL??4/;8&;3>=MJMUIZ`ftky~zx`]== M7oW@Vm+.M]s$+.2<@V6Z;RGE7>8#v{lhcxWzK`L::j\4,ne6>}moQ_GK:*-!":EE&I9HAS<h>sNYbQbL_XdrRyKV_?c;P?>H+L%C&:6#0963C3[L`\wlr!;CXawn %6;VRwq  )56;G>MFSWcTsZuc_k_bUWNZOPF@+>3.nd:Q+.xl]C:" 3HT_|u0F4Q=kGxNzayv|up|roswpe`k[^TbIN9@)3vs|o|}vwyzwvrqt\vLkSMO?D81/!A9 %.<2VQS_ddu_r~|x| ,1W=Y}   ux^TA0& (/!5@FTSdXa]feuf}pqcktnn`s`v_jnXzLpSh]^iXsgQj1T<NDH/:$+  %!"'.0.:4K7Q<YFIC<5;-3,$& "  2/ +  xtiaQG:).# / #  )H8h[wkv!'-8<BFNWPmUsio~~ ' :D%@19::I5R:YHMSEUFWBYATKFGCI<KC:3/-*   zrw[`LH99"$h^~ernfmk]odljgbgW\WVY[\ej`oWhdfmlliuvpz~~{kr&038K>QJU?R9P9H1CBAJBK=V3X'F060?)L!@0-2(       &%$',/=67D1G6@/2'/"  %   )$"1*3(+.#4!&&#   (. 3.:;:8G,D95B5?96<5F59L$X4IEF8Y8UADIG<H2<6*:/,B>%4/&2#6160('(/'=/;;CEADCP>R;I=B;P>N;U:T<>F2M6?D56?265-2!. %+:3"             $#       !! ! ' , )! ($ 6>*?G?*9,<)<4A5=?9F96N*Q'B./06/"(+!          *'  ""            &2& "%'3#  *#' ' " %  && ""%'!$(*& " )   !           "   
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-box2d/gdx-box2d-gwt/src/com/badlogic/gdx/physics/box2d/gwt/emu/org/jbox2d/dynamics/joints/ConstantVolumeJointDef.java
/******************************************************************************* * Copyright (c) 2013, Daniel Murphy * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ package org.jbox2d.dynamics.joints; import java.util.ArrayList; import org.jbox2d.dynamics.Body; /** Definition for a {@link ConstantVolumeJoint}, which connects a group a bodies together so they maintain a constant volume * within them. */ public class ConstantVolumeJointDef extends JointDef { public float frequencyHz; public float dampingRatio; ArrayList<Body> bodies; ArrayList<DistanceJoint> joints; public ConstantVolumeJointDef () { super(JointType.CONSTANT_VOLUME); bodies = new ArrayList<Body>(); joints = null; collideConnected = false; frequencyHz = 0.0f; dampingRatio = 0.0f; } /** Adds a body to the group * * @param argBody */ public void addBody (Body argBody) { bodies.add(argBody); if (bodies.size() == 1) { bodyA = argBody; } if (bodies.size() == 2) { bodyB = argBody; } } /** Adds a body and the pre-made distance joint. Should only be used for deserialization. */ public void addBodyAndJoint (Body argBody, DistanceJoint argJoint) { addBody(argBody); if (joints == null) { joints = new ArrayList<DistanceJoint>(); } joints.add(argJoint); } }
/******************************************************************************* * Copyright (c) 2013, Daniel Murphy * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ package org.jbox2d.dynamics.joints; import java.util.ArrayList; import org.jbox2d.dynamics.Body; /** Definition for a {@link ConstantVolumeJoint}, which connects a group a bodies together so they maintain a constant volume * within them. */ public class ConstantVolumeJointDef extends JointDef { public float frequencyHz; public float dampingRatio; ArrayList<Body> bodies; ArrayList<DistanceJoint> joints; public ConstantVolumeJointDef () { super(JointType.CONSTANT_VOLUME); bodies = new ArrayList<Body>(); joints = null; collideConnected = false; frequencyHz = 0.0f; dampingRatio = 0.0f; } /** Adds a body to the group * * @param argBody */ public void addBody (Body argBody) { bodies.add(argBody); if (bodies.size() == 1) { bodyA = argBody; } if (bodies.size() == 2) { bodyB = argBody; } } /** Adds a body and the pre-made distance joint. Should only be used for deserialization. */ public void addBodyAndJoint (Body argBody, DistanceJoint argJoint) { addBody(argBody); if (joints == null) { joints = new ArrayList<DistanceJoint>(); } joints.add(argJoint); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/theme/chrome/public/gwt/chrome/images/hborder.png
PNG  IHDR &bKGD pHYs  tIME17*5IDATx˱#!.W<[Ylݠ׌:8@F5ﷷ:~_Qm4_|>=Fu]YSD}ߊ a8`# zitcf:oz#[}>8# 8Ӏ# 83 4'P8=7 @K'P=g$ U96$  HY{wwP܂sEk^TUEnҀr %ˣIENDB`
PNG  IHDR &bKGD pHYs  tIME17*5IDATx˱#!.W<[Ylݠ׌:8@F5ﷷ:~_Qm4_|>=Fu]YSD}ߊ a8`# zitcf:oz#[}>8# 8Ӏ# 83 4'P8=7 @K'P=g$ U96$  HY{wwP܂sEk^TUEnҀr %ˣIENDB`
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/graphics/g3d/model/data/ModelTexture.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.model.data; import com.badlogic.gdx.math.Vector2; public class ModelTexture { public final static int USAGE_UNKNOWN = 0; public final static int USAGE_NONE = 1; public final static int USAGE_DIFFUSE = 2; public final static int USAGE_EMISSIVE = 3; public final static int USAGE_AMBIENT = 4; public final static int USAGE_SPECULAR = 5; public final static int USAGE_SHININESS = 6; public final static int USAGE_NORMAL = 7; public final static int USAGE_BUMP = 8; public final static int USAGE_TRANSPARENCY = 9; public final static int USAGE_REFLECTION = 10; public String id; public String fileName; public Vector2 uvTranslation; public Vector2 uvScaling; public int usage; }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.model.data; import com.badlogic.gdx.math.Vector2; public class ModelTexture { public final static int USAGE_UNKNOWN = 0; public final static int USAGE_NONE = 1; public final static int USAGE_DIFFUSE = 2; public final static int USAGE_EMISSIVE = 3; public final static int USAGE_AMBIENT = 4; public final static int USAGE_SPECULAR = 5; public final static int USAGE_SHININESS = 6; public final static int USAGE_NORMAL = 7; public final static int USAGE_BUMP = 8; public final static int USAGE_TRANSPARENCY = 9; public final static int USAGE_REFLECTION = 10; public String id; public String fileName; public Vector2 uvTranslation; public Vector2 uvScaling; public int usage; }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-bullet/jni/src/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef BT_COLLISION__DISPATCHER_H #define BT_COLLISION__DISPATCHER_H #include "BulletCollision/BroadphaseCollision/btDispatcher.h" #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" #include "BulletCollision/CollisionDispatch/btManifoldResult.h" #include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" #include "LinearMath/btAlignedObjectArray.h" class btIDebugDraw; class btOverlappingPairCache; class btPoolAllocator; class btCollisionConfiguration; #include "btCollisionCreateFunc.h" #define USE_DISPATCH_REGISTRY_ARRAY 1 class btCollisionDispatcher; ///user can override this nearcallback for collision filtering and more finegrained control over collision detection typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo); ///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs. ///Time of Impact, Closest Points and Penetration Depth. class btCollisionDispatcher : public btDispatcher { protected: int m_dispatcherFlags; btAlignedObjectArray<btPersistentManifold*> m_manifoldsPtr; btManifoldResult m_defaultManifoldResult; btNearCallback m_nearCallback; btPoolAllocator* m_collisionAlgorithmPoolAllocator; btPoolAllocator* m_persistentManifoldPoolAllocator; btCollisionAlgorithmCreateFunc* m_doubleDispatchContactPoints[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]; btCollisionAlgorithmCreateFunc* m_doubleDispatchClosestPoints[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]; btCollisionConfiguration* m_collisionConfiguration; public: enum DispatcherFlags { CD_STATIC_STATIC_REPORTED = 1, CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2, CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION = 4 }; int getDispatcherFlags() const { return m_dispatcherFlags; } void setDispatcherFlags(int flags) { m_dispatcherFlags = flags; } ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions void registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc); void registerClosestPointsCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc); int getNumManifolds() const { return int( m_manifoldsPtr.size()); } btPersistentManifold** getInternalManifoldPointer() { return m_manifoldsPtr.size()? &m_manifoldsPtr[0] : 0; } btPersistentManifold* getManifoldByIndexInternal(int index) { return m_manifoldsPtr[index]; } const btPersistentManifold* getManifoldByIndexInternal(int index) const { return m_manifoldsPtr[index]; } btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration); virtual ~btCollisionDispatcher(); virtual btPersistentManifold* getNewManifold(const btCollisionObject* b0,const btCollisionObject* b1); virtual void releaseManifold(btPersistentManifold* manifold); virtual void clearManifold(btPersistentManifold* manifold); btCollisionAlgorithm* findAlgorithm(const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,btPersistentManifold* sharedManifold, ebtDispatcherQueryType queryType); virtual bool needsCollision(const btCollisionObject* body0,const btCollisionObject* body1); virtual bool needsResponse(const btCollisionObject* body0,const btCollisionObject* body1); virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ; void setNearCallback(btNearCallback nearCallback) { m_nearCallback = nearCallback; } btNearCallback getNearCallback() const { return m_nearCallback; } //by default, Bullet will use this near callback static void defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo); virtual void* allocateCollisionAlgorithm(int size); virtual void freeCollisionAlgorithm(void* ptr); btCollisionConfiguration* getCollisionConfiguration() { return m_collisionConfiguration; } const btCollisionConfiguration* getCollisionConfiguration() const { return m_collisionConfiguration; } void setCollisionConfiguration(btCollisionConfiguration* config) { m_collisionConfiguration = config; } virtual btPoolAllocator* getInternalManifoldPool() { return m_persistentManifoldPoolAllocator; } virtual const btPoolAllocator* getInternalManifoldPool() const { return m_persistentManifoldPoolAllocator; } }; #endif //BT_COLLISION__DISPATCHER_H
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef BT_COLLISION__DISPATCHER_H #define BT_COLLISION__DISPATCHER_H #include "BulletCollision/BroadphaseCollision/btDispatcher.h" #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" #include "BulletCollision/CollisionDispatch/btManifoldResult.h" #include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" #include "LinearMath/btAlignedObjectArray.h" class btIDebugDraw; class btOverlappingPairCache; class btPoolAllocator; class btCollisionConfiguration; #include "btCollisionCreateFunc.h" #define USE_DISPATCH_REGISTRY_ARRAY 1 class btCollisionDispatcher; ///user can override this nearcallback for collision filtering and more finegrained control over collision detection typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo); ///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs. ///Time of Impact, Closest Points and Penetration Depth. class btCollisionDispatcher : public btDispatcher { protected: int m_dispatcherFlags; btAlignedObjectArray<btPersistentManifold*> m_manifoldsPtr; btManifoldResult m_defaultManifoldResult; btNearCallback m_nearCallback; btPoolAllocator* m_collisionAlgorithmPoolAllocator; btPoolAllocator* m_persistentManifoldPoolAllocator; btCollisionAlgorithmCreateFunc* m_doubleDispatchContactPoints[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]; btCollisionAlgorithmCreateFunc* m_doubleDispatchClosestPoints[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]; btCollisionConfiguration* m_collisionConfiguration; public: enum DispatcherFlags { CD_STATIC_STATIC_REPORTED = 1, CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2, CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION = 4 }; int getDispatcherFlags() const { return m_dispatcherFlags; } void setDispatcherFlags(int flags) { m_dispatcherFlags = flags; } ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions void registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc); void registerClosestPointsCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc); int getNumManifolds() const { return int( m_manifoldsPtr.size()); } btPersistentManifold** getInternalManifoldPointer() { return m_manifoldsPtr.size()? &m_manifoldsPtr[0] : 0; } btPersistentManifold* getManifoldByIndexInternal(int index) { return m_manifoldsPtr[index]; } const btPersistentManifold* getManifoldByIndexInternal(int index) const { return m_manifoldsPtr[index]; } btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration); virtual ~btCollisionDispatcher(); virtual btPersistentManifold* getNewManifold(const btCollisionObject* b0,const btCollisionObject* b1); virtual void releaseManifold(btPersistentManifold* manifold); virtual void clearManifold(btPersistentManifold* manifold); btCollisionAlgorithm* findAlgorithm(const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,btPersistentManifold* sharedManifold, ebtDispatcherQueryType queryType); virtual bool needsCollision(const btCollisionObject* body0,const btCollisionObject* body1); virtual bool needsResponse(const btCollisionObject* body0,const btCollisionObject* body1); virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ; void setNearCallback(btNearCallback nearCallback) { m_nearCallback = nearCallback; } btNearCallback getNearCallback() const { return m_nearCallback; } //by default, Bullet will use this near callback static void defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo); virtual void* allocateCollisionAlgorithm(int size); virtual void freeCollisionAlgorithm(void* ptr); btCollisionConfiguration* getCollisionConfiguration() { return m_collisionConfiguration; } const btCollisionConfiguration* getCollisionConfiguration() const { return m_collisionConfiguration; } void setCollisionConfiguration(btCollisionConfiguration* config) { m_collisionConfiguration = config; } virtual btPoolAllocator* getInternalManifoldPool() { return m_persistentManifoldPoolAllocator; } virtual const btPoolAllocator* getInternalManifoldPool() const { return m_persistentManifoldPoolAllocator; } }; #endif //BT_COLLISION__DISPATCHER_H
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/utils/JsonReader.java
// line 1 "JsonReader.rl" // Do not edit this file! Generated by Ragel. // Ragel.exe -J -o ../../../../../src/com/badlogic/gdx/utils/JsonReader.java JsonReader.rl /******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.Arrays; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.JsonValue.ValueType; /** Lightweight JSON parser.<br> * <br> * The default behavior is to parse the JSON into a DOM containing {@link JsonValue} objects. Extend this class and override * methods to perform event driven parsing. When this is done, the parse methods will return null. * @author Nathan Sweet */ public class JsonReader implements BaseJsonReader { public JsonValue parse (String json) { char[] data = json.toCharArray(); return parse(data, 0, data.length); } public JsonValue parse (Reader reader) { char[] data = new char[1024]; int offset = 0; try { while (true) { int length = reader.read(data, offset, data.length - offset); if (length == -1) break; if (length == 0) { char[] newData = new char[data.length * 2]; System.arraycopy(data, 0, newData, 0, data.length); data = newData; } else offset += length; } } catch (IOException ex) { throw new SerializationException("Error reading input.", ex); } finally { StreamUtils.closeQuietly(reader); } return parse(data, 0, offset); } public JsonValue parse (InputStream input) { Reader reader; try { reader = new InputStreamReader(input, "UTF-8"); } catch (Exception ex) { throw new SerializationException("Error reading stream.", ex); } return parse(reader); } public JsonValue parse (FileHandle file) { Reader reader; try { reader = file.reader("UTF-8"); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } try { return parse(reader); } catch (Exception ex) { throw new SerializationException("Error parsing file: " + file, ex); } } public JsonValue parse (char[] data, int offset, int length) { stop = false; int cs, p = offset, pe = length, eof = pe, top = 0; int[] stack = new int[4]; int s = 0; Array<String> names = new Array(8); boolean needsUnescape = false, stringIsName = false, stringIsUnquoted = false; RuntimeException parseRuntimeEx = null; boolean debug = false; if (debug) System.out.println(); try { // line 3 "JsonReader.java" { cs = json_start; top = 0; } // line 8 "JsonReader.java" { int _klen; int _trans = 0; int _acts; int _nacts; int _keys; int _goto_targ = 0; _goto: while (true) { switch (_goto_targ) { case 0: if (p == pe) { _goto_targ = 4; continue _goto; } if (cs == 0) { _goto_targ = 5; continue _goto; } case 1: _match: do { _keys = _json_key_offsets[cs]; _trans = _json_index_offsets[cs]; _klen = _json_single_lengths[cs]; if (_klen > 0) { int _lower = _keys; int _mid; int _upper = _keys + _klen - 1; while (true) { if (_upper < _lower) break; _mid = _lower + ((_upper - _lower) >> 1); if (data[p] < _json_trans_keys[_mid]) _upper = _mid - 1; else if (data[p] > _json_trans_keys[_mid]) _lower = _mid + 1; else { _trans += (_mid - _keys); break _match; } } _keys += _klen; _trans += _klen; } _klen = _json_range_lengths[cs]; if (_klen > 0) { int _lower = _keys; int _mid; int _upper = _keys + (_klen << 1) - 2; while (true) { if (_upper < _lower) break; _mid = _lower + (((_upper - _lower) >> 1) & ~1); if (data[p] < _json_trans_keys[_mid]) _upper = _mid - 2; else if (data[p] > _json_trans_keys[_mid + 1]) _lower = _mid + 2; else { _trans += ((_mid - _keys) >> 1); break _match; } } _trans += _klen; } } while (false); _trans = _json_indicies[_trans]; cs = _json_trans_targs[_trans]; if (_json_trans_actions[_trans] != 0) { _acts = _json_trans_actions[_trans]; _nacts = (int)_json_actions[_acts++]; while (_nacts-- > 0) { switch (_json_actions[_acts++]) { case 0: // line 108 "JsonReader.rl" { stringIsName = true; } break; case 1: // line 111 "JsonReader.rl" { String value = new String(data, s, p - s); if (needsUnescape) value = unescape(value); outer: if (stringIsName) { stringIsName = false; if (debug) System.out.println("name: " + value); names.add(value); } else { String name = names.size > 0 ? names.pop() : null; if (stringIsUnquoted) { if (value.equals("true")) { if (debug) System.out.println("boolean: " + name + "=true"); bool(name, true); break outer; } else if (value.equals("false")) { if (debug) System.out.println("boolean: " + name + "=false"); bool(name, false); break outer; } else if (value.equals("null")) { string(name, null); break outer; } boolean couldBeDouble = false, couldBeLong = true; outer2: for (int i = s; i < p; i++) { switch (data[i]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': case '+': break; case '.': case 'e': case 'E': couldBeDouble = true; couldBeLong = false; break; default: couldBeDouble = false; couldBeLong = false; break outer2; } } if (couldBeDouble) { try { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); number(name, Double.parseDouble(value), value); break outer; } catch (NumberFormatException ignored) { } } else if (couldBeLong) { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); try { number(name, Long.parseLong(value), value); break outer; } catch (NumberFormatException ignored) { } } } if (debug) System.out.println("string: " + name + "=" + value); string(name, value); } if (stop) break _goto; stringIsUnquoted = false; s = p; } break; case 2: // line 186 "JsonReader.rl" { String name = names.size > 0 ? names.pop() : null; if (debug) System.out.println("startObject: " + name); startObject(name); if (stop) break _goto; { if (top == stack.length) stack = Arrays.copyOf(stack, stack.length * 2); { stack[top++] = cs; cs = 5; _goto_targ = 2; if (true) continue _goto; } } } break; case 3: // line 193 "JsonReader.rl" { if (debug) System.out.println("endObject"); pop(); if (stop) break _goto; { cs = stack[--top]; _goto_targ = 2; if (true) continue _goto; } } break; case 4: // line 199 "JsonReader.rl" { String name = names.size > 0 ? names.pop() : null; if (debug) System.out.println("startArray: " + name); startArray(name); if (stop) break _goto; { if (top == stack.length) stack = Arrays.copyOf(stack, stack.length * 2); { stack[top++] = cs; cs = 23; _goto_targ = 2; if (true) continue _goto; } } } break; case 5: // line 206 "JsonReader.rl" { if (debug) System.out.println("endArray"); pop(); if (stop) break _goto; { cs = stack[--top]; _goto_targ = 2; if (true) continue _goto; } } break; case 6: // line 212 "JsonReader.rl" { int start = p - 1; if (data[p++] == '/') { while (p != eof && data[p] != '\n') p++; p--; } else { while (p + 1 < eof && data[p] != '*' || data[p + 1] != '/') p++; p++; } if (debug) System.out.println("comment " + new String(data, start, p - start)); } break; case 7: // line 225 "JsonReader.rl" { if (debug) System.out.println("unquotedChars"); s = p; needsUnescape = false; stringIsUnquoted = true; if (stringIsName) { outer: while (true) { switch (data[p]) { case '\\': needsUnescape = true; break; case '/': if (p + 1 == eof) break; char c = data[p + 1]; if (c == '/' || c == '*') break outer; break; case ':': case '\r': case '\n': break outer; } if (debug) System.out.println("unquotedChar (name): '" + data[p] + "'"); p++; if (p == eof) break; } } else { outer: while (true) { switch (data[p]) { case '\\': needsUnescape = true; break; case '/': if (p + 1 == eof) break; char c = data[p + 1]; if (c == '/' || c == '*') break outer; break; case '}': case ']': case ',': case '\r': case '\n': break outer; } if (debug) System.out.println("unquotedChar (value): '" + data[p] + "'"); p++; if (p == eof) break; } } p--; while (Character.isSpace(data[p])) p--; } break; case 8: // line 279 "JsonReader.rl" { if (debug) System.out.println("quotedChars"); s = ++p; needsUnescape = false; outer: while (true) { switch (data[p]) { case '\\': needsUnescape = true; p++; break; case '"': break outer; } if (debug) System.out.println("quotedChar: '" + data[p] + "'"); p++; if (p == eof) break; } p--; } break; // line 310 "JsonReader.java" } } } case 2: if (cs == 0) { _goto_targ = 5; continue _goto; } if (++p != pe) { _goto_targ = 1; continue _goto; } case 4: if (p == eof) { int __acts = _json_eof_actions[cs]; int __nacts = (int)_json_actions[__acts++]; while (__nacts-- > 0) { switch (_json_actions[__acts++]) { case 1: // line 111 "JsonReader.rl" { String value = new String(data, s, p - s); if (needsUnescape) value = unescape(value); outer: if (stringIsName) { stringIsName = false; if (debug) System.out.println("name: " + value); names.add(value); } else { String name = names.size > 0 ? names.pop() : null; if (stringIsUnquoted) { if (value.equals("true")) { if (debug) System.out.println("boolean: " + name + "=true"); bool(name, true); break outer; } else if (value.equals("false")) { if (debug) System.out.println("boolean: " + name + "=false"); bool(name, false); break outer; } else if (value.equals("null")) { string(name, null); break outer; } boolean couldBeDouble = false, couldBeLong = true; outer2: for (int i = s; i < p; i++) { switch (data[i]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': case '+': break; case '.': case 'e': case 'E': couldBeDouble = true; couldBeLong = false; break; default: couldBeDouble = false; couldBeLong = false; break outer2; } } if (couldBeDouble) { try { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); number(name, Double.parseDouble(value), value); break outer; } catch (NumberFormatException ignored) { } } else if (couldBeLong) { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); try { number(name, Long.parseLong(value), value); break outer; } catch (NumberFormatException ignored) { } } } if (debug) System.out.println("string: " + name + "=" + value); string(name, value); } if (stop) break _goto; stringIsUnquoted = false; s = p; } break; // line 409 "JsonReader.java" } } } case 5: } break; } } // line 315 "JsonReader.rl" } catch (RuntimeException ex) { parseRuntimeEx = ex; } JsonValue root = this.root; this.root = null; current = null; lastChild.clear(); if (!stop) { if (p < pe) { int lineNumber = 1; for (int i = 0; i < p; i++) if (data[i] == '\n') lineNumber++; int start = Math.max(0, p - 32); throw new SerializationException("Error parsing JSON on line " + lineNumber + " near: " + new String(data, start, p - start) + "*ERROR*" + new String(data, p, Math.min(64, pe - p)), parseRuntimeEx); } if (elements.size != 0) { JsonValue element = elements.peek(); elements.clear(); if (element != null && element.isObject()) throw new SerializationException("Error parsing JSON, unmatched brace."); else throw new SerializationException("Error parsing JSON, unmatched bracket."); } if (parseRuntimeEx != null) throw new SerializationException("Error parsing JSON: " + new String(data), parseRuntimeEx); } return root; } // line 419 "JsonReader.java" private static byte[] init__json_actions_0 () { return new byte[] {0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 2, 0, 7, 2, 0, 8, 2, 1, 3, 2, 1, 5}; } private static final byte _json_actions[] = init__json_actions_0(); private static short[] init__json_key_offsets_0 () { return new short[] {0, 0, 11, 13, 14, 16, 25, 31, 37, 39, 50, 57, 64, 73, 74, 83, 85, 87, 96, 98, 100, 101, 103, 105, 116, 123, 130, 141, 142, 153, 155, 157, 168, 170, 172, 174, 179, 184, 184}; } private static final short _json_key_offsets[] = init__json_key_offsets_0(); private static char[] init__json_trans_keys_0 () { return new char[] {13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 42, 47, 34, 42, 47, 13, 32, 34, 44, 47, 58, 125, 9, 10, 13, 32, 47, 58, 9, 10, 13, 32, 47, 58, 9, 10, 42, 47, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 9, 10, 13, 32, 44, 47, 125, 9, 10, 13, 32, 44, 47, 125, 13, 32, 34, 44, 47, 58, 125, 9, 10, 34, 13, 32, 34, 44, 47, 58, 125, 9, 10, 42, 47, 42, 47, 13, 32, 34, 44, 47, 58, 125, 9, 10, 42, 47, 42, 47, 34, 42, 47, 42, 47, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 9, 10, 13, 32, 44, 47, 93, 9, 10, 13, 32, 44, 47, 93, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 34, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 42, 47, 42, 47, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 42, 47, 42, 47, 42, 47, 13, 32, 47, 9, 10, 13, 32, 47, 9, 10, 0}; } private static final char _json_trans_keys[] = init__json_trans_keys_0(); private static byte[] init__json_single_lengths_0 () { return new byte[] {0, 9, 2, 1, 2, 7, 4, 4, 2, 9, 7, 7, 7, 1, 7, 2, 2, 7, 2, 2, 1, 2, 2, 9, 7, 7, 9, 1, 9, 2, 2, 9, 2, 2, 2, 3, 3, 0, 0}; } private static final byte _json_single_lengths[] = init__json_single_lengths_0(); private static byte[] init__json_range_lengths_0 () { return new byte[] {0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0}; } private static final byte _json_range_lengths[] = init__json_range_lengths_0(); private static short[] init__json_index_offsets_0 () { return new short[] {0, 0, 11, 14, 16, 19, 28, 34, 40, 43, 54, 62, 70, 79, 81, 90, 93, 96, 105, 108, 111, 113, 116, 119, 130, 138, 146, 157, 159, 170, 173, 176, 187, 190, 193, 196, 201, 206, 207}; } private static final short _json_index_offsets[] = init__json_index_offsets_0(); private static byte[] init__json_indicies_0 () { return new byte[] {1, 1, 2, 3, 4, 3, 5, 3, 6, 1, 0, 7, 7, 3, 8, 3, 9, 9, 3, 11, 11, 12, 13, 14, 3, 15, 11, 10, 16, 16, 17, 18, 16, 3, 19, 19, 20, 21, 19, 3, 22, 22, 3, 21, 21, 24, 3, 25, 3, 26, 3, 27, 21, 23, 28, 29, 29, 28, 30, 31, 32, 3, 33, 34, 34, 33, 13, 35, 15, 3, 34, 34, 12, 36, 37, 3, 15, 34, 10, 16, 3, 36, 36, 12, 3, 38, 3, 3, 36, 10, 39, 39, 3, 40, 40, 3, 13, 13, 12, 3, 41, 3, 15, 13, 10, 42, 42, 3, 43, 43, 3, 28, 3, 44, 44, 3, 45, 45, 3, 47, 47, 48, 49, 50, 3, 51, 52, 53, 47, 46, 54, 55, 55, 54, 56, 57, 58, 3, 59, 60, 60, 59, 49, 61, 52, 3, 60, 60, 48, 62, 63, 3, 51, 52, 53, 60, 46, 54, 3, 62, 62, 48, 3, 64, 3, 51, 3, 53, 62, 46, 65, 65, 3, 66, 66, 3, 49, 49, 48, 3, 67, 3, 51, 52, 53, 49, 46, 68, 68, 3, 69, 69, 3, 70, 70, 3, 8, 8, 71, 8, 3, 72, 72, 73, 72, 3, 3, 3, 0}; } private static final byte _json_indicies[] = init__json_indicies_0(); private static byte[] init__json_trans_targs_0 () { return new byte[] {35, 1, 3, 0, 4, 36, 36, 36, 36, 1, 6, 5, 13, 17, 22, 37, 7, 8, 9, 7, 8, 9, 7, 10, 20, 21, 11, 11, 11, 12, 17, 19, 37, 11, 12, 19, 14, 16, 15, 14, 12, 18, 17, 11, 9, 5, 24, 23, 27, 31, 34, 25, 38, 25, 25, 26, 31, 33, 38, 25, 26, 33, 28, 30, 29, 28, 26, 32, 31, 25, 23, 2, 36, 2}; } private static final byte _json_trans_targs[] = init__json_trans_targs_0(); private static byte[] init__json_trans_actions_0 () { return new byte[] {13, 0, 15, 0, 0, 7, 3, 11, 1, 11, 17, 0, 20, 0, 0, 5, 1, 1, 1, 0, 0, 0, 11, 13, 15, 0, 7, 3, 1, 1, 1, 1, 23, 0, 0, 0, 0, 0, 0, 11, 11, 0, 11, 11, 11, 11, 13, 0, 15, 0, 0, 7, 9, 3, 1, 1, 1, 1, 26, 0, 0, 0, 0, 0, 0, 11, 11, 0, 11, 11, 11, 1, 0, 0}; } private static final byte _json_trans_actions[] = init__json_trans_actions_0(); private static byte[] init__json_eof_actions_0 () { return new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; } private static final byte _json_eof_actions[] = init__json_eof_actions_0(); static final int json_start = 1; static final int json_first_final = 35; static final int json_error = 0; static final int json_en_object = 5; static final int json_en_array = 23; static final int json_en_main = 1; // line 348 "JsonReader.rl" private final Array<JsonValue> elements = new Array(8); private final Array<JsonValue> lastChild = new Array(8); private JsonValue root, current; private boolean stop; /** Causes parsing to stop after the current or next object, array, or value. */ public void stop () { stop = true; } public boolean isStopped () { return stop; } /** @param name May be null. */ private void addChild (@Null String name, JsonValue child) { child.setName(name); if (current == null) { current = child; root = child; } else if (current.isArray() || current.isObject()) { child.parent = current; if (current.size == 0) current.child = child; else { JsonValue last = lastChild.pop(); last.next = child; child.prev = last; } lastChild.add(child); current.size++; } else root = current; } /** @param name May be null. */ protected void startObject (@Null String name) { JsonValue value = new JsonValue(ValueType.object); if (current != null) addChild(name, value); elements.add(value); current = value; } /** @param name May be null. */ protected void startArray (@Null String name) { JsonValue value = new JsonValue(ValueType.array); if (current != null) addChild(name, value); elements.add(value); current = value; } protected void pop () { root = elements.pop(); if (current.size > 0) lastChild.pop(); current = elements.size > 0 ? elements.peek() : null; } protected void string (String name, String value) { addChild(name, new JsonValue(value)); } protected void number (String name, double value, String stringValue) { addChild(name, new JsonValue(value, stringValue)); } protected void number (String name, long value, String stringValue) { addChild(name, new JsonValue(value, stringValue)); } protected void bool (String name, boolean value) { addChild(name, new JsonValue(value)); } private String unescape (String value) { int length = value.length(); StringBuilder buffer = new StringBuilder(length + 16); for (int i = 0; i < length;) { char c = value.charAt(i++); if (c != '\\') { buffer.append(c); continue; } if (i == length) break; c = value.charAt(i++); if (c == 'u') { buffer.append(Character.toChars(Integer.parseInt(value.substring(i, i + 4), 16))); i += 4; continue; } switch (c) { case '"': case '\\': case '/': break; case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; default: throw new SerializationException("Illegal escaped character: \\" + c); } buffer.append(c); } return buffer.toString(); } }
// line 1 "JsonReader.rl" // Do not edit this file! Generated by Ragel. // Ragel.exe -J -o ../../../../../src/com/badlogic/gdx/utils/JsonReader.java JsonReader.rl /******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.Arrays; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.JsonValue.ValueType; /** Lightweight JSON parser.<br> * <br> * The default behavior is to parse the JSON into a DOM containing {@link JsonValue} objects. Extend this class and override * methods to perform event driven parsing. When this is done, the parse methods will return null. * @author Nathan Sweet */ public class JsonReader implements BaseJsonReader { public JsonValue parse (String json) { char[] data = json.toCharArray(); return parse(data, 0, data.length); } public JsonValue parse (Reader reader) { char[] data = new char[1024]; int offset = 0; try { while (true) { int length = reader.read(data, offset, data.length - offset); if (length == -1) break; if (length == 0) { char[] newData = new char[data.length * 2]; System.arraycopy(data, 0, newData, 0, data.length); data = newData; } else offset += length; } } catch (IOException ex) { throw new SerializationException("Error reading input.", ex); } finally { StreamUtils.closeQuietly(reader); } return parse(data, 0, offset); } public JsonValue parse (InputStream input) { Reader reader; try { reader = new InputStreamReader(input, "UTF-8"); } catch (Exception ex) { throw new SerializationException("Error reading stream.", ex); } return parse(reader); } public JsonValue parse (FileHandle file) { Reader reader; try { reader = file.reader("UTF-8"); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } try { return parse(reader); } catch (Exception ex) { throw new SerializationException("Error parsing file: " + file, ex); } } public JsonValue parse (char[] data, int offset, int length) { stop = false; int cs, p = offset, pe = length, eof = pe, top = 0; int[] stack = new int[4]; int s = 0; Array<String> names = new Array(8); boolean needsUnescape = false, stringIsName = false, stringIsUnquoted = false; RuntimeException parseRuntimeEx = null; boolean debug = false; if (debug) System.out.println(); try { // line 3 "JsonReader.java" { cs = json_start; top = 0; } // line 8 "JsonReader.java" { int _klen; int _trans = 0; int _acts; int _nacts; int _keys; int _goto_targ = 0; _goto: while (true) { switch (_goto_targ) { case 0: if (p == pe) { _goto_targ = 4; continue _goto; } if (cs == 0) { _goto_targ = 5; continue _goto; } case 1: _match: do { _keys = _json_key_offsets[cs]; _trans = _json_index_offsets[cs]; _klen = _json_single_lengths[cs]; if (_klen > 0) { int _lower = _keys; int _mid; int _upper = _keys + _klen - 1; while (true) { if (_upper < _lower) break; _mid = _lower + ((_upper - _lower) >> 1); if (data[p] < _json_trans_keys[_mid]) _upper = _mid - 1; else if (data[p] > _json_trans_keys[_mid]) _lower = _mid + 1; else { _trans += (_mid - _keys); break _match; } } _keys += _klen; _trans += _klen; } _klen = _json_range_lengths[cs]; if (_klen > 0) { int _lower = _keys; int _mid; int _upper = _keys + (_klen << 1) - 2; while (true) { if (_upper < _lower) break; _mid = _lower + (((_upper - _lower) >> 1) & ~1); if (data[p] < _json_trans_keys[_mid]) _upper = _mid - 2; else if (data[p] > _json_trans_keys[_mid + 1]) _lower = _mid + 2; else { _trans += ((_mid - _keys) >> 1); break _match; } } _trans += _klen; } } while (false); _trans = _json_indicies[_trans]; cs = _json_trans_targs[_trans]; if (_json_trans_actions[_trans] != 0) { _acts = _json_trans_actions[_trans]; _nacts = (int)_json_actions[_acts++]; while (_nacts-- > 0) { switch (_json_actions[_acts++]) { case 0: // line 108 "JsonReader.rl" { stringIsName = true; } break; case 1: // line 111 "JsonReader.rl" { String value = new String(data, s, p - s); if (needsUnescape) value = unescape(value); outer: if (stringIsName) { stringIsName = false; if (debug) System.out.println("name: " + value); names.add(value); } else { String name = names.size > 0 ? names.pop() : null; if (stringIsUnquoted) { if (value.equals("true")) { if (debug) System.out.println("boolean: " + name + "=true"); bool(name, true); break outer; } else if (value.equals("false")) { if (debug) System.out.println("boolean: " + name + "=false"); bool(name, false); break outer; } else if (value.equals("null")) { string(name, null); break outer; } boolean couldBeDouble = false, couldBeLong = true; outer2: for (int i = s; i < p; i++) { switch (data[i]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': case '+': break; case '.': case 'e': case 'E': couldBeDouble = true; couldBeLong = false; break; default: couldBeDouble = false; couldBeLong = false; break outer2; } } if (couldBeDouble) { try { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); number(name, Double.parseDouble(value), value); break outer; } catch (NumberFormatException ignored) { } } else if (couldBeLong) { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); try { number(name, Long.parseLong(value), value); break outer; } catch (NumberFormatException ignored) { } } } if (debug) System.out.println("string: " + name + "=" + value); string(name, value); } if (stop) break _goto; stringIsUnquoted = false; s = p; } break; case 2: // line 186 "JsonReader.rl" { String name = names.size > 0 ? names.pop() : null; if (debug) System.out.println("startObject: " + name); startObject(name); if (stop) break _goto; { if (top == stack.length) stack = Arrays.copyOf(stack, stack.length * 2); { stack[top++] = cs; cs = 5; _goto_targ = 2; if (true) continue _goto; } } } break; case 3: // line 193 "JsonReader.rl" { if (debug) System.out.println("endObject"); pop(); if (stop) break _goto; { cs = stack[--top]; _goto_targ = 2; if (true) continue _goto; } } break; case 4: // line 199 "JsonReader.rl" { String name = names.size > 0 ? names.pop() : null; if (debug) System.out.println("startArray: " + name); startArray(name); if (stop) break _goto; { if (top == stack.length) stack = Arrays.copyOf(stack, stack.length * 2); { stack[top++] = cs; cs = 23; _goto_targ = 2; if (true) continue _goto; } } } break; case 5: // line 206 "JsonReader.rl" { if (debug) System.out.println("endArray"); pop(); if (stop) break _goto; { cs = stack[--top]; _goto_targ = 2; if (true) continue _goto; } } break; case 6: // line 212 "JsonReader.rl" { int start = p - 1; if (data[p++] == '/') { while (p != eof && data[p] != '\n') p++; p--; } else { while (p + 1 < eof && data[p] != '*' || data[p + 1] != '/') p++; p++; } if (debug) System.out.println("comment " + new String(data, start, p - start)); } break; case 7: // line 225 "JsonReader.rl" { if (debug) System.out.println("unquotedChars"); s = p; needsUnescape = false; stringIsUnquoted = true; if (stringIsName) { outer: while (true) { switch (data[p]) { case '\\': needsUnescape = true; break; case '/': if (p + 1 == eof) break; char c = data[p + 1]; if (c == '/' || c == '*') break outer; break; case ':': case '\r': case '\n': break outer; } if (debug) System.out.println("unquotedChar (name): '" + data[p] + "'"); p++; if (p == eof) break; } } else { outer: while (true) { switch (data[p]) { case '\\': needsUnescape = true; break; case '/': if (p + 1 == eof) break; char c = data[p + 1]; if (c == '/' || c == '*') break outer; break; case '}': case ']': case ',': case '\r': case '\n': break outer; } if (debug) System.out.println("unquotedChar (value): '" + data[p] + "'"); p++; if (p == eof) break; } } p--; while (Character.isSpace(data[p])) p--; } break; case 8: // line 279 "JsonReader.rl" { if (debug) System.out.println("quotedChars"); s = ++p; needsUnescape = false; outer: while (true) { switch (data[p]) { case '\\': needsUnescape = true; p++; break; case '"': break outer; } if (debug) System.out.println("quotedChar: '" + data[p] + "'"); p++; if (p == eof) break; } p--; } break; // line 310 "JsonReader.java" } } } case 2: if (cs == 0) { _goto_targ = 5; continue _goto; } if (++p != pe) { _goto_targ = 1; continue _goto; } case 4: if (p == eof) { int __acts = _json_eof_actions[cs]; int __nacts = (int)_json_actions[__acts++]; while (__nacts-- > 0) { switch (_json_actions[__acts++]) { case 1: // line 111 "JsonReader.rl" { String value = new String(data, s, p - s); if (needsUnescape) value = unescape(value); outer: if (stringIsName) { stringIsName = false; if (debug) System.out.println("name: " + value); names.add(value); } else { String name = names.size > 0 ? names.pop() : null; if (stringIsUnquoted) { if (value.equals("true")) { if (debug) System.out.println("boolean: " + name + "=true"); bool(name, true); break outer; } else if (value.equals("false")) { if (debug) System.out.println("boolean: " + name + "=false"); bool(name, false); break outer; } else if (value.equals("null")) { string(name, null); break outer; } boolean couldBeDouble = false, couldBeLong = true; outer2: for (int i = s; i < p; i++) { switch (data[i]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': case '+': break; case '.': case 'e': case 'E': couldBeDouble = true; couldBeLong = false; break; default: couldBeDouble = false; couldBeLong = false; break outer2; } } if (couldBeDouble) { try { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); number(name, Double.parseDouble(value), value); break outer; } catch (NumberFormatException ignored) { } } else if (couldBeLong) { if (debug) System.out.println("double: " + name + "=" + Double.parseDouble(value)); try { number(name, Long.parseLong(value), value); break outer; } catch (NumberFormatException ignored) { } } } if (debug) System.out.println("string: " + name + "=" + value); string(name, value); } if (stop) break _goto; stringIsUnquoted = false; s = p; } break; // line 409 "JsonReader.java" } } } case 5: } break; } } // line 315 "JsonReader.rl" } catch (RuntimeException ex) { parseRuntimeEx = ex; } JsonValue root = this.root; this.root = null; current = null; lastChild.clear(); if (!stop) { if (p < pe) { int lineNumber = 1; for (int i = 0; i < p; i++) if (data[i] == '\n') lineNumber++; int start = Math.max(0, p - 32); throw new SerializationException("Error parsing JSON on line " + lineNumber + " near: " + new String(data, start, p - start) + "*ERROR*" + new String(data, p, Math.min(64, pe - p)), parseRuntimeEx); } if (elements.size != 0) { JsonValue element = elements.peek(); elements.clear(); if (element != null && element.isObject()) throw new SerializationException("Error parsing JSON, unmatched brace."); else throw new SerializationException("Error parsing JSON, unmatched bracket."); } if (parseRuntimeEx != null) throw new SerializationException("Error parsing JSON: " + new String(data), parseRuntimeEx); } return root; } // line 419 "JsonReader.java" private static byte[] init__json_actions_0 () { return new byte[] {0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 2, 0, 7, 2, 0, 8, 2, 1, 3, 2, 1, 5}; } private static final byte _json_actions[] = init__json_actions_0(); private static short[] init__json_key_offsets_0 () { return new short[] {0, 0, 11, 13, 14, 16, 25, 31, 37, 39, 50, 57, 64, 73, 74, 83, 85, 87, 96, 98, 100, 101, 103, 105, 116, 123, 130, 141, 142, 153, 155, 157, 168, 170, 172, 174, 179, 184, 184}; } private static final short _json_key_offsets[] = init__json_key_offsets_0(); private static char[] init__json_trans_keys_0 () { return new char[] {13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 42, 47, 34, 42, 47, 13, 32, 34, 44, 47, 58, 125, 9, 10, 13, 32, 47, 58, 9, 10, 13, 32, 47, 58, 9, 10, 42, 47, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 9, 10, 13, 32, 44, 47, 125, 9, 10, 13, 32, 44, 47, 125, 13, 32, 34, 44, 47, 58, 125, 9, 10, 34, 13, 32, 34, 44, 47, 58, 125, 9, 10, 42, 47, 42, 47, 13, 32, 34, 44, 47, 58, 125, 9, 10, 42, 47, 42, 47, 34, 42, 47, 42, 47, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 9, 10, 13, 32, 44, 47, 93, 9, 10, 13, 32, 44, 47, 93, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 34, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 42, 47, 42, 47, 13, 32, 34, 44, 47, 58, 91, 93, 123, 9, 10, 42, 47, 42, 47, 42, 47, 13, 32, 47, 9, 10, 13, 32, 47, 9, 10, 0}; } private static final char _json_trans_keys[] = init__json_trans_keys_0(); private static byte[] init__json_single_lengths_0 () { return new byte[] {0, 9, 2, 1, 2, 7, 4, 4, 2, 9, 7, 7, 7, 1, 7, 2, 2, 7, 2, 2, 1, 2, 2, 9, 7, 7, 9, 1, 9, 2, 2, 9, 2, 2, 2, 3, 3, 0, 0}; } private static final byte _json_single_lengths[] = init__json_single_lengths_0(); private static byte[] init__json_range_lengths_0 () { return new byte[] {0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0}; } private static final byte _json_range_lengths[] = init__json_range_lengths_0(); private static short[] init__json_index_offsets_0 () { return new short[] {0, 0, 11, 14, 16, 19, 28, 34, 40, 43, 54, 62, 70, 79, 81, 90, 93, 96, 105, 108, 111, 113, 116, 119, 130, 138, 146, 157, 159, 170, 173, 176, 187, 190, 193, 196, 201, 206, 207}; } private static final short _json_index_offsets[] = init__json_index_offsets_0(); private static byte[] init__json_indicies_0 () { return new byte[] {1, 1, 2, 3, 4, 3, 5, 3, 6, 1, 0, 7, 7, 3, 8, 3, 9, 9, 3, 11, 11, 12, 13, 14, 3, 15, 11, 10, 16, 16, 17, 18, 16, 3, 19, 19, 20, 21, 19, 3, 22, 22, 3, 21, 21, 24, 3, 25, 3, 26, 3, 27, 21, 23, 28, 29, 29, 28, 30, 31, 32, 3, 33, 34, 34, 33, 13, 35, 15, 3, 34, 34, 12, 36, 37, 3, 15, 34, 10, 16, 3, 36, 36, 12, 3, 38, 3, 3, 36, 10, 39, 39, 3, 40, 40, 3, 13, 13, 12, 3, 41, 3, 15, 13, 10, 42, 42, 3, 43, 43, 3, 28, 3, 44, 44, 3, 45, 45, 3, 47, 47, 48, 49, 50, 3, 51, 52, 53, 47, 46, 54, 55, 55, 54, 56, 57, 58, 3, 59, 60, 60, 59, 49, 61, 52, 3, 60, 60, 48, 62, 63, 3, 51, 52, 53, 60, 46, 54, 3, 62, 62, 48, 3, 64, 3, 51, 3, 53, 62, 46, 65, 65, 3, 66, 66, 3, 49, 49, 48, 3, 67, 3, 51, 52, 53, 49, 46, 68, 68, 3, 69, 69, 3, 70, 70, 3, 8, 8, 71, 8, 3, 72, 72, 73, 72, 3, 3, 3, 0}; } private static final byte _json_indicies[] = init__json_indicies_0(); private static byte[] init__json_trans_targs_0 () { return new byte[] {35, 1, 3, 0, 4, 36, 36, 36, 36, 1, 6, 5, 13, 17, 22, 37, 7, 8, 9, 7, 8, 9, 7, 10, 20, 21, 11, 11, 11, 12, 17, 19, 37, 11, 12, 19, 14, 16, 15, 14, 12, 18, 17, 11, 9, 5, 24, 23, 27, 31, 34, 25, 38, 25, 25, 26, 31, 33, 38, 25, 26, 33, 28, 30, 29, 28, 26, 32, 31, 25, 23, 2, 36, 2}; } private static final byte _json_trans_targs[] = init__json_trans_targs_0(); private static byte[] init__json_trans_actions_0 () { return new byte[] {13, 0, 15, 0, 0, 7, 3, 11, 1, 11, 17, 0, 20, 0, 0, 5, 1, 1, 1, 0, 0, 0, 11, 13, 15, 0, 7, 3, 1, 1, 1, 1, 23, 0, 0, 0, 0, 0, 0, 11, 11, 0, 11, 11, 11, 11, 13, 0, 15, 0, 0, 7, 9, 3, 1, 1, 1, 1, 26, 0, 0, 0, 0, 0, 0, 11, 11, 0, 11, 11, 11, 1, 0, 0}; } private static final byte _json_trans_actions[] = init__json_trans_actions_0(); private static byte[] init__json_eof_actions_0 () { return new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; } private static final byte _json_eof_actions[] = init__json_eof_actions_0(); static final int json_start = 1; static final int json_first_final = 35; static final int json_error = 0; static final int json_en_object = 5; static final int json_en_array = 23; static final int json_en_main = 1; // line 348 "JsonReader.rl" private final Array<JsonValue> elements = new Array(8); private final Array<JsonValue> lastChild = new Array(8); private JsonValue root, current; private boolean stop; /** Causes parsing to stop after the current or next object, array, or value. */ public void stop () { stop = true; } public boolean isStopped () { return stop; } /** @param name May be null. */ private void addChild (@Null String name, JsonValue child) { child.setName(name); if (current == null) { current = child; root = child; } else if (current.isArray() || current.isObject()) { child.parent = current; if (current.size == 0) current.child = child; else { JsonValue last = lastChild.pop(); last.next = child; child.prev = last; } lastChild.add(child); current.size++; } else root = current; } /** @param name May be null. */ protected void startObject (@Null String name) { JsonValue value = new JsonValue(ValueType.object); if (current != null) addChild(name, value); elements.add(value); current = value; } /** @param name May be null. */ protected void startArray (@Null String name) { JsonValue value = new JsonValue(ValueType.array); if (current != null) addChild(name, value); elements.add(value); current = value; } protected void pop () { root = elements.pop(); if (current.size > 0) lastChild.pop(); current = elements.size > 0 ? elements.peek() : null; } protected void string (String name, String value) { addChild(name, new JsonValue(value)); } protected void number (String name, double value, String stringValue) { addChild(name, new JsonValue(value, stringValue)); } protected void number (String name, long value, String stringValue) { addChild(name, new JsonValue(value, stringValue)); } protected void bool (String name, boolean value) { addChild(name, new JsonValue(value)); } private String unescape (String value) { int length = value.length(); StringBuilder buffer = new StringBuilder(length + 16); for (int i = 0; i < length;) { char c = value.charAt(i++); if (c != '\\') { buffer.append(c); continue; } if (i == length) break; c = value.charAt(i++); if (c == 'u') { buffer.append(Character.toChars(Integer.parseInt(value.substring(i, i + 4), 16))); i += 4; continue; } switch (c) { case '"': case '\\': case '/': break; case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; default: throw new SerializationException("Illegal escaped character: \\" + c); } buffer.append(c); } return buffer.toString(); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/maps/Map.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.maps; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.maps.objects.CircleMapObject; import com.badlogic.gdx.maps.objects.TextureMapObject; import com.badlogic.gdx.maps.tiled.TiledMap; import com.badlogic.gdx.utils.Disposable; /** A generic level map implementation. * </p> * * A map has {@link MapProperties} which describe general attributes. Availability of properties depends on the type of map, e.g. * what format is was loaded from etc. * </p> * * A map has {@link MapLayers}. Map layers are ordered and indexed. A {@link MapLayer} contains {@link MapObjects} which represent * things within the layer. Different types of {@link MapObject} are available, e.g. {@link CircleMapObject}, * {@link TextureMapObject}, and so on. * </p> * * A map can be rendered by a {@link MapRenderer}. A MapRenderer implementation may chose to only render specific MapObject or * MapLayer types. * </p> * * There are more specialized implementations of Map for specific use cases. e.g. the {@link TiledMap} class and its associated * classes add functionality specifically for tile maps on top of the basic map functionality. * </p> * * Maps must be disposed through a call to {@link #dispose()} when no longer used. */ public class Map implements Disposable { private MapLayers layers = new MapLayers(); private MapProperties properties = new MapProperties(); /** Creates empty map */ public Map () { } /** @return the map's layers */ public MapLayers getLayers () { return layers; } /** @return the map's properties */ public MapProperties getProperties () { return properties; } /** Disposes all resources like {@link Texture} instances that the map may own. */ @Override public void dispose () { } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.maps; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.maps.objects.CircleMapObject; import com.badlogic.gdx.maps.objects.TextureMapObject; import com.badlogic.gdx.maps.tiled.TiledMap; import com.badlogic.gdx.utils.Disposable; /** A generic level map implementation. * </p> * * A map has {@link MapProperties} which describe general attributes. Availability of properties depends on the type of map, e.g. * what format is was loaded from etc. * </p> * * A map has {@link MapLayers}. Map layers are ordered and indexed. A {@link MapLayer} contains {@link MapObjects} which represent * things within the layer. Different types of {@link MapObject} are available, e.g. {@link CircleMapObject}, * {@link TextureMapObject}, and so on. * </p> * * A map can be rendered by a {@link MapRenderer}. A MapRenderer implementation may chose to only render specific MapObject or * MapLayer types. * </p> * * There are more specialized implementations of Map for specific use cases. e.g. the {@link TiledMap} class and its associated * classes add functionality specifically for tile maps on top of the basic map functionality. * </p> * * Maps must be disposed through a call to {@link #dispose()} when no longer used. */ public class Map implements Disposable { private MapLayers layers = new MapLayers(); private MapProperties properties = new MapProperties(); /** Creates empty map */ public Map () { } /** @return the map's layers */ public MapLayers getLayers () { return layers; } /** @return the map's properties */ public MapProperties getProperties () { return properties; } /** Disposes all resources like {@link Texture} instances that the map may own. */ @Override public void dispose () { } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/utils/compression/rangecoder/BitTreeEncoder.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils.compression.rangecoder; import java.io.IOException; public class BitTreeEncoder { short[] Models; int NumBitLevels; public BitTreeEncoder (int numBitLevels) { NumBitLevels = numBitLevels; Models = new short[1 << numBitLevels]; } public void Init () { Decoder.InitBitModels(Models); } public void Encode (Encoder rangeEncoder, int symbol) throws IOException { int m = 1; for (int bitIndex = NumBitLevels; bitIndex != 0;) { bitIndex--; int bit = (symbol >>> bitIndex) & 1; rangeEncoder.Encode(Models, m, bit); m = (m << 1) | bit; } } public void ReverseEncode (Encoder rangeEncoder, int symbol) throws IOException { int m = 1; for (int i = 0; i < NumBitLevels; i++) { int bit = symbol & 1; rangeEncoder.Encode(Models, m, bit); m = (m << 1) | bit; symbol >>= 1; } } public int GetPrice (int symbol) { int price = 0; int m = 1; for (int bitIndex = NumBitLevels; bitIndex != 0;) { bitIndex--; int bit = (symbol >>> bitIndex) & 1; price += Encoder.GetPrice(Models[m], bit); m = (m << 1) + bit; } return price; } public int ReverseGetPrice (int symbol) { int price = 0; int m = 1; for (int i = NumBitLevels; i != 0; i--) { int bit = symbol & 1; symbol >>>= 1; price += Encoder.GetPrice(Models[m], bit); m = (m << 1) | bit; } return price; } public static int ReverseGetPrice (short[] Models, int startIndex, int NumBitLevels, int symbol) { int price = 0; int m = 1; for (int i = NumBitLevels; i != 0; i--) { int bit = symbol & 1; symbol >>>= 1; price += Encoder.GetPrice(Models[startIndex + m], bit); m = (m << 1) | bit; } return price; } public static void ReverseEncode (short[] Models, int startIndex, Encoder rangeEncoder, int NumBitLevels, int symbol) throws IOException { int m = 1; for (int i = 0; i < NumBitLevels; i++) { int bit = symbol & 1; rangeEncoder.Encode(Models, startIndex + m, bit); m = (m << 1) | bit; symbol >>= 1; } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils.compression.rangecoder; import java.io.IOException; public class BitTreeEncoder { short[] Models; int NumBitLevels; public BitTreeEncoder (int numBitLevels) { NumBitLevels = numBitLevels; Models = new short[1 << numBitLevels]; } public void Init () { Decoder.InitBitModels(Models); } public void Encode (Encoder rangeEncoder, int symbol) throws IOException { int m = 1; for (int bitIndex = NumBitLevels; bitIndex != 0;) { bitIndex--; int bit = (symbol >>> bitIndex) & 1; rangeEncoder.Encode(Models, m, bit); m = (m << 1) | bit; } } public void ReverseEncode (Encoder rangeEncoder, int symbol) throws IOException { int m = 1; for (int i = 0; i < NumBitLevels; i++) { int bit = symbol & 1; rangeEncoder.Encode(Models, m, bit); m = (m << 1) | bit; symbol >>= 1; } } public int GetPrice (int symbol) { int price = 0; int m = 1; for (int bitIndex = NumBitLevels; bitIndex != 0;) { bitIndex--; int bit = (symbol >>> bitIndex) & 1; price += Encoder.GetPrice(Models[m], bit); m = (m << 1) + bit; } return price; } public int ReverseGetPrice (int symbol) { int price = 0; int m = 1; for (int i = NumBitLevels; i != 0; i--) { int bit = symbol & 1; symbol >>>= 1; price += Encoder.GetPrice(Models[m], bit); m = (m << 1) | bit; } return price; } public static int ReverseGetPrice (short[] Models, int startIndex, int NumBitLevels, int symbol) { int price = 0; int m = 1; for (int i = NumBitLevels; i != 0; i--) { int bit = symbol & 1; symbol >>>= 1; price += Encoder.GetPrice(Models[startIndex + m], bit); m = (m << 1) | bit; } return price; } public static void ReverseEncode (short[] Models, int startIndex, Encoder rangeEncoder, int NumBitLevels, int symbol) throws IOException { int m = 1; for (int i = 0; i < NumBitLevels; i++) { int bit = symbol & 1; rangeEncoder.Encode(Models, startIndex + m, bit); m = (m << 1) | bit; symbol >>= 1; } } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/audio/mock/MockSound.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.lwjgl3.audio.mock; import com.badlogic.gdx.audio.Sound; /** The headless backend does its best to mock elements. This is intended to make code-sharing between server and client as simple * as possible. */ public class MockSound implements Sound { @Override public long play () { return 0; } @Override public long play (float volume) { return 0; } @Override public long play (float volume, float pitch, float pan) { return 0; } @Override public long loop () { return 0; } @Override public long loop (float volume) { return 0; } @Override public long loop (float volume, float pitch, float pan) { return 0; } @Override public void stop () { } @Override public void pause () { } @Override public void resume () { } @Override public void dispose () { } @Override public void stop (long soundId) { } @Override public void pause (long soundId) { } @Override public void resume (long soundId) { } @Override public void setLooping (long soundId, boolean looping) { } @Override public void setPitch (long soundId, float pitch) { } @Override public void setVolume (long soundId, float volume) { } @Override public void setPan (long soundId, float pan, float volume) { } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.lwjgl3.audio.mock; import com.badlogic.gdx.audio.Sound; /** The headless backend does its best to mock elements. This is intended to make code-sharing between server and client as simple * as possible. */ public class MockSound implements Sound { @Override public long play () { return 0; } @Override public long play (float volume) { return 0; } @Override public long play (float volume, float pitch, float pan) { return 0; } @Override public long loop () { return 0; } @Override public long loop (float volume) { return 0; } @Override public long loop (float volume, float pitch, float pan) { return 0; } @Override public void stop () { } @Override public void pause () { } @Override public void resume () { } @Override public void dispose () { } @Override public void stop (long soundId) { } @Override public void pause (long soundId) { } @Override public void resume (long soundId) { } @Override public void setLooping (long soundId, boolean looping) { } @Override public void setPitch (long soundId, float pitch) { } @Override public void setVolume (long soundId, float volume) { } @Override public void setPan (long soundId, float pan, float volume) { } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/math/collision/OrientedBoundingBox.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.math.collision; import com.badlogic.gdx.math.Intersector; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; import java.io.Serializable; public class OrientedBoundingBox implements Serializable { private static final long serialVersionUID = 3864065514676250557L; private static final Vector3[] tempAxes = new Vector3[15]; private static final Vector3[] tempVertices = new Vector3[8]; private final static Vector3[] tmpVectors = new Vector3[9]; static { for (int i = 0; i < tmpVectors.length; i++) { tmpVectors[i] = new Vector3(); } for (int i = 0; i < tempVertices.length; i++) { tempVertices[i] = new Vector3(); } } /** Bounds used as size. */ private final BoundingBox bounds = new BoundingBox(); /** Transform matrix. */ public final Matrix4 transform = new Matrix4(); private final Matrix4 inverseTransform = new Matrix4(); private final Vector3[] axes = new Vector3[3]; private final Vector3[] vertices = new Vector3[8]; /** Constructs a new oriented bounding box with the minimum and maximum vector set to zeros. */ public OrientedBoundingBox () { bounds.clr(); init(); } /** Constructs a new oriented bounding box from the given bounding box. * * @param bounds The bounding box to copy */ public OrientedBoundingBox (BoundingBox bounds) { this.bounds.set(bounds.min, bounds.max); init(); } /** Constructs a new oriented bounding box from the given bounding box and transform. * * @param bounds The bounding box to copy * @param transform The transformation matrix to copy */ public OrientedBoundingBox (BoundingBox bounds, Matrix4 transform) { this.bounds.set(bounds.min, bounds.max); this.transform.set(transform); init(); } private void init () { for (int i = 0; i < axes.length; i++) { axes[i] = new Vector3(); } for (int i = 0; i < vertices.length; i++) { vertices[i] = new Vector3(); } update(); } public Vector3[] getVertices () { return vertices; } /** Get the current bounds. Call {@link #update()} if you manually change this bounding box. */ public BoundingBox getBounds () { return bounds; } /** Sets the base bounds of the oriented bounding box as the bounds given, the transform is applied to the vertices. * * @param bounds The bounding box to copy */ public void setBounds (BoundingBox bounds) { this.bounds.set(bounds); bounds.getCorner000(vertices[0b000]).mul(transform); bounds.getCorner001(vertices[0b001]).mul(transform); bounds.getCorner010(vertices[0b010]).mul(transform); bounds.getCorner011(vertices[0b011]).mul(transform); bounds.getCorner100(vertices[0b100]).mul(transform); bounds.getCorner101(vertices[0b101]).mul(transform); bounds.getCorner110(vertices[0b110]).mul(transform); bounds.getCorner111(vertices[0b111]).mul(transform); } /** Get the current transformation matrix. Call {@link #update()} if you manually change this matrix. */ public Matrix4 getTransform () { return transform; } public void setTransform (Matrix4 transform) { this.transform.set(transform); update(); } public OrientedBoundingBox set (BoundingBox bounds, Matrix4 transform) { setBounds(bounds); setTransform(transform); return this; } public Vector3 getCorner000 (final Vector3 out) { return out.set(vertices[0b000]); } public Vector3 getCorner001 (final Vector3 out) { return out.set(vertices[0b001]); } public Vector3 getCorner010 (final Vector3 out) { return out.set(vertices[0b010]); } public Vector3 getCorner011 (final Vector3 out) { return out.set(vertices[0b011]); } public Vector3 getCorner100 (final Vector3 out) { return out.set(vertices[0b100]); } public Vector3 getCorner101 (final Vector3 out) { return out.set(vertices[0b101]); } public Vector3 getCorner110 (final Vector3 out) { return out.set(vertices[0b110]); } public Vector3 getCorner111 (final Vector3 out) { return out.set(vertices[0b111]); } /** Returns whether the given vector is contained in this oriented bounding box. * @param v The vector * @return Whether the vector is contained or not. */ public boolean contains (Vector3 v) { return contains(v, inverseTransform); } private boolean contains (Vector3 v, Matrix4 invTransform) { Vector3 localV = tmpVectors[0].set(v).mul(invTransform); return bounds.contains(localV); } /** Returns whether the given bounding box is contained in this oriented bounding box. * @param b The bounding box * @return Whether the given bounding box is contained */ public boolean contains (BoundingBox b) { Vector3 tmpVector = tmpVectors[0]; return contains(b.getCorner000(tmpVector), inverseTransform) && contains(b.getCorner001(tmpVector), inverseTransform) && contains(b.getCorner010(tmpVector), inverseTransform) && contains(b.getCorner011(tmpVector), inverseTransform) && contains(b.getCorner100(tmpVector), inverseTransform) && contains(b.getCorner101(tmpVector), inverseTransform) && contains(b.getCorner110(tmpVector), inverseTransform) && contains(b.getCorner111(tmpVector), inverseTransform); } /** Returns whether the given oriented bounding box is contained in this oriented bounding box. * @param obb The oriented bounding box * @return Whether the given oriented bounding box is contained */ public boolean contains (OrientedBoundingBox obb) { return contains(obb.getCorner000(tmpVectors[0]), inverseTransform) && contains(obb.getCorner001(tmpVectors[0]), inverseTransform) && contains(obb.getCorner010(tmpVectors[0]), inverseTransform) && contains(obb.getCorner011(tmpVectors[0]), inverseTransform) && contains(obb.getCorner100(tmpVectors[0]), inverseTransform) && contains(obb.getCorner101(tmpVectors[0]), inverseTransform) && contains(obb.getCorner110(tmpVectors[0]), inverseTransform) && contains(obb.getCorner111(tmpVectors[0]), inverseTransform); } /** Returns whether the given bounding box is intersecting this oriented bounding box (at least one point in). * @param b The bounding box * @return Whether the given bounding box is intersected */ public boolean intersects (BoundingBox b) { Vector3[] aAxes = axes; tempAxes[0] = aAxes[0]; tempAxes[1] = aAxes[1]; tempAxes[2] = aAxes[2]; tempAxes[3] = Vector3.X; tempAxes[4] = Vector3.Y; tempAxes[5] = Vector3.Z; tempAxes[6] = tmpVectors[0].set(aAxes[0]).crs(Vector3.X); tempAxes[7] = tmpVectors[1].set(aAxes[0]).crs(Vector3.Y); tempAxes[8] = tmpVectors[2].set(aAxes[0]).crs(Vector3.Z); tempAxes[9] = tmpVectors[3].set(aAxes[1]).crs(Vector3.X); tempAxes[10] = tmpVectors[4].set(aAxes[1]).crs(Vector3.Y); tempAxes[11] = tmpVectors[5].set(aAxes[1]).crs(Vector3.Z); tempAxes[12] = tmpVectors[6].set(aAxes[2]).crs(Vector3.X); tempAxes[13] = tmpVectors[7].set(aAxes[2]).crs(Vector3.Y); tempAxes[14] = tmpVectors[8].set(aAxes[2]).crs(Vector3.Z); Vector3[] aVertices = getVertices(); Vector3[] bVertices = getVertices(b); return Intersector.hasOverlap(tempAxes, aVertices, bVertices); } /** Returns whether the given oriented bounding box is intersecting this oriented bounding box (at least one point in). * @param obb The oriented bounding box * @return Whether the given bounding box is intersected */ public boolean intersects (OrientedBoundingBox obb) { Vector3[] aAxes = axes; Vector3[] bAxes = obb.axes; tempAxes[0] = aAxes[0]; tempAxes[1] = aAxes[1]; tempAxes[2] = aAxes[2]; tempAxes[3] = bAxes[0]; tempAxes[4] = bAxes[1]; tempAxes[5] = bAxes[2]; tempAxes[6] = tmpVectors[0].set(aAxes[0]).crs(bAxes[0]); tempAxes[7] = tmpVectors[1].set(aAxes[0]).crs(bAxes[1]); tempAxes[8] = tmpVectors[2].set(aAxes[0]).crs(bAxes[2]); tempAxes[9] = tmpVectors[3].set(aAxes[1]).crs(bAxes[0]); tempAxes[10] = tmpVectors[4].set(aAxes[1]).crs(bAxes[1]); tempAxes[11] = tmpVectors[5].set(aAxes[1]).crs(bAxes[2]); tempAxes[12] = tmpVectors[6].set(aAxes[2]).crs(bAxes[0]); tempAxes[13] = tmpVectors[7].set(aAxes[2]).crs(bAxes[1]); tempAxes[14] = tmpVectors[8].set(aAxes[2]).crs(bAxes[2]); return Intersector.hasOverlap(tempAxes, vertices, obb.vertices); } private Vector3[] getVertices (BoundingBox b) { b.getCorner000(tempVertices[0b000]); b.getCorner001(tempVertices[0b001]); b.getCorner010(tempVertices[0b010]); b.getCorner011(tempVertices[0b011]); b.getCorner100(tempVertices[0b100]); b.getCorner101(tempVertices[0b101]); b.getCorner110(tempVertices[0b110]); b.getCorner111(tempVertices[0b111]); return tempVertices; } public void mul (Matrix4 transform) { this.transform.mul(transform); update(); } private void update () { // Update vertices bounds.getCorner000(vertices[0b000]).mul(transform); bounds.getCorner001(vertices[0b001]).mul(transform); bounds.getCorner010(vertices[0b010]).mul(transform); bounds.getCorner011(vertices[0b011]).mul(transform); bounds.getCorner100(vertices[0b100]).mul(transform); bounds.getCorner101(vertices[0b101]).mul(transform); bounds.getCorner110(vertices[0b110]).mul(transform); bounds.getCorner111(vertices[0b111]).mul(transform); axes[0].set(transform.val[Matrix4.M00], transform.val[Matrix4.M10], transform.val[Matrix4.M20]).nor(); axes[1].set(transform.val[Matrix4.M01], transform.val[Matrix4.M11], transform.val[Matrix4.M21]).nor(); axes[2].set(transform.val[Matrix4.M02], transform.val[Matrix4.M12], transform.val[Matrix4.M22]).nor(); inverseTransform.set(transform).inv(); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.math.collision; import com.badlogic.gdx.math.Intersector; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; import java.io.Serializable; public class OrientedBoundingBox implements Serializable { private static final long serialVersionUID = 3864065514676250557L; private static final Vector3[] tempAxes = new Vector3[15]; private static final Vector3[] tempVertices = new Vector3[8]; private final static Vector3[] tmpVectors = new Vector3[9]; static { for (int i = 0; i < tmpVectors.length; i++) { tmpVectors[i] = new Vector3(); } for (int i = 0; i < tempVertices.length; i++) { tempVertices[i] = new Vector3(); } } /** Bounds used as size. */ private final BoundingBox bounds = new BoundingBox(); /** Transform matrix. */ public final Matrix4 transform = new Matrix4(); private final Matrix4 inverseTransform = new Matrix4(); private final Vector3[] axes = new Vector3[3]; private final Vector3[] vertices = new Vector3[8]; /** Constructs a new oriented bounding box with the minimum and maximum vector set to zeros. */ public OrientedBoundingBox () { bounds.clr(); init(); } /** Constructs a new oriented bounding box from the given bounding box. * * @param bounds The bounding box to copy */ public OrientedBoundingBox (BoundingBox bounds) { this.bounds.set(bounds.min, bounds.max); init(); } /** Constructs a new oriented bounding box from the given bounding box and transform. * * @param bounds The bounding box to copy * @param transform The transformation matrix to copy */ public OrientedBoundingBox (BoundingBox bounds, Matrix4 transform) { this.bounds.set(bounds.min, bounds.max); this.transform.set(transform); init(); } private void init () { for (int i = 0; i < axes.length; i++) { axes[i] = new Vector3(); } for (int i = 0; i < vertices.length; i++) { vertices[i] = new Vector3(); } update(); } public Vector3[] getVertices () { return vertices; } /** Get the current bounds. Call {@link #update()} if you manually change this bounding box. */ public BoundingBox getBounds () { return bounds; } /** Sets the base bounds of the oriented bounding box as the bounds given, the transform is applied to the vertices. * * @param bounds The bounding box to copy */ public void setBounds (BoundingBox bounds) { this.bounds.set(bounds); bounds.getCorner000(vertices[0b000]).mul(transform); bounds.getCorner001(vertices[0b001]).mul(transform); bounds.getCorner010(vertices[0b010]).mul(transform); bounds.getCorner011(vertices[0b011]).mul(transform); bounds.getCorner100(vertices[0b100]).mul(transform); bounds.getCorner101(vertices[0b101]).mul(transform); bounds.getCorner110(vertices[0b110]).mul(transform); bounds.getCorner111(vertices[0b111]).mul(transform); } /** Get the current transformation matrix. Call {@link #update()} if you manually change this matrix. */ public Matrix4 getTransform () { return transform; } public void setTransform (Matrix4 transform) { this.transform.set(transform); update(); } public OrientedBoundingBox set (BoundingBox bounds, Matrix4 transform) { setBounds(bounds); setTransform(transform); return this; } public Vector3 getCorner000 (final Vector3 out) { return out.set(vertices[0b000]); } public Vector3 getCorner001 (final Vector3 out) { return out.set(vertices[0b001]); } public Vector3 getCorner010 (final Vector3 out) { return out.set(vertices[0b010]); } public Vector3 getCorner011 (final Vector3 out) { return out.set(vertices[0b011]); } public Vector3 getCorner100 (final Vector3 out) { return out.set(vertices[0b100]); } public Vector3 getCorner101 (final Vector3 out) { return out.set(vertices[0b101]); } public Vector3 getCorner110 (final Vector3 out) { return out.set(vertices[0b110]); } public Vector3 getCorner111 (final Vector3 out) { return out.set(vertices[0b111]); } /** Returns whether the given vector is contained in this oriented bounding box. * @param v The vector * @return Whether the vector is contained or not. */ public boolean contains (Vector3 v) { return contains(v, inverseTransform); } private boolean contains (Vector3 v, Matrix4 invTransform) { Vector3 localV = tmpVectors[0].set(v).mul(invTransform); return bounds.contains(localV); } /** Returns whether the given bounding box is contained in this oriented bounding box. * @param b The bounding box * @return Whether the given bounding box is contained */ public boolean contains (BoundingBox b) { Vector3 tmpVector = tmpVectors[0]; return contains(b.getCorner000(tmpVector), inverseTransform) && contains(b.getCorner001(tmpVector), inverseTransform) && contains(b.getCorner010(tmpVector), inverseTransform) && contains(b.getCorner011(tmpVector), inverseTransform) && contains(b.getCorner100(tmpVector), inverseTransform) && contains(b.getCorner101(tmpVector), inverseTransform) && contains(b.getCorner110(tmpVector), inverseTransform) && contains(b.getCorner111(tmpVector), inverseTransform); } /** Returns whether the given oriented bounding box is contained in this oriented bounding box. * @param obb The oriented bounding box * @return Whether the given oriented bounding box is contained */ public boolean contains (OrientedBoundingBox obb) { return contains(obb.getCorner000(tmpVectors[0]), inverseTransform) && contains(obb.getCorner001(tmpVectors[0]), inverseTransform) && contains(obb.getCorner010(tmpVectors[0]), inverseTransform) && contains(obb.getCorner011(tmpVectors[0]), inverseTransform) && contains(obb.getCorner100(tmpVectors[0]), inverseTransform) && contains(obb.getCorner101(tmpVectors[0]), inverseTransform) && contains(obb.getCorner110(tmpVectors[0]), inverseTransform) && contains(obb.getCorner111(tmpVectors[0]), inverseTransform); } /** Returns whether the given bounding box is intersecting this oriented bounding box (at least one point in). * @param b The bounding box * @return Whether the given bounding box is intersected */ public boolean intersects (BoundingBox b) { Vector3[] aAxes = axes; tempAxes[0] = aAxes[0]; tempAxes[1] = aAxes[1]; tempAxes[2] = aAxes[2]; tempAxes[3] = Vector3.X; tempAxes[4] = Vector3.Y; tempAxes[5] = Vector3.Z; tempAxes[6] = tmpVectors[0].set(aAxes[0]).crs(Vector3.X); tempAxes[7] = tmpVectors[1].set(aAxes[0]).crs(Vector3.Y); tempAxes[8] = tmpVectors[2].set(aAxes[0]).crs(Vector3.Z); tempAxes[9] = tmpVectors[3].set(aAxes[1]).crs(Vector3.X); tempAxes[10] = tmpVectors[4].set(aAxes[1]).crs(Vector3.Y); tempAxes[11] = tmpVectors[5].set(aAxes[1]).crs(Vector3.Z); tempAxes[12] = tmpVectors[6].set(aAxes[2]).crs(Vector3.X); tempAxes[13] = tmpVectors[7].set(aAxes[2]).crs(Vector3.Y); tempAxes[14] = tmpVectors[8].set(aAxes[2]).crs(Vector3.Z); Vector3[] aVertices = getVertices(); Vector3[] bVertices = getVertices(b); return Intersector.hasOverlap(tempAxes, aVertices, bVertices); } /** Returns whether the given oriented bounding box is intersecting this oriented bounding box (at least one point in). * @param obb The oriented bounding box * @return Whether the given bounding box is intersected */ public boolean intersects (OrientedBoundingBox obb) { Vector3[] aAxes = axes; Vector3[] bAxes = obb.axes; tempAxes[0] = aAxes[0]; tempAxes[1] = aAxes[1]; tempAxes[2] = aAxes[2]; tempAxes[3] = bAxes[0]; tempAxes[4] = bAxes[1]; tempAxes[5] = bAxes[2]; tempAxes[6] = tmpVectors[0].set(aAxes[0]).crs(bAxes[0]); tempAxes[7] = tmpVectors[1].set(aAxes[0]).crs(bAxes[1]); tempAxes[8] = tmpVectors[2].set(aAxes[0]).crs(bAxes[2]); tempAxes[9] = tmpVectors[3].set(aAxes[1]).crs(bAxes[0]); tempAxes[10] = tmpVectors[4].set(aAxes[1]).crs(bAxes[1]); tempAxes[11] = tmpVectors[5].set(aAxes[1]).crs(bAxes[2]); tempAxes[12] = tmpVectors[6].set(aAxes[2]).crs(bAxes[0]); tempAxes[13] = tmpVectors[7].set(aAxes[2]).crs(bAxes[1]); tempAxes[14] = tmpVectors[8].set(aAxes[2]).crs(bAxes[2]); return Intersector.hasOverlap(tempAxes, vertices, obb.vertices); } private Vector3[] getVertices (BoundingBox b) { b.getCorner000(tempVertices[0b000]); b.getCorner001(tempVertices[0b001]); b.getCorner010(tempVertices[0b010]); b.getCorner011(tempVertices[0b011]); b.getCorner100(tempVertices[0b100]); b.getCorner101(tempVertices[0b101]); b.getCorner110(tempVertices[0b110]); b.getCorner111(tempVertices[0b111]); return tempVertices; } public void mul (Matrix4 transform) { this.transform.mul(transform); update(); } private void update () { // Update vertices bounds.getCorner000(vertices[0b000]).mul(transform); bounds.getCorner001(vertices[0b001]).mul(transform); bounds.getCorner010(vertices[0b010]).mul(transform); bounds.getCorner011(vertices[0b011]).mul(transform); bounds.getCorner100(vertices[0b100]).mul(transform); bounds.getCorner101(vertices[0b101]).mul(transform); bounds.getCorner110(vertices[0b110]).mul(transform); bounds.getCorner111(vertices[0b111]).mul(transform); axes[0].set(transform.val[Matrix4.M00], transform.val[Matrix4.M10], transform.val[Matrix4.M20]).nor(); axes[1].set(transform.val[Matrix4.M01], transform.val[Matrix4.M11], transform.val[Matrix4.M21]).nor(); axes[2].set(transform.val[Matrix4.M02], transform.val[Matrix4.M12], transform.val[Matrix4.M22]).nor(); inverseTransform.set(transform).inv(); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./gdx/src/com/badlogic/gdx/graphics/g3d/particles/emitters/Emitter.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.particles.emitters; import com.badlogic.gdx.graphics.g3d.particles.ParticleControllerComponent; import com.badlogic.gdx.utils.Json; import com.badlogic.gdx.utils.JsonValue; /** An {@link Emitter} is a {@link ParticleControllerComponent} which will handle the particles emission. It must update the * {@link Emitter#percent} to reflect the current percentage of the current emission cycle. It should consider * {@link Emitter#minParticleCount} and {@link Emitter#maxParticleCount} to rule particle emission. It should notify the particle * controller when particles are activated, killed, or when an emission cycle begins. * @author Inferno */ public abstract class Emitter extends ParticleControllerComponent implements Json.Serializable { /** The min/max quantity of particles */ public int minParticleCount, maxParticleCount = 4; /** Current state of the emission, should be currentTime/ duration Must be updated on each update */ public float percent; public Emitter (Emitter regularEmitter) { set(regularEmitter); } public Emitter () { } @Override public void init () { controller.particles.size = 0; } @Override public void end () { controller.particles.size = 0; } public boolean isComplete () { return percent >= 1.0f; } public int getMinParticleCount () { return minParticleCount; } public void setMinParticleCount (int minParticleCount) { this.minParticleCount = minParticleCount; } public int getMaxParticleCount () { return maxParticleCount; } public void setMaxParticleCount (int maxParticleCount) { this.maxParticleCount = maxParticleCount; } public void setParticleCount (int aMin, int aMax) { setMinParticleCount(aMin); setMaxParticleCount(aMax); } public void set (Emitter emitter) { minParticleCount = emitter.minParticleCount; maxParticleCount = emitter.maxParticleCount; } @Override public void write (Json json) { json.writeValue("minParticleCount", minParticleCount); json.writeValue("maxParticleCount", maxParticleCount); } @Override public void read (Json json, JsonValue jsonData) { minParticleCount = json.readValue("minParticleCount", int.class, jsonData); maxParticleCount = json.readValue("maxParticleCount", int.class, jsonData); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.particles.emitters; import com.badlogic.gdx.graphics.g3d.particles.ParticleControllerComponent; import com.badlogic.gdx.utils.Json; import com.badlogic.gdx.utils.JsonValue; /** An {@link Emitter} is a {@link ParticleControllerComponent} which will handle the particles emission. It must update the * {@link Emitter#percent} to reflect the current percentage of the current emission cycle. It should consider * {@link Emitter#minParticleCount} and {@link Emitter#maxParticleCount} to rule particle emission. It should notify the particle * controller when particles are activated, killed, or when an emission cycle begins. * @author Inferno */ public abstract class Emitter extends ParticleControllerComponent implements Json.Serializable { /** The min/max quantity of particles */ public int minParticleCount, maxParticleCount = 4; /** Current state of the emission, should be currentTime/ duration Must be updated on each update */ public float percent; public Emitter (Emitter regularEmitter) { set(regularEmitter); } public Emitter () { } @Override public void init () { controller.particles.size = 0; } @Override public void end () { controller.particles.size = 0; } public boolean isComplete () { return percent >= 1.0f; } public int getMinParticleCount () { return minParticleCount; } public void setMinParticleCount (int minParticleCount) { this.minParticleCount = minParticleCount; } public int getMaxParticleCount () { return maxParticleCount; } public void setMaxParticleCount (int maxParticleCount) { this.maxParticleCount = maxParticleCount; } public void setParticleCount (int aMin, int aMax) { setMinParticleCount(aMin); setMaxParticleCount(aMax); } public void set (Emitter emitter) { minParticleCount = emitter.minParticleCount; maxParticleCount = emitter.maxParticleCount; } @Override public void write (Json json) { json.writeValue("minParticleCount", minParticleCount); json.writeValue("maxParticleCount", maxParticleCount); } @Override public void read (Json json, JsonValue jsonData) { minParticleCount = json.readValue("minParticleCount", int.class, jsonData); maxParticleCount = json.readValue("maxParticleCount", int.class, jsonData); } }
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-bullet/jni/src/bullet/LinearMath/btAlignedAllocator.cpp
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btAlignedAllocator.h" int gNumAlignedAllocs = 0; int gNumAlignedFree = 0; int gTotalBytesAlignedAllocs = 0;//detect memory leaks static void *btAllocDefault(size_t size) { return malloc(size); } static void btFreeDefault(void *ptr) { free(ptr); } static btAllocFunc *sAllocFunc = btAllocDefault; static btFreeFunc *sFreeFunc = btFreeDefault; #if defined (BT_HAS_ALIGNED_ALLOCATOR) #include <malloc.h> static void *btAlignedAllocDefault(size_t size, int alignment) { return _aligned_malloc(size, (size_t)alignment); } static void btAlignedFreeDefault(void *ptr) { _aligned_free(ptr); } #elif defined(__CELLOS_LV2__) #include <stdlib.h> static inline void *btAlignedAllocDefault(size_t size, int alignment) { return memalign(alignment, size); } static inline void btAlignedFreeDefault(void *ptr) { free(ptr); } #else static inline void *btAlignedAllocDefault(size_t size, int alignment) { void *ret; char *real; real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1)); if (real) { ret = btAlignPointer(real + sizeof(void *),alignment); *((void **)(ret)-1) = (void *)(real); } else { ret = (void *)(real); } return (ret); } static inline void btAlignedFreeDefault(void *ptr) { void* real; if (ptr) { real = *((void **)(ptr)-1); sFreeFunc(real); } } #endif static btAlignedAllocFunc *sAlignedAllocFunc = btAlignedAllocDefault; static btAlignedFreeFunc *sAlignedFreeFunc = btAlignedFreeDefault; void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc) { sAlignedAllocFunc = allocFunc ? allocFunc : btAlignedAllocDefault; sAlignedFreeFunc = freeFunc ? freeFunc : btAlignedFreeDefault; } void btAlignedAllocSetCustom(btAllocFunc *allocFunc, btFreeFunc *freeFunc) { sAllocFunc = allocFunc ? allocFunc : btAllocDefault; sFreeFunc = freeFunc ? freeFunc : btFreeDefault; } #ifdef BT_DEBUG_MEMORY_ALLOCATIONS static int allocations_id[10241024]; static int allocations_bytes[10241024]; static int mynumallocs = 0; #include <stdio.h> int btDumpMemoryLeaks() { int totalLeak = 0; for (int i=0;i<mynumallocs;i++) { printf("Error: leaked memory of allocation #%d (%d bytes)\n", allocations_id[i], allocations_bytes[i]); totalLeak+=allocations_bytes[i]; } if (totalLeak) { printf("Error: memory leaks: %d allocations were not freed and leaked together %d bytes\n",mynumallocs,totalLeak); } return totalLeak; } //this generic allocator provides the total allocated number of bytes #include <stdio.h> struct btDebugPtrMagic { union { void** vptrptr; void* vptr; int* iptr; char* cptr; }; }; void* btAlignedAllocInternal (size_t size, int alignment,int line,char* filename) { if (size==0) { printf("Whaat? size==0"); return 0; } static int allocId = 0; void *ret; char *real; // to find some particular memory leak, you could do something like this: // if (allocId==172) // { // printf("catch me!\n"); // } // if (size>1024*1024) // { // printf("big alloc!%d\n", size); // } gTotalBytesAlignedAllocs += size; gNumAlignedAllocs++; int sz4prt = 4*sizeof(void *); real = (char *)sAllocFunc(size + sz4prt + (alignment-1)); if (real) { ret = (void*) btAlignPointer(real + sz4prt, alignment); btDebugPtrMagic p; p.vptr = ret; p.cptr-=sizeof(void*); *p.vptrptr = (void*)real; p.cptr-=sizeof(void*); *p.iptr = size; p.cptr-=sizeof(void*); *p.iptr = allocId; allocations_id[mynumallocs] = allocId; allocations_bytes[mynumallocs] = size; mynumallocs++; } else { ret = (void *)(real);//?? } printf("allocation %d at address %x, from %s,line %d, size %d (total allocated = %d)\n",allocId,real, filename,line,size,gTotalBytesAlignedAllocs); allocId++; int* ptr = (int*)ret; *ptr = 12; return (ret); } void btAlignedFreeInternal (void* ptr,int line,char* filename) { void* real; if (ptr) { gNumAlignedFree++; btDebugPtrMagic p; p.vptr = ptr; p.cptr-=sizeof(void*); real = *p.vptrptr; p.cptr-=sizeof(void*); int size = *p.iptr; p.cptr-=sizeof(void*); int allocId = *p.iptr; bool found = false; for (int i=0;i<mynumallocs;i++) { if ( allocations_id[i] == allocId) { allocations_id[i] = allocations_id[mynumallocs-1]; allocations_bytes[i] = allocations_bytes[mynumallocs-1]; mynumallocs--; found = true; break; } } gTotalBytesAlignedAllocs -= size; int diff = gNumAlignedAllocs-gNumAlignedFree; printf("free %d at address %x, from %s,line %d, size %d (total remain = %d in %d non-freed allocations)\n",allocId,real, filename,line,size, gTotalBytesAlignedAllocs, diff); sFreeFunc(real); } else { //printf("deleting a NULL ptr, no effect\n"); } } #else //BT_DEBUG_MEMORY_ALLOCATIONS void* btAlignedAllocInternal (size_t size, int alignment) { gNumAlignedAllocs++; void* ptr; ptr = sAlignedAllocFunc(size, alignment); // printf("btAlignedAllocInternal %d, %x\n",size,ptr); return ptr; } void btAlignedFreeInternal (void* ptr) { if (!ptr) { return; } gNumAlignedFree++; // printf("btAlignedFreeInternal %x\n",ptr); sAlignedFreeFunc(ptr); } #endif //BT_DEBUG_MEMORY_ALLOCATIONS
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btAlignedAllocator.h" int gNumAlignedAllocs = 0; int gNumAlignedFree = 0; int gTotalBytesAlignedAllocs = 0;//detect memory leaks static void *btAllocDefault(size_t size) { return malloc(size); } static void btFreeDefault(void *ptr) { free(ptr); } static btAllocFunc *sAllocFunc = btAllocDefault; static btFreeFunc *sFreeFunc = btFreeDefault; #if defined (BT_HAS_ALIGNED_ALLOCATOR) #include <malloc.h> static void *btAlignedAllocDefault(size_t size, int alignment) { return _aligned_malloc(size, (size_t)alignment); } static void btAlignedFreeDefault(void *ptr) { _aligned_free(ptr); } #elif defined(__CELLOS_LV2__) #include <stdlib.h> static inline void *btAlignedAllocDefault(size_t size, int alignment) { return memalign(alignment, size); } static inline void btAlignedFreeDefault(void *ptr) { free(ptr); } #else static inline void *btAlignedAllocDefault(size_t size, int alignment) { void *ret; char *real; real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1)); if (real) { ret = btAlignPointer(real + sizeof(void *),alignment); *((void **)(ret)-1) = (void *)(real); } else { ret = (void *)(real); } return (ret); } static inline void btAlignedFreeDefault(void *ptr) { void* real; if (ptr) { real = *((void **)(ptr)-1); sFreeFunc(real); } } #endif static btAlignedAllocFunc *sAlignedAllocFunc = btAlignedAllocDefault; static btAlignedFreeFunc *sAlignedFreeFunc = btAlignedFreeDefault; void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc) { sAlignedAllocFunc = allocFunc ? allocFunc : btAlignedAllocDefault; sAlignedFreeFunc = freeFunc ? freeFunc : btAlignedFreeDefault; } void btAlignedAllocSetCustom(btAllocFunc *allocFunc, btFreeFunc *freeFunc) { sAllocFunc = allocFunc ? allocFunc : btAllocDefault; sFreeFunc = freeFunc ? freeFunc : btFreeDefault; } #ifdef BT_DEBUG_MEMORY_ALLOCATIONS static int allocations_id[10241024]; static int allocations_bytes[10241024]; static int mynumallocs = 0; #include <stdio.h> int btDumpMemoryLeaks() { int totalLeak = 0; for (int i=0;i<mynumallocs;i++) { printf("Error: leaked memory of allocation #%d (%d bytes)\n", allocations_id[i], allocations_bytes[i]); totalLeak+=allocations_bytes[i]; } if (totalLeak) { printf("Error: memory leaks: %d allocations were not freed and leaked together %d bytes\n",mynumallocs,totalLeak); } return totalLeak; } //this generic allocator provides the total allocated number of bytes #include <stdio.h> struct btDebugPtrMagic { union { void** vptrptr; void* vptr; int* iptr; char* cptr; }; }; void* btAlignedAllocInternal (size_t size, int alignment,int line,char* filename) { if (size==0) { printf("Whaat? size==0"); return 0; } static int allocId = 0; void *ret; char *real; // to find some particular memory leak, you could do something like this: // if (allocId==172) // { // printf("catch me!\n"); // } // if (size>1024*1024) // { // printf("big alloc!%d\n", size); // } gTotalBytesAlignedAllocs += size; gNumAlignedAllocs++; int sz4prt = 4*sizeof(void *); real = (char *)sAllocFunc(size + sz4prt + (alignment-1)); if (real) { ret = (void*) btAlignPointer(real + sz4prt, alignment); btDebugPtrMagic p; p.vptr = ret; p.cptr-=sizeof(void*); *p.vptrptr = (void*)real; p.cptr-=sizeof(void*); *p.iptr = size; p.cptr-=sizeof(void*); *p.iptr = allocId; allocations_id[mynumallocs] = allocId; allocations_bytes[mynumallocs] = size; mynumallocs++; } else { ret = (void *)(real);//?? } printf("allocation %d at address %x, from %s,line %d, size %d (total allocated = %d)\n",allocId,real, filename,line,size,gTotalBytesAlignedAllocs); allocId++; int* ptr = (int*)ret; *ptr = 12; return (ret); } void btAlignedFreeInternal (void* ptr,int line,char* filename) { void* real; if (ptr) { gNumAlignedFree++; btDebugPtrMagic p; p.vptr = ptr; p.cptr-=sizeof(void*); real = *p.vptrptr; p.cptr-=sizeof(void*); int size = *p.iptr; p.cptr-=sizeof(void*); int allocId = *p.iptr; bool found = false; for (int i=0;i<mynumallocs;i++) { if ( allocations_id[i] == allocId) { allocations_id[i] = allocations_id[mynumallocs-1]; allocations_bytes[i] = allocations_bytes[mynumallocs-1]; mynumallocs--; found = true; break; } } gTotalBytesAlignedAllocs -= size; int diff = gNumAlignedAllocs-gNumAlignedFree; printf("free %d at address %x, from %s,line %d, size %d (total remain = %d in %d non-freed allocations)\n",allocId,real, filename,line,size, gTotalBytesAlignedAllocs, diff); sFreeFunc(real); } else { //printf("deleting a NULL ptr, no effect\n"); } } #else //BT_DEBUG_MEMORY_ALLOCATIONS void* btAlignedAllocInternal (size_t size, int alignment) { gNumAlignedAllocs++; void* ptr; ptr = sAlignedAllocFunc(size, alignment); // printf("btAlignedAllocInternal %d, %x\n",size,ptr); return ptr; } void btAlignedFreeInternal (void* ptr) { if (!ptr) { return; } gNumAlignedFree++; // printf("btAlignedFreeInternal %x\n",ptr); sAlignedFreeFunc(ptr); } #endif //BT_DEBUG_MEMORY_ALLOCATIONS
-1
libgdx/libgdx
7,246
Upgrade libGDX to Gradle 8.4
Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
obigu
2023-10-05T11:17:22Z
2023-11-20T10:44:55Z
fe99b6a16a4146aab76a728f607d7a3bb49ece6f
46fa173398ce38d0c9ee358cd67da782a5a95724
Upgrade libGDX to Gradle 8.4. Upgraded libGDX project itself to Gradle ~~8.3~~ 8.4. It requires building with Java 17 and upgrading GWT plugin and AGP plugin. Tested running the tests on Lwjgl3, Android and GWT.
./extensions/gdx-bullet/jni/src/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "LinearMath/btScalar.h" #include "btSimulationIslandManager.h" #include "BulletCollision/BroadphaseCollision/btDispatcher.h" #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionDispatch/btCollisionWorld.h" //#include <stdio.h> #include "LinearMath/btQuickprof.h" btSimulationIslandManager::btSimulationIslandManager(): m_splitIslands(true) { } btSimulationIslandManager::~btSimulationIslandManager() { } void btSimulationIslandManager::initUnionFind(int n) { m_unionFind.reset(n); } void btSimulationIslandManager::findUnions(btDispatcher* /* dispatcher */,btCollisionWorld* colWorld) { { btOverlappingPairCache* pairCachePtr = colWorld->getPairCache(); const int numOverlappingPairs = pairCachePtr->getNumOverlappingPairs(); if (numOverlappingPairs) { btBroadphasePair* pairPtr = pairCachePtr->getOverlappingPairArrayPtr(); for (int i=0;i<numOverlappingPairs;i++) { const btBroadphasePair& collisionPair = pairPtr[i]; btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject; btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject; if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && ((colObj1) && ((colObj1)->mergesSimulationIslands()))) { m_unionFind.unite((colObj0)->getIslandTag(), (colObj1)->getIslandTag()); } } } } } #ifdef STATIC_SIMULATION_ISLAND_OPTIMIZATION void btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher) { // put the index into m_controllers into m_tag int index = 0; { int i; for (i=0;i<colWorld->getCollisionObjectArray().size(); i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; //Adding filtering here if (!collisionObject->isStaticOrKinematicObject()) { collisionObject->setIslandTag(index++); } collisionObject->setCompanionId(-1); collisionObject->setHitFraction(btScalar(1.)); } } // do the union find initUnionFind( index ); findUnions(dispatcher,colWorld); } void btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld) { // put the islandId ('find' value) into m_tag { int index = 0; int i; for (i=0;i<colWorld->getCollisionObjectArray().size();i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; if (!collisionObject->isStaticOrKinematicObject()) { collisionObject->setIslandTag( m_unionFind.find(index) ); //Set the correct object offset in Collision Object Array m_unionFind.getElement(index).m_sz = i; collisionObject->setCompanionId(-1); index++; } else { collisionObject->setIslandTag(-1); collisionObject->setCompanionId(-2); } } } } #else //STATIC_SIMULATION_ISLAND_OPTIMIZATION void btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher) { initUnionFind( int (colWorld->getCollisionObjectArray().size())); // put the index into m_controllers into m_tag { int index = 0; int i; for (i=0;i<colWorld->getCollisionObjectArray().size(); i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; collisionObject->setIslandTag(index); collisionObject->setCompanionId(-1); collisionObject->setHitFraction(btScalar(1.)); index++; } } // do the union find findUnions(dispatcher,colWorld); } void btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld) { // put the islandId ('find' value) into m_tag { int index = 0; int i; for (i=0;i<colWorld->getCollisionObjectArray().size();i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; if (!collisionObject->isStaticOrKinematicObject()) { collisionObject->setIslandTag( m_unionFind.find(index) ); collisionObject->setCompanionId(-1); } else { collisionObject->setIslandTag(-1); collisionObject->setCompanionId(-2); } index++; } } } #endif //STATIC_SIMULATION_ISLAND_OPTIMIZATION inline int getIslandId(const btPersistentManifold* lhs) { int islandId; const btCollisionObject* rcolObj0 = static_cast<const btCollisionObject*>(lhs->getBody0()); const btCollisionObject* rcolObj1 = static_cast<const btCollisionObject*>(lhs->getBody1()); islandId= rcolObj0->getIslandTag()>=0?rcolObj0->getIslandTag():rcolObj1->getIslandTag(); return islandId; } /// function object that routes calls to operator< class btPersistentManifoldSortPredicate { public: SIMD_FORCE_INLINE bool operator() ( const btPersistentManifold* lhs, const btPersistentManifold* rhs ) const { return getIslandId(lhs) < getIslandId(rhs); } }; void btSimulationIslandManager::buildIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld) { BT_PROFILE("islandUnionFindAndQuickSort"); btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray(); m_islandmanifold.resize(0); //we are going to sort the unionfind array, and store the element id in the size //afterwards, we clean unionfind, to make sure no-one uses it anymore getUnionFind().sortIslands(); int numElem = getUnionFind().getNumElements(); int endIslandIndex=1; int startIslandIndex; //update the sleeping state for bodies, if all are sleeping for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex) { int islandId = getUnionFind().getElement(startIslandIndex).m_id; for (endIslandIndex = startIslandIndex+1;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++) { } //int numSleeping = 0; bool allSleeping = true; int idx; for (idx=startIslandIndex;idx<endIslandIndex;idx++) { int i = getUnionFind().getElement(idx).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) { // printf("error in island management\n"); } btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { if (colObj0->getActivationState()== ACTIVE_TAG) { allSleeping = false; } if (colObj0->getActivationState()== DISABLE_DEACTIVATION) { allSleeping = false; } } } if (allSleeping) { int idx; for (idx=startIslandIndex;idx<endIslandIndex;idx++) { int i = getUnionFind().getElement(idx).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) { // printf("error in island management\n"); } btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { colObj0->setActivationState( ISLAND_SLEEPING ); } } } else { int idx; for (idx=startIslandIndex;idx<endIslandIndex;idx++) { int i = getUnionFind().getElement(idx).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) { // printf("error in island management\n"); } btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { if ( colObj0->getActivationState() == ISLAND_SLEEPING) { colObj0->setActivationState( WANTS_DEACTIVATION); colObj0->setDeactivationTime(0.f); } } } } } int i; int maxNumManifolds = dispatcher->getNumManifolds(); //#define SPLIT_ISLANDS 1 //#ifdef SPLIT_ISLANDS //#endif //SPLIT_ISLANDS for (i=0;i<maxNumManifolds ;i++) { btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i); const btCollisionObject* colObj0 = static_cast<const btCollisionObject*>(manifold->getBody0()); const btCollisionObject* colObj1 = static_cast<const btCollisionObject*>(manifold->getBody1()); ///@todo: check sleeping conditions! if (((colObj0) && colObj0->getActivationState() != ISLAND_SLEEPING) || ((colObj1) && colObj1->getActivationState() != ISLAND_SLEEPING)) { //kinematic objects don't merge islands, but wake up all connected objects if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING) { if (colObj0->hasContactResponse()) colObj1->activate(); } if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING) { if (colObj1->hasContactResponse()) colObj0->activate(); } if(m_splitIslands) { //filtering for response if (dispatcher->needsResponse(colObj0,colObj1)) m_islandmanifold.push_back(manifold); } } } } ///@todo: this is random access, it can be walked 'cache friendly'! void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld, IslandCallback* callback) { btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray(); buildIslands(dispatcher,collisionWorld); int endIslandIndex=1; int startIslandIndex; int numElem = getUnionFind().getNumElements(); BT_PROFILE("processIslands"); if(!m_splitIslands) { btPersistentManifold** manifold = dispatcher->getInternalManifoldPointer(); int maxNumManifolds = dispatcher->getNumManifolds(); callback->processIsland(&collisionObjects[0],collisionObjects.size(),manifold,maxNumManifolds, -1); } else { // Sort manifolds, based on islands // Sort the vector using predicate and std::sort //std::sort(islandmanifold.begin(), islandmanifold.end(), btPersistentManifoldSortPredicate); int numManifolds = int (m_islandmanifold.size()); //tried a radix sort, but quicksort/heapsort seems still faster //@todo rewrite island management m_islandmanifold.quickSort(btPersistentManifoldSortPredicate()); //m_islandmanifold.heapSort(btPersistentManifoldSortPredicate()); //now process all active islands (sets of manifolds for now) int startManifoldIndex = 0; int endManifoldIndex = 1; //int islandId; // printf("Start Islands\n"); //traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex) { int islandId = getUnionFind().getElement(startIslandIndex).m_id; bool islandSleeping = true; for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++) { int i = getUnionFind().getElement(endIslandIndex).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; m_islandBodies.push_back(colObj0); if (colObj0->isActive()) islandSleeping = false; } //find the accompanying contact manifold for this islandId int numIslandManifolds = 0; btPersistentManifold** startManifold = 0; if (startManifoldIndex<numManifolds) { int curIslandId = getIslandId(m_islandmanifold[startManifoldIndex]); if (curIslandId == islandId) { startManifold = &m_islandmanifold[startManifoldIndex]; for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(m_islandmanifold[endManifoldIndex]));endManifoldIndex++) { } /// Process the actual simulation, only if not sleeping/deactivated numIslandManifolds = endManifoldIndex-startManifoldIndex; } } if (!islandSleeping) { callback->processIsland(&m_islandBodies[0],m_islandBodies.size(),startManifold,numIslandManifolds, islandId); // printf("Island callback of size:%d bodies, %d manifolds\n",islandBodies.size(),numIslandManifolds); } if (numIslandManifolds) { startManifoldIndex = endManifoldIndex; } m_islandBodies.resize(0); } } // else if(!splitIslands) }
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "LinearMath/btScalar.h" #include "btSimulationIslandManager.h" #include "BulletCollision/BroadphaseCollision/btDispatcher.h" #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionDispatch/btCollisionWorld.h" //#include <stdio.h> #include "LinearMath/btQuickprof.h" btSimulationIslandManager::btSimulationIslandManager(): m_splitIslands(true) { } btSimulationIslandManager::~btSimulationIslandManager() { } void btSimulationIslandManager::initUnionFind(int n) { m_unionFind.reset(n); } void btSimulationIslandManager::findUnions(btDispatcher* /* dispatcher */,btCollisionWorld* colWorld) { { btOverlappingPairCache* pairCachePtr = colWorld->getPairCache(); const int numOverlappingPairs = pairCachePtr->getNumOverlappingPairs(); if (numOverlappingPairs) { btBroadphasePair* pairPtr = pairCachePtr->getOverlappingPairArrayPtr(); for (int i=0;i<numOverlappingPairs;i++) { const btBroadphasePair& collisionPair = pairPtr[i]; btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject; btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject; if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && ((colObj1) && ((colObj1)->mergesSimulationIslands()))) { m_unionFind.unite((colObj0)->getIslandTag(), (colObj1)->getIslandTag()); } } } } } #ifdef STATIC_SIMULATION_ISLAND_OPTIMIZATION void btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher) { // put the index into m_controllers into m_tag int index = 0; { int i; for (i=0;i<colWorld->getCollisionObjectArray().size(); i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; //Adding filtering here if (!collisionObject->isStaticOrKinematicObject()) { collisionObject->setIslandTag(index++); } collisionObject->setCompanionId(-1); collisionObject->setHitFraction(btScalar(1.)); } } // do the union find initUnionFind( index ); findUnions(dispatcher,colWorld); } void btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld) { // put the islandId ('find' value) into m_tag { int index = 0; int i; for (i=0;i<colWorld->getCollisionObjectArray().size();i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; if (!collisionObject->isStaticOrKinematicObject()) { collisionObject->setIslandTag( m_unionFind.find(index) ); //Set the correct object offset in Collision Object Array m_unionFind.getElement(index).m_sz = i; collisionObject->setCompanionId(-1); index++; } else { collisionObject->setIslandTag(-1); collisionObject->setCompanionId(-2); } } } } #else //STATIC_SIMULATION_ISLAND_OPTIMIZATION void btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher) { initUnionFind( int (colWorld->getCollisionObjectArray().size())); // put the index into m_controllers into m_tag { int index = 0; int i; for (i=0;i<colWorld->getCollisionObjectArray().size(); i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; collisionObject->setIslandTag(index); collisionObject->setCompanionId(-1); collisionObject->setHitFraction(btScalar(1.)); index++; } } // do the union find findUnions(dispatcher,colWorld); } void btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld) { // put the islandId ('find' value) into m_tag { int index = 0; int i; for (i=0;i<colWorld->getCollisionObjectArray().size();i++) { btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i]; if (!collisionObject->isStaticOrKinematicObject()) { collisionObject->setIslandTag( m_unionFind.find(index) ); collisionObject->setCompanionId(-1); } else { collisionObject->setIslandTag(-1); collisionObject->setCompanionId(-2); } index++; } } } #endif //STATIC_SIMULATION_ISLAND_OPTIMIZATION inline int getIslandId(const btPersistentManifold* lhs) { int islandId; const btCollisionObject* rcolObj0 = static_cast<const btCollisionObject*>(lhs->getBody0()); const btCollisionObject* rcolObj1 = static_cast<const btCollisionObject*>(lhs->getBody1()); islandId= rcolObj0->getIslandTag()>=0?rcolObj0->getIslandTag():rcolObj1->getIslandTag(); return islandId; } /// function object that routes calls to operator< class btPersistentManifoldSortPredicate { public: SIMD_FORCE_INLINE bool operator() ( const btPersistentManifold* lhs, const btPersistentManifold* rhs ) const { return getIslandId(lhs) < getIslandId(rhs); } }; void btSimulationIslandManager::buildIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld) { BT_PROFILE("islandUnionFindAndQuickSort"); btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray(); m_islandmanifold.resize(0); //we are going to sort the unionfind array, and store the element id in the size //afterwards, we clean unionfind, to make sure no-one uses it anymore getUnionFind().sortIslands(); int numElem = getUnionFind().getNumElements(); int endIslandIndex=1; int startIslandIndex; //update the sleeping state for bodies, if all are sleeping for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex) { int islandId = getUnionFind().getElement(startIslandIndex).m_id; for (endIslandIndex = startIslandIndex+1;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++) { } //int numSleeping = 0; bool allSleeping = true; int idx; for (idx=startIslandIndex;idx<endIslandIndex;idx++) { int i = getUnionFind().getElement(idx).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) { // printf("error in island management\n"); } btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { if (colObj0->getActivationState()== ACTIVE_TAG) { allSleeping = false; } if (colObj0->getActivationState()== DISABLE_DEACTIVATION) { allSleeping = false; } } } if (allSleeping) { int idx; for (idx=startIslandIndex;idx<endIslandIndex;idx++) { int i = getUnionFind().getElement(idx).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) { // printf("error in island management\n"); } btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { colObj0->setActivationState( ISLAND_SLEEPING ); } } } else { int idx; for (idx=startIslandIndex;idx<endIslandIndex;idx++) { int i = getUnionFind().getElement(idx).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1)) { // printf("error in island management\n"); } btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1)); if (colObj0->getIslandTag() == islandId) { if ( colObj0->getActivationState() == ISLAND_SLEEPING) { colObj0->setActivationState( WANTS_DEACTIVATION); colObj0->setDeactivationTime(0.f); } } } } } int i; int maxNumManifolds = dispatcher->getNumManifolds(); //#define SPLIT_ISLANDS 1 //#ifdef SPLIT_ISLANDS //#endif //SPLIT_ISLANDS for (i=0;i<maxNumManifolds ;i++) { btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i); const btCollisionObject* colObj0 = static_cast<const btCollisionObject*>(manifold->getBody0()); const btCollisionObject* colObj1 = static_cast<const btCollisionObject*>(manifold->getBody1()); ///@todo: check sleeping conditions! if (((colObj0) && colObj0->getActivationState() != ISLAND_SLEEPING) || ((colObj1) && colObj1->getActivationState() != ISLAND_SLEEPING)) { //kinematic objects don't merge islands, but wake up all connected objects if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING) { if (colObj0->hasContactResponse()) colObj1->activate(); } if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING) { if (colObj1->hasContactResponse()) colObj0->activate(); } if(m_splitIslands) { //filtering for response if (dispatcher->needsResponse(colObj0,colObj1)) m_islandmanifold.push_back(manifold); } } } } ///@todo: this is random access, it can be walked 'cache friendly'! void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld, IslandCallback* callback) { btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray(); buildIslands(dispatcher,collisionWorld); int endIslandIndex=1; int startIslandIndex; int numElem = getUnionFind().getNumElements(); BT_PROFILE("processIslands"); if(!m_splitIslands) { btPersistentManifold** manifold = dispatcher->getInternalManifoldPointer(); int maxNumManifolds = dispatcher->getNumManifolds(); callback->processIsland(&collisionObjects[0],collisionObjects.size(),manifold,maxNumManifolds, -1); } else { // Sort manifolds, based on islands // Sort the vector using predicate and std::sort //std::sort(islandmanifold.begin(), islandmanifold.end(), btPersistentManifoldSortPredicate); int numManifolds = int (m_islandmanifold.size()); //tried a radix sort, but quicksort/heapsort seems still faster //@todo rewrite island management m_islandmanifold.quickSort(btPersistentManifoldSortPredicate()); //m_islandmanifold.heapSort(btPersistentManifoldSortPredicate()); //now process all active islands (sets of manifolds for now) int startManifoldIndex = 0; int endManifoldIndex = 1; //int islandId; // printf("Start Islands\n"); //traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex) { int islandId = getUnionFind().getElement(startIslandIndex).m_id; bool islandSleeping = true; for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++) { int i = getUnionFind().getElement(endIslandIndex).m_sz; btCollisionObject* colObj0 = collisionObjects[i]; m_islandBodies.push_back(colObj0); if (colObj0->isActive()) islandSleeping = false; } //find the accompanying contact manifold for this islandId int numIslandManifolds = 0; btPersistentManifold** startManifold = 0; if (startManifoldIndex<numManifolds) { int curIslandId = getIslandId(m_islandmanifold[startManifoldIndex]); if (curIslandId == islandId) { startManifold = &m_islandmanifold[startManifoldIndex]; for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(m_islandmanifold[endManifoldIndex]));endManifoldIndex++) { } /// Process the actual simulation, only if not sleeping/deactivated numIslandManifolds = endManifoldIndex-startManifoldIndex; } } if (!islandSleeping) { callback->processIsland(&m_islandBodies[0],m_islandBodies.size(),startManifold,numIslandManifolds, islandId); // printf("Island callback of size:%d bodies, %d manifolds\n",islandBodies.size(),numIslandManifolds); } if (numIslandManifolds) { startManifoldIndex = endManifoldIndex; } m_islandBodies.resize(0); } } // else if(!splitIslands) }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./CHANGES
[1.12.1] - LWJGL3 Improvement: Audio device is automatically switched if it was changed in the operating system. - Tiled Fix: TiledLayer parallax default values fix - Android: Removed mouse catching added on 1.12.0 due to unintended effects (see #7187). - Update to LWJGL 3.3.3 [1.12.0] - [BREAKING CHANGE] Added #touchCancelled to InputProcessor interface, see #6871. - [BREAKING CHANGE] Android: Immersive mode is now true by default. Set `useImmersiveMode` config to `false` to disable it. - [BREAKING CHANGE] iOS: Increased min supported iOS version to 11.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] iOS: `hideHomeIndicator` set to `false` by default (was `true`). - [BREAKING CHANGE] iOS: `screenEdgesDeferringSystemGestures` set to `UIRectEdge.All` by default (was `UIRectEdge.None`). - [BREAKING CHANGE] iOS: preferred FPS is now uncapped by default, see #6717 - [BREAKING CHANGE] iOS: `ApplicationListener.create` and first `resize` are now called within `UIApplicationDelegate.didFinishLaunching`. Allows for earlier rendering and prevents black screen frames after launch screen. NOTE: App will get terminated if this method is blocked for more than 10-20 sec. - [BREAKING CHANGE] Actor#localToAscendantCoordinates throws an exception if the specified actor is not an ascendant. - [BREAKING CHANGE] WidgetGroup#hit first validates the layout. - [BREAKING CHANGE] Cell getters return object wrapper instead of primitives. - [BREAKING CHANGE] MeshPartBuilder#lastIndex now returns int instead of short. - [BREAKING CHANGE] 3D API - max bone weights is now configurable and limited to 4 by default. Change this value if you need less or more. See #6522. - [BREAKING CHANGE] Mesh#getVerticesBuffer, Mesh#getIndicesBuffer, VertexData#getBuffer, and IndexData#getBuffer are deprecated in favor to new methods with boolean parameter. If you subclassed some of these classes, you need to implement the new methods. - [BREAKING CHANGE] Desktop: The return value of AudioDevice#getLatency() is now in samples, and not milliseconds - [BREAKING CHANGE] iOS: 32 bit (armv7) builds are no longer supported. Builds must be 64 bit (arm64) only. - [BREAKING CHANGE] iOS: Use dynamic frameworks instead of static libs - [BREAKING CHANGE] optimized Mesh#bind and Mesh#unbind have a new parameter for instanced attribute locations. If you use these methods without instancing, you can pass a null value. - [BREAKING CHANGE] Dropped support for older libc versions since libGDX is now built on Ubuntu 20.04 (#7005) - [KNOWN ISSUE] Android drag behaviour. Gdx.input.getDeltaX() and Gdx.input.getDeltaY always return 0 for pointer 0. Fixed on next version. - Update to jnigen 2.4.1 - LWJGL Fix: setPosision() for MP3 files. - iOS: Add new MobiVM MetalANGLE backend - iOS: Update to MobiVM 2.3.19 - Update to LWJGL 3.3.2 - API Addition: Added Audio#switchOutputDevice and Audio#getAvailableOutputDevices to specify output devices. Only works for LWJGL3 - Fix LWJGL3: Audio doesn't die anymore, if a device gets disconnected - API Addition: Added Haptics API with 4 different Input#vibrate() methods with complete Android and iOS implementations. - Fix: Fixed Android and iOS touch cancelled related issues, see #6871. - Javadoc: Add "-use" flag to javadoc generation - Android: gdx-setup now uses AGP 7.2.2 and SDK 32, requiring Android Studio Chipmunk or IntelliJ IDEA 2022.2 and JDK 11. - libGDX is now built using Java 11 due to new Android requirements. The rest of libGDX can still be built with JDK 8 and runtime compatibility of libGDX projects should be unaffected. - Fixed glViewport when using HdpiMode.Logical with the LWJGL3 backend. - Added Stage#actorRemoved to fire exit events just before an actor is removed. - ScrollPane#setScrollingDisabled avoids invalidate() if nothing changed. - Fixed incorrect ScrollPane#scrollTo. - API Addition: Added Texture3D support - Fix: Throw an exception when maximum Attribute count is reached to prevent silent failure. - API Fix: The cursor can now be catched on Android. - LWJGL3 Fix: Stereo audio can now be played on mono output devices. This may also improve downmixing to stereo and upmixing to surround. - API Addition: Added CheckBox#getImageDrawable. - FIX: HexagonalTiledMapRenderer now displays maps with the correct stagger index. - API Addition: Added I18NBundle#keys() method. - TOOLS Features: Save mode can be changed in Flame particle 3D editor. - API Addition: added WebGL 2.0 implementation to Gwt backend : you can enable it by GwtApplicationConfiguration#useGL30 - Added GLES31 and GLES32 support with Lwjgl3 backend implementation - API Addition: JsonReader#stop() to stop parsing. - API Change: TextureAtlas now uses FileHandle#reader so outside code can control the charset - API Fix: Intersector#isPointInTriangle - API Addition: The Skin serializer now supports useIntegerPositions - API Change: The skin serializer now treats scaledSize as a float - API Change: DataInput throws an EOF-Exception - API Fix: RenderBuffer leak in GLFrameBuffer class - API Change: Pixmap#setPixels will now verify it has been given a direct ByteBuffer - API Addition: glTexImage2D and glTexSubImage2D with offset parameter - API Addition: OrientedBoundingBox - API Addition: Tiled parallax factor support - API Fix: LWJGL 3’s borderless fullscreen works with negative monitor coords - API Fix: Update mouse x and y values immediately after calling #setCursorPosition - API Change: Never stall with AssetManager on GWT - API Change: Allow packed depth stencil buffer creation when not using GL30 - API Fix: Fixed DataInput#readString for non-ASCII - API Fix: LwjglGraphics.setupDisplay() is no longer choosing the wrong display mode - API Fix: MathUtils.lerpAngle() fixed for extreme inputs - MathUtils trigonometry improvements - Various Scene2D fixes and improvements [1.11.0] - [BREAKING CHANGE] iOS: Increased min supported iOS version to 9.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] Removed Maven and Ant build systems. libGDX is now solely built with Gradle. See https://libgdx.com/dev/from-source/ for updated build instructions. - [BREAKING CHANGE] Android Moved natives loading out of static init block, see #5795 - [BREAKING CHANGE] Linux: Shared libraries are now built on Ubuntu 18.04 (up from Ubuntu 16.04) - [BREAKING CHANGE] The built-in font files arial-15.fnt and arial-15.png have been replaced with lsans-15.fnt and lsans-15.png; this may change some text layout that uses the built-in font, and code that expects arial-15 assets to be present must change to lsans-15. - [BREAKING CHANGE] Legacy LWJGL3 projects must update the sourceCompatibility to 1.8 or higher. - [BREAKING CHANGE] Android Removed hideStatusBar configuration, see #6683 - [BREAKING CHANGE] Lwjgl3ApplicationConfiguration#useOpenGL3 was replaced by #setOpenGLEmulation - Gradle build now takes -PjavaVersion=7|8|9... to specify the Java version against which to compile libGDX. Default is Java 7 for everything, except the LWJGL3 backend, which is compiled for Java 8. - LWJGL3 extension: Added gdx-lwjgl3-glfw-awt-macos extension. Fixes GLFW in such a way, that the LWJGL3/libGDX must no longer run on the main thread in macOS, which allows AWT to work in parallel, i.e. file dialogs, JFrames, ImageIO, etc. You no longer need to pass `-XstartOnFirstThread` when starting an LWJGL3 app on macOS. See `AwtTestLWJGL` in gdx-tests-lwjgl3. For more information, see https://github.com/libgdx/libgdx/pull/6772 - API Addition: Added LWJGL3 ANGLE support for x86_64 Windows, Linux, and macOS. Emulates OpenGL ES 2.0 through DirectX (Windows), desktop OpenGL (Linux), and Metal (macOS). May become the preferred method of rendering on macOS if Apple removes OpenGL support entirely. May fix some OpenGL driver issues. More information here: https://github.com/libgdx/libgdx/pull/6672 - iOS: Update to MobiVM 2.3.16 - Update to LWJGL 3.3.1 - API Addition: ObjLoader now supports ambientColor, ambientTexture, transparencyTexture, specularTexture and shininessTexture - API Addition: PointSpriteParticleBatch blending is now configurable. - TOOLS Features: Blending mode and sort mode can be changed in Flame particle 3D editor. - API Addition: Polygon methods setVertex, getVertex, getVertexCount, getCentroid. - API Addition: TMX built-in tile property "type" is now supported. - API Addition: Octree structure. - API Addition: Added StringBuilder#toStringAndClear() method. - FirstPersonCameraController keys mapping is now configurable - Fix: GlyphLayout: Several fixes for color markup runs with multi-line or wrapping texts - API change: GlyphLayout#GlyphRun is now one GlyphRun per line. "color" was removed from GlyphRun and is now handled by GlyphLayout. - Gdx Setup Tool: Target Android API 30 and update AGP plugin to 4.1.3 - API Fix: Sound IDs are now properly removed; this prevents changes to music instances with the same ID - API Fix: LWJGL3Net#openURI does now work on macOS & JDK >= 16 - API Fix: Fixed a possible deadlock with AssetManager#dispose() and #clear() - API Change: Enable the AL_DIRECT_CHANNELS_SOFT option for Sounds and AudioDevices as well to fix stereo sound - API Addition: CameraInputController#setInvertedControls(boolean) - API Removal: AnimatedTiledMapTile#frameCount - LWJGL 3 is now the default desktop backend. If you want to port your existing applications, take a look here: https://gist.github.com/crykn/eb37cb4f7a03d006b3a0ecad27292a2d - Brought the official and third-party extensions in gdx-setup up to date. Removed some unmaintained ones and added gdx-websockets & jbump. - API Fix: Escaped characters in XML attributes are now properly un-escaped - Bug Fix: AssetManager backslash conversion removed - fixes use of filenames containing backslashes - gdx-setup now places the assets directory in project root instead of android or core. See advanced settings (UI) or arguments (command line) if you don't want it in root. - API Fix: Resolved issues with LWJGL 3 and borderless fullscreen - API Addition: GeometryUtils,polygons isCCW, ensureClockwise, reverseVertices - API Addition: Added FreeTypeFontGenerator#hasCharGlyph method. - API Fix: Pool discard method now resets object by default. This fixes the known issue about Pool in libGDX 1.10.0. - API Addition: Split GWT reflection cache into two generated classes - API Fix: Fix Box2D memory leak with ropes on GWT - API Fix: Fix NPE in Type#getDeclaredAnnotation - API Addition: Add pause/resume methods to AudioDevice - API Fix: Protection against NullPointerException in World#destroyBody() - API Fix: Prevent repeated mipmap generation in FileTextureArrayData - API Fix: Fix issue with camera reference in CameraGroupStrategy’s default sorter - API Fix: Move vertex array index buffer limit to backends to fix issue with numIndices parameter - API Fix: TexturePacker: Fix wrong Y value when using padding - API Fix: Lwjgl3Net: Add fallback to xdg-open on Linux if Desktop.BROWSE is unavailable - API Addition: Add NWSEResize, NESWResize, AllResize, NotAllowed and None SystemCursors - API Addition: GWTApplication#getJavaHeap and getNativeHeap are now supported - API Addition: Box2D Shape now implements Disposable - API Addition: Added ChainShape#clear method - API Addition: Added Tooltip#setTouchIndependent; see #6758 - API Addition: Emulate Timer#isEmpty on GWT - API Addition: Bits add copy constructor public Bits (Bits bitsToCpy) - API Addition: Added List#drawSelection(). - API Addition: GwtApplicationConfiguration#xrCompatible - API Fix: setSystemCursor() now works on Android - API Fix: getDisplayMode() is now more accurate on Android and GWT. - API Addition: JsonValue#iterator(String) to more easily iterate a child that may not exist. - API Addition: Added ExtendViewport#setScaling, eg for use with Scaling.contain. - API Addition: Added application lifecycle methods to IOSAudio for custom audio implementations. - API Addition: Added getBoundingRectangle() to Polyline - API Addition: ShapeRenderer#check() has now protected visibility - API Addition: Add ability to host GWT module on a different domain than the site, see #6851 - API Addition: Addes Tooltip#setTouchIndependent; see #6758 - API ADDITION: Emulate Timer#isEmpty on GWT - API Addition: OrientedBoundingBox. [1.10.0] - [BREAKING CHANGE] Android armeabi support has been removed. To migrate your projects: remove any dependency with natives-armeabi qualifier from your gradle build file, this apply to gdx-platform, gdx-bullet-platform, gdx-freetype-platform and gdx-box2d-platform. - [BREAKING CHANGE] tvOS libraries have been removed. No migration steps required. - [BREAKING CHANGE] Linux x86 (32-bit) support has been removed. No migration steps required. - [BREAKING CHANGE] Requires Java 7 or above. - [BREAKING CHANGE] API Change: Scaling is now an object instead of an enum. This may change behavior when used with serialization. - [BREAKING CHANGE] Group#clear() and #clearChildren() now unfocus the children. Added clear(boolean) and clearChildren(boolean) for when this isn't wanted. Code that overrides clear()/clearChildren() probably should change to override the (boolean) method. #6423 - [BREAKING CHANGE] Lwjgl3WindowConfiguration#autoIconify is enabled by default. - [KNOWN ISSUE] Pool no longer reset freed objects when pool size is above its retention limit. Pool will discard objects instead. If you want to keep the old behavior, you should override Pool#discard method to reset discarded objects. - Scene2d.ui: Added new ParticleEffectActor to use particle effects on Stage - API addition: iOS: Added HdpiMode option to IOSApplicationConfiguration to allow users to set whether they want to work in logical or raw pixels (default logical). - Fix for #6377 Gdx.net.openURI not working with targetSdk 30 - Api Addition: Added a Pool#discard(T) method. - Architecture support: Linux ARM and AARCH64 support has been added. The gdx-xxx-natives.jar files now contain native libraries of these architectures as well. - API Addition: Desktop Sound now returns number of channels and sample rate. [1.9.14] - [BREAKING CHANGE] iOS: IOSUIViewController has been moved to its own separate class - [BREAKING CHANGE] API Change: G3D AnimationDesc#update now returns -1 (instead of 0) if animation not finished. - [BREAKING CHANGE] InputEventQueue no longer implements InputProcessor, pass InputProcessor to #drain. - [BREAKING CHANGE] HeadlessApplicationConfiguration#renderInterval was changed to #updatesPerSecond - API addition: Added Pixmap#setPixels(ByteBuffer). - API change: ScreenUtils#getFrameBufferPixmap is deprecated in favor to new method Pixmap#createFromFrameBuffer. - API Addition: Added overridable createFiles() methods to backend application classes to allow initializing custom module implementations. - API Addition: Add a Graphics#setForegroundFPS() method. [1.9.13] - [BREAKING CHANGE] Fixed keycode representations for ESCAPE, END, INSERT and F1 to F12. These keys are working on Android now, but if you hardcoded or saved the values you might need to migrate. - [BREAKING CHANGE] TextureAtlas.AtlasRegion and Region splits and pads fields have been removed and moved to name/value pairs, use #findValue("split") and #findValue("pad") instead. - iOS: Update to MobiVM 2.3.12 - GWT: Key codes set with Gdx.input.setCatchKey prevent default browser behaviour - Added Scaling.contain mode: Scales the source to fit the target while keeping the same aspect ratio, but the source is not scaled at all if smaller in both directions. - API Addition: Added hasContents() to Clipboard interface, to reduce clipboard notifications on iOS 14 - TOOLS Features: Blending mode can be changed in Flame particle 3D editor. - Input Keycodes added: CAPS_LOCK, PAUSE (aka Break), PRINT_SCREEN, SCROLL_LOCK, F13 to F24, NUMPAD_DIVIDE, NUMPAD_MULTIPLY, NUMPAD_SUBTRACT, NUMPAD_ADD, NUMPAD_DOT, NUMPAD_COMMA, NUMPAD_ENTER, NUMPAD_EQUALS, NUMPAD_LEFT_PAREN, NUMPAD_RIGHT_PAREN, NUM_LOCK. Following changes might be done depending on platform: Keys.STAR to Keys.NUMPAD_MULTIPLY, Keys.SLASH to Keys.NUMPAD_DIVIDE, Keys.NUM to Keys.NUM_LOCK, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.PERIOD to Keys.NUMPAD_DOT, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.ENTER to Keys.NUMPAD_ENTER, Keys.PLUS to Keys.NUMPAD_ADD, Keys.MINUS to Keys.NUMPAD_SUBTRACT - Added a QuadFloatTree class. - Desktop: Cubemap Seamless feature is now enabled by default when supported, can be changed via backend specific methods, see supportsCubeMapSeamless and enableCubeMapSeamless in both LwjglGraphics and Lwjgl3Graphics. - API Addition: TextureAtlas reads arbitrary name/value pairs for each region. See #6316. - TexturePacker writes using a new format when legacyOutput is false (default is true). TextureAtlas can read both old and new formats. See #6316. [1.9.12] - [BREAKING CHANGE] iOS: Changed how Retina/hdpi handled on iOS. See #3709. - [BREAKING CHANGE] API Change: InputProcessor scrolled method now receives scroll amount for X and Y. Changed type to float to support devices which report fractional scroll amounts. Updated InputEvent in scene2d accordingly: added scrollAmountX, scrollAmountY attributes and corresponding setters and getters. See #6154. - [BREAKING CHANGE] API Change: Vector2 angleRad(Vector2) now correctly returns counter-clockwise angles. See #5428 - [BREAKING CHANGE] Android: getDeltaTime() now returns the raw delta time instead of a smoothed one. See #6228. - Fixed vertices returned by Decal.getVertices() not being updated - Fixes Issue #5048. The function Intersector.overlapConvexPolygons now should return the right minimum translation vector values. - Update to MobiVM 2.3.11 - API Change: Removed Pool constructor with preFill parameter in favor of using Pool#fill() method. See #6117 - API Addition: Slider can now be configured to only trigger on certain mouse button clicks (Slider#setButton(int)). - Fixed GlyphLayout not laying out correctly with color markup. - Fixed TileDrawable not applying its scale correctly. - API Addition: Added epsilon methods to maps with float values. - API Addition: Added an insertRange method to array collections. - Fixed GestureDetector maxFlingDelay. - API Change: Changed default GestureDetector maxFlingDelay to Integer.MAX_VALUE (didn't work before, this matches that). - Gdx.files.external on Android now uses app external storage - see wiki article File handling for more information - Improved text, cursor and selection rendering in TextArea. - API Addition: Added setProgrammaticChangeEvents, updateVisualValue, round methods to ProgressBar/Slider. - iOS: Keyboard events working on RoboVM on iOS 13.5 and up, uses same API as on other platforms - API Addition: Added AndroidLiveWallpaper.notifyColorsChanged() to communicate visually significant colors back to the wallpaper engine. - API Change: AssetManager invokes the loaded callback when an asset is unloaded from the load queue if the asset is already loaded. - GWT: changed audio backend to WebAudio API. Now working on mobiles, pitch implemented. Configuration change: preferFlash removed. When updating existing projects, you can remove the soundmanager js files from your webapp folder and the references to it from index.html - GWT: added possibility to lazy load assets via AssetManager instead of preload them before game start. See GWT specifics wiki article for more information. - GWT: New configuration setting usePhysicalPixels to use native resolution on mobile / Retina / HDPI screens. When using this option, make sure to update your code in index.html and HTMLLauncher from setup template. - GWT: GwtApplicationConfiguration and GWT backend now support an application to be resizable or fixed size. You can remove your own resizing code from your HTMLLaunchers. - GWT: Assets in distribute build are renamed with md5 hash suffix to bypass browser cache on changes - GWT: Fixed GwtFileHandle that was only returning text assets when listing a directory, now returns all children - API Addition: Pixmap.downloadFromUrl() downloads an image from http(s) URLs and passes it back as a Pixmap on all platforms - Added support for Linux ARM builds. - 32-bit: ARMv7/armhf - 64-bit: ARMv8/AArch64 - API Change: Removed arm abi from SharedLibraryLoader - API Addition: Added a Lwjgl3ApplicationConfiguration#foregroundFPS option. - API Change: Utility classes are now final and have a private constructor to prevent instantiation. - API Change: ScrollPane now supports all combinations of scrollBarsOnTop and fadeScrollBars. - API Addition: Added new methods with a "deg" suffix in the method's name for all Vector2 degrees-based methods and deprecated the old ones. - API Addition: Added Slider#setVisualPercent. - API Change: Enabling fullscreen mode on the lwjgl3 backend now automatically sets the vsync setting again. - API Addition: Added put(key, value, defaultValue) for maps with primitive keys, so the old value can be returned. - API Addition: Added ObjectLongMap. - Added Intersector#intersectRayOrientedBoundsFast to detect if a ray intersects an oriented bounding box, see https://github.com/libgdx/libgdx/pull/6139 - API Addition: Added Table#clip() and Container#clip() methods. - API Addition: Added getBackgroundDrawable() to Button. - API Addition: Added imageCheckedDown and getImageDrawable() to ImageButton and ImageTextButton. - API Addition: Added focusedFontColor, checkedFocusedFontColor, and getFontColor() to TextButton and ImageTextButton. - API Addition: Added wrapReverse setting to HorizontalGroup. - API Addition: Added Slider style drawables for over and down: background, knobBefore, and knobAfter. - Fixed LwjglFrame not hiding the canvas in some situations. - API Change: Table#round uses ceil/floor and is applied during layout, rather than afterward. - Fixed blurry NinePatch rendering when using a single center region. - API Change: Upon changing the window size with the lwjgl3 backend, the window is centered on the monitor. - Fixed DepthShaderProvider no longer creates one DepthShader per bones count. Now it creates only one skinned variant and one non-skinned variant based on DepthShader/Config numBones. - API Addition: Added Intersector#intersectPlanes to calculate the point intersected by three planes, see https://github.com/libgdx/libgdx/pull/6217 - API Addition: Added alternative Android Audio implementation for performant sound. See https://github.com/libgdx/libgdx/pull/6243. - API Addition: Expose SpriteBatch and PolygonSpriteBatch setupMatrices() as protected. - API Addition: New parameter OnscreenKeyboardType for Input.setOnscreenKeyboardVisible and Input.getTextInput [1.9.11] - Update to MobiVM 2.3.8 - Update to LWJGL 3.2.3 - Fixed AndroidInput crashes due to missing array resize (pressure array). - API Change: Ray#set methods and Ray#mul(Matrix4) normalize direction vector. Use public field to set and avoid nor() - API Change: New internal implementation of all Map and Set classes (except ArrayMap) to avoid OutOfMemoryErrors when too many keys collide. This also helps resistance against malicious users who can choose problematic names. - API Addition: OrderedMap#alter(Object,Object) and OrderedMap#alterIndex(int,Object) allow swapping out a key in-place without changing its value; OrderedSet also has this. - API Addition: Json can now read/write: ObjectIntMap, ObjectFloatMap, IntMap, LongMap. - API Addition: Added @Null annotation for IDE null analysis. All parameters and return values should be considered non-null unless annotated (or javadoc'ed if not yet annotated). - API Addition: Added ParticleEmitter#preAllocateParticles() and ParticleEffect#preAllocateParticles() to avoid particle allocations during updates. - Fixed changing looping state of already playing sounds on Android by first pausing the sound before setting the looping state (see #5822). - API Change: scene2d: Table#getRow now returns -1 when over the table but not over a row (used to return the last row). - API Change: scene2d: Tree#addToTree and #removeFromTree now have an "int actorIndex" parameter. - API Addition: scene2d: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: scene2d: In TextField, only revert the text if the change event was cancelled. This allows the text to be manipulated in the change listener. - API Change: scene2d: Tree.Node#removeAll renamed to clearChildren. - API Addition: scene2d: Added SelectBox#setSelectedPrefWidth to make the pref width based on the selected item and SelectBoxStyle#overFontColor. - API Change: DefaultTextureBinder WEIGHTED strategy replaced by LRU strategy. - API Change: ShaderProgram begin and end methods are deprecated in favor to bind method. - API Addition: Added a OpenALAudio#getSourceId(long) method. - API Addition: Added a ShaderProgram#getHandle() method. - API Change: Replaced deprecated android support libraries with androidx. AndroidFragmentApplication is only affected. - API Addition: Created interfaces AndroidAudio and AndroidInput and added AndroidApplication#createAudio and AndroidApplication#createInput to allow initializing custom module implementations. - Allows up to 64k (65536) vertices in a Mesh instead of 32k before. Indices can use unsigned short range, so index above 32767 should be converted to int using bitwise mask, eg. int unsigneShortIndex = (shortIndex & 0xFFFF). - API Change: DragAndDrop only removes actors that were not already in the stage. This is to better support using a source actor as the drag actor, see #5675 and #5403. - API Change: Changed TiledMapTileLayer#tileWidth & #tileHeight from float to int - API Addition: convenient Matrix4 rotate methods: rotateTowardDirection and rotateTowardTarget - API Addition: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: Correction of TextField#ENTER_ANDROID renamed to NEWLINE and TextField#ENTER_DESKTOP renamed to CARRIAGE_RETURN. - API Change: Changed the visibility of TextField#BULLET, TextField#DELETE, TextField#TAB and TextField#BACKSPACE to protected. - API Addition: TextField and TextArea are providing the protected method TextField#checkFocusTraverse(char) to handle the focus traversal. - API Addition: UIUtils provides the constants UIUtils#isAndroid and UIUtils#isIos now. - Fixed: The behaving of TextFields and TextAreas new line and focus traversal works like intended on all platforms now. - API Change: Changed Base64Coder#encodeString() to use UTF-8 instead of the platform default encoding. See #6061 - Fixed: SphereShapeBuilder poles are now merged which removes lighting artifacts, see #6068 for more information. - API Change: Matrix3#setToRotation(Vector3, float float) now rotates counter-clockwise about the axis provided. This also changes Matrix3:setToRotation(Vector3, float) and the 3d particles will rotate counter-clockwise as well. - API Change: TexturePacker uses a dash when naming atlas page image files if the name ends with a digit or a digit + 'x'. - API Addition: Added Skin#setScale to control the size of drawables from the skin. This enables scaling a UI and using different sized images to match, without affecting layout. - API Change: Moved adding touch focus from Actor#notify to InputListener#handle (see #6082). Code that overrides InputListener#handle or otherwise handles InputEvent.Type.touchDown events must now call Stage#addTouchFocus to get touchDragged and touchUp events. - API Addition: Added AsynchronousAssetLoader#unloadAsync to fix memory leaks when an asset is unloaded during loading. - Fixed Label text wrapping when it shouldn't (#6098). - Fixed ShapeRenderer not being able to render alpha 0xff (was max 0xfe). - API Change: glGetActiveUniform and glGetActiveAttrib parameter changed from Buffer to IntBuffer. [1.9.10] - API Addition: Allow target display for maximization LWJGL3 backend - API Addition: Accelerometer support on GWT - API Change: Set default behaviour of iOS audio to allow use of iPod - API Change: IOSDevice is no longer an enum to allow users to add their own new devices when LibGDX is not up to date - API Addition: Add statusBarVisible configuration to IOSApplicationConfiguration - Update GWT Backend to GWT 2.8.2 - Update Android backend to build against API 28 (Android 9.0) - API Addition: Input.isButtonJustPressed - Update to LWJGL 2 backend to 2.9.3 - Update to MobiVM 2.3.6 release - Update to LWJGL 3.2.1 - API Addition: Input allows getting the maximum number of pointers supported by the backend - API Addition: Configuration option added to allow setting a max number of threads to use for net requests - API Change: NetJavaImpl now uses a cached thread pool to allow concurrent requests (by default, the thread pool is unbounded - use maxNetThreads in backend configurations to set a limit - set to 1 for previous behavior) - API Addition: New MathUtils norm and map methods - API Change: Pixmap blending was incorrect. Generated fonts may change for the better, but may require adjusting font settings. - API Change: Particle effects obtained from a ParticleEffectPool are now automatically started - Removed OSX 32-bit support - API Change: By default LWJGL2 backend no longer does pause/resume when becoming background/foreground window. New app config setting was added to enable the old behavior. - API Change: By default LWJGL2 backend now does pause/resume when window is minimized/restored. New app config setting was added to disable this behavior. - LWJGL3: Fixed window creation ignoring refresh rate of fullscreen mode. - TmxMapLoader and AtlasTmxMapLoader refactoring: Shared functionality was moved to BaseTmxMapLoader, duplicate code was removed. - AtlasTmxMapLoader supports group layers now (a positive side effect of the BaseTmxMapLoader refactoring). - API Change: TmxMapLoader and AtlasTmxMapLoader: load/loadAsync methods work exactly as before, but many methods of these classes had to change. This makes it possible implement new Tiled features. - API Addition: TextField#drawMessageText. - Fixed TextField rendering text outside the widget at small sizes. - API Addition: Group#getChild(int) - API Addition: notEmpty() for collections. - API Change: scene2d.ui Tree methods renamed for node set/getObject to set/getValue. - API Change: scene2d.ui Tree and Tree.Node require generics for the type of node, values, and actors. - API Change: For Selection in scene2d.utils "toggle" is now respected when !required and selected.size == 1. - API Addition: new InstanceBufferObject and InstanceBufferObjectSubData classes to enable instanced rendering. - API Addition: Support for InstancedRendering via Mesh - API Change: Cell#setLayout renamed to setTable. - API Addition: Added Collections#allocateIterators. When true, iterators are allocated. When false (default), iterators cannot be used nested. - API Addition: Added Group#removeActorAt(int,boolean) to avoid looking up the actor index. Subclasses intending to take action when an actor is removed may need to override this new method. - API Change: If Group#addActorAfter is called with an afterActor not in the group, the actor is added as the last child (not the first). [1.9.9] - API Addition: Add support for stripping whitespace in PixmapPacker - API Addition: Add support for 9 patch packing in PixmapPacker - API Addition: Pressure support for ios/android. https://github.com/libgdx/libgdx/pull/5270 - Update to Lwjgl 3.2.0 - Update android level we build against to 7.1 (API 25) - API Change: gdx-tools no longer bundles dependencies to be compatible with java 9 - Skin JSON files can now use the simple names of classes, i.e. "BitmapFont" rather than "com.badlogic.gdx.graphics.g2d.BitmapFont". Custom classes can be added by overriding Skin.getJsonLoader() and calling json.setClassTag(). - Skin supports cascading styles in JSON. Use the "parent" property to tag another style by name to use its values as defaults. See https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests-android/assets/data/uiskin.json for example. - SkinLoader can be used on subclasses of Skin by overriding generateSkin(). - API addition: Tree indentation can be customized. - Fixed GlyphLayout not respecting BitmapFontData#down. - API Addition: Added faceIndex paramter to #FreeTypeFontGenerator(FileHandle, int). - API Change: BitmapFont#getSpaceWidth changed to BitmapFont#getSpaceXadvance. - Many GlyphLayout fixes. - API Addition: Added FileHandle#map(), can be used to memory map a file - API Change: BitmapFontData#getGlyphs changed for better glyph layout. See https://github.com/libgdx/libgdx/commit/9a7dfdff3c6374a5ebd2f33a819982aceb287dfa - API Change: Actor#hit is now responsible for returning null if invisible. #5264 - API Addition: Added [Collection]#isEmpty() method to all 22 custom LibGDX-collections (e.g. Array, ObjectMap, ObjectSet, Queue, ...) - API Addition: StringBuilder#clear() - API Addition: Color#WHITE_FLOAT_BITS - Table layout fixed when expand is used and the layout width is less than the table's min width. - InputMultiplexer#setProcessors(Array) now copies the items instead of using the specified array instance. - API Change: A wrapped HorizontalGroup or VerticalGroup will now size children down to their min size if the group is smaller than their pref size. - LWJGL3: useVSync() is now a per-window setting. Any additional windows should disable vsync to avoid frames dropping to (refresh rate / # of windows). - Batch and sprite implementations and SpriteCache store Color separately from the float packed color, since converting to/from float is lossy. - API Change: NumberUtils floatToIntColor expands the alpha from 0-254 to 0-255, so 255 doesn't become 254 from conversion from int to float to int. - API Change: Batch and Decal setColor(float) renamed to setPackedColor for differentiation, since the conversion from float to Color is lossy. - API Change: PolygonSprite getVertexColor renamed to getPackedColor to match other classes. - API Change: FreeTypeFontGenerator only generates a missing glyph if \0 is in the characters. - API Change: DragScrollListener no longer requires the touch/mouse cursor to be directly above/below the scroll pane. - API Change: List#toString(Object) changed from protected to public. Subclasses overriding this need to change to public. - API Change: List now handles more key presses. - API Change: TexturePacker ImageProcessor#addImage(File, String) now returns the Rect. [1.9.8] - Add iPhoneX images - Fix MacOS issue with GL_ARB_texture_float extension check - Fix AtlasTmxMapLoader tileset tile id offset - Bullet: updated to 2.87, see: http://bulletphysics.org/wordpress/?p=485 - API Addition: Possibility to specify TexturePacker settings for resampling when scaling. - API Addition: Support for customizing render buffer attachments in GLFrameBuffers - API Change: Revert to constructors for GLFrameBuffers for easier customization [1.9.7] - Update to MobiVM(RoboVM) 2.3.3 - Add iOS 11 support - Update to Lwjgl 3.1.3 - Update to MOE 1.4.0 - API Change: GLFrameBuffer has been refactored https://github.com/libgdx/libgdx/pull/4882. Create standard FrameBuffers with static methods. Customized FBOS with FrameBufferBuilder - API addition: Tiled group layer support - Fix Tiled properties, offset parsing for image layers - API addition: Added utility methods for Vector equals with epsilon - Fix Animation backing array type - Fix Mesh copying with 0 indices - Fix restoration of pooled particle effects scale - Fix loss of controller listeners on reconnect - Added basic kotlin project generation support in the setup tool - API addition: Allow APK expansion to be used in fragments and activities - API addition: Added color properties support from tiled maps - API Change: Added rotation vector sensor support on Android - API Change: GLProfiler refactored for OOP and lwjgl3 multi windows - LWJGL3: The creation of additional windows via Lwjgl3Application.newWindow() is now deferred, with postRunnable(), until all existing windows have been updated. This fixes a potential native crash with NVidia GL drivers on Windows, presumably caused by a GL context conflict. - API addition: Lwjgl3WindowListener.created() is called after a new window has been created. It's unsafe to call Lwjgl3Window functions in between Lwjgl3Application.newWindow() and this callback. - Updated LWJGL3 backend to 3.1.3. - Lwjgl3Graphics.setUndecorated() and Lwjgl3Graphics.setResizable() now delegate their work to the respective GLFW functions. - API addition: ProgressBar.isVertical() - returns whether a progress bar is vertical or horizontal. - API Change: SplitPane now by default does not allow the split amount to shrink children below their minimum sizes (cropping them). This behavior can be reverted by overriding clampSplitAmount or wrapping the children in Containers set to minSize(0) and fill(). SplitPane also now correctly includes the handle min size in its own min size calculations. - API Change: SplitPane.getSplit() renamed to SplitPane.getSplitAmount() to match other getter and setter names. - Improved internal Timer synchronization. - API Change: List#drawItem, added float width parameter. - API Addition: Make it possible to disable sound on the GWT-Backend with disableSound=true. - API Change: ScrollPane setWidget deprecated in favor of setActor to match other APIs. - API Change: removed JGLFW backend - Fixed mixed up use of TexturePacker.Settings.stripWhitespaceX|Y. - Added joystick POV support to LWJGL3 controller backend. - Added support for 2d particles sprite animation. - API Change: ParticleEmitter getSprite, setSprite, getImagePath, setImagePath are now getSprites, setSprites, getImagePaths, setImagePaths. - Added support for 2d particles independant scale X and Y. - API Change: ParticleEmitter getScale, matchSize are now getScaleX/getScaleY, matchSizeX/matchSizeY. Added scaleSize(float scaleX, float scaleY) - API Change: Added iconDropped() callback to AndroidWallpaperListener. [1.9.6] - Fix performance regression in LWJGL3 backend, use java.nio instead of BufferUtils. Those are intrinsics and quite a bit faster than BufferUtils on HotSpot. - Updated to latest Sound Manager 2 - Added mappings for Xbox 360 controller for Linux - Separated error log for vertex/fragment shaders for easier debugging - Minimum Android API level is now level 9 (Android 2.3) - API addition: Configurable TexturePacker bleed iterations - Updated IOS Multi-OS Engine backend to 1.3.6 - API Change: Pixmap.setBlending, Pixmap.setFilter are now instance methods - VertexAttribute expert constructors exposed. Short types can now be used for attributes. [1.9.5] - Fix NPE swallowing "video driver unsupported" error on LWJGL 2 backend. - Allow window icons to be set in Lwjgl3ApplicationConfiguration or Lwjgl3WindowConfiguration. - Allow window icon and title to be changed in Lwjgl3Window - API Addition: ApplicationLogger interface, allowing easier access to custom logging - DefaultRenderableSorter accounts for center of Renderable mesh, see https://github.com/libgdx/libgdx/pull/4319 - Bullet: added FilterableVehicleRaycaster, see https://github.com/libgdx/libgdx/pull/4361 - Bullet: updated to 2.85, see: http://bulletphysics.org/wordpress/?p=456 - Updated iOS native build scripts to iOS 10.1 and TVOS 10.0 - API Addition: BitmapFont#blankLineScale. - Fixed rounding of Drawables in ProgressBar. Allow rounding to be disabled with setRound(). - Updated LWJGL3 backend to LWJGL 3.1.0, see https://blog.lwjgl.org/lwjgl-3-1-0-released/ - LWJGL3 backend now supports non-continuous rendering, see https://github.com/libgdx/libgdx/pull/3772 - API Change: Lwjgl3WindowListener.refreshRequested() is called when the windowing system (GLFW) reports contents of a window are dirty and need to be redrawn. - API Change: Lwjgl3WindowListener.maximized() is called when a window enters or exits a maximized state. - API Change: Lwjgl3WindowListener.deiconified() removed, combined with .iconified(). - API Change: Lwjgl3Window.deiconify() renamed to .restore() since it can also be used to de-maximize a window. - Lwjgl3Window now has a maximize() method, and windows can be started maximized using the window or app configuration's setMaximized() method. - NinePatch can now be drawn rotated or scaled. - NinepatchDrawable is now a TransformDrawable. - API Change: Group add* methods no longer remove and re-add the actor if it is already in the group, instead they do nothing. - API Change: g2d.Animation is now generic so it can support Drawables, PolygonRegions, NinePatches, etc. To fix existing code, specify the TextureRegion type in animation declarations (and instantiations in Java 6), i.e. Animation<TextureRegion> myAnimation = new Animation<TextureRegion>(...); - TiledDrawable throws unsupported operation if trying to draw rotated/scaled. #4005 - API Change: DragAndDrop now puts default position of drag actor at pointer location. The original default offset from the pointer was (14, -20). - Added ShaderProgramLoader for AssetManager. - BoundingBox#isValid now returns also true when min==max, see: https://github.com/libgdx/libgdx/pull/4460 [1.9.4] - Moved snapping from ProgressBar to Slider to prevent snapping when setting the value programmatically. - Bullet: added btSoftBody#getLinkCount() and btSoftBody#getLink(int), see https://github.com/libgdx/libgdx/issues/4152 - API Change: Wrapping for scene2d's HorizontalGroup and VerticalGroup. - Fix hiero problem with certain unicode characters. See https://github.com/libgdx/libgdx/issues/4202 - Switched to RoboVM fork 2.2.0, fixes incompatibility with Android Gradle plugin and iOS 9.3.4 [1.9.3] - Switched to MobiDevelop's RoboVM fork (http://robovm.mobidevelop.com) - Addition of Intel Multi-OS Engine backend for deploying to iOS - Updated iOS native build scripts to iOS 9.3 and TVOS 9.2 - API Addition: GestureDetector#pinchStop() called when no longer pinching - API Addition: Gdx.graphics.setUndecorated/setResizable API added to Graphics https://github.com/libgdx/libgdx/pull/3847 - API Addition: Gdx.graphics.getGLVersion(), grab the GL version and implementation type. https://github.com/libgdx/libgdx/pull/3788 - API Change: Lwjgl3WindowListener -> filesDropped(String[] files) adds drag'n drop support for the lwjgl3 backend - Added isComplete() to ParticleEffect to make it easier to know when all the emitters are done, behaves the same as in the 2D API. - API Change: renamed Lwjgl3WindowListener.windowIsClosing() to closeRequested() to better communicate its intent. - Add IndexData.updateIndices method to increase performance when used with IndexBufferObjectSubData. - Added FlushablePool - Added ShapeCache see https://github.com/libgdx/libgdx/pull/3953 - API Change: moved shape builder logic out of MeshBuilder, see: https://github.com/libgdx/libgdx/pull/3996 - API Change: changed copy constructor OrderedMap(ObjectMap) to OrderedMap(OrderedMap) - API Change: Table reset now calls clearChildren, not clear. - Fixed crashes in AndroidMusic.java when isPlaying is called. Errors are now logged only rather than crashing the app. - Added emulation of ScreenUtils for GWT - Improved performance of glReadPixels() on GWT. New method is 20-30 times faster - Fixed crash on Mac when using LWJGL2, custom cursors and embedding the game in an AWT window - Fixed getDisplayModes(Monitor monitor) returning wrong data on LWJGL2 backend - Fixed Gdx.input.getCurrentEventTime() not being set on LWJGL3, fixes GestureDetector and flick scroll not working - Fixed not being able to select non-latin characters in TextFields - Bullet: added CustomActionInterface, see https://github.com/libgdx/libgdx/pull/4025 - Add window size limits option to LWJGL3 app and window configurations - Add handling of tag "<objectgroup>" within tags "<tile>" in TmxMap loaders. [1.9.2] - Added TextureArray wrapper see https://github.com/libgdx/libgdx/pull/3807 - Fixed bug in AndroidGL20.cpp which cast a pointer to a 32-bit int. Crash on 64-bit ARM, but only for a specific code path and address... - Fixed multiple controllers registering on same index with LWJGL3, see https://github.com/libgdx/libgdx/issues/3774 - Fixed the FreeTypeFontGenerator texture bleeding, see https://github.com/libgdx/libgdx/issues/3521 [1.9.1] - API Change: Override GwtApplication#createApplicationListener() to create your ApplicationListener on GWT, overriding GwtApplication#getApplicationListener() isn't needed anymore, see https://github.com/libgdx/libgdx/issues/3628 - Fixed ARM64 and x86_64 binaries for Android [1.9.0] - API Change: Lwjgl3ApplicationConfiguration#setBackbufferConfig -> setBackBufferConfig - Fixed HexagonalTiledMapRenderer, see https://github.com/libgdx/libgdx/pull/3654 - Added support for locking the screen orientation in GWT, see https://github.com/libgdx/libgdx/pull/3633 - Added Gdx-Kiwi and gdx-lml to extensions, see https://github.com/libgdx/libgdx/pull/3597 - Added Gyroscope support in Input, implemented for Android, see https://github.com/libgdx/libgdx/pull/3594 - Fixed touch mapping on iOS, see https://github.com/libgdx/libgdx/pull/3590 - Added orientation to Box2D Transform class, see https://github.com/libgdx/libgdx/pull/3308 - Added system cursors to GWT, fix 'Ibeam' system cursor not working on LWJGL3. - Added experimental AndroidApplicationConfiguration#useGL30 and IOSApplicationConfiguration#useGL30 for testing OpenGL ES 3.0 support on mobile devices, do not use in production. - Fix broken kerning for FreeType fonts, see https://github.com/libgdx/libgdx/pull/3756 - Added ARM64 and x86_64 binaries for Android - API Addition: FreeTypeFontParameter has an additional field for tweaking hinting, see https://github.com/libgdx/libgdx/pull/3757 [1.8.0] - API Change: Rewrote FreeType shadow rendering (much better). - Added spaceX/Y to FreeType fonts. - Higher quality FreeType font rendering. - Hiero updated to v5, now with FreeType support and other new features! - GlyphLayout now allocates much, much less memory when processing long text that wraps. - Added LWJGL 3 backend, see https://github.com/libgdx/libgdx/issues/3673 for more info. - Added Graphics#getBackBufferWidth and Graphics#getBackBufferHeight for HDPI handling - API Change: Added HdpiUtils. Instead of calling GL20#glViewport and GL20#glScissor yourself please use HdpiUtils instead. It will ensure that you handle HDPI monitors correctly when using those OpenGL functions. On HDPI monitors, the size reported by Gdx.graphics getWidth/getHeight is in logical coordinates as dictated by the operating system, usually half the HDPI resolution. The OpenGL drawing surface works in backbuffer coordinates at the full HDPI resolution. If you pass logical coordinates to glViewport and glScissor, you only affect a quarter of the real backbuffer size. Use HdpiUtils instead, it will do the right thing, while letting you continue to work in logical (aka returned by Gdx.graphics.getWidth/getHeight) coordinates. - API Change: Graphis#getDesktopDisplayMode() has been renamed to Graphics#getDisplayMode() and returns the current display mode of the monitor the window is shown on (primary monitor on all backends except LWJGL3, which supports real multi-monitor setups). - API Change: Graphics#getDisplayModes() return the display modes of the monitor the monitor the window is shown on (primary monitor on all backends except LWJGL3 which supports real multi-monitor setups). - API Change: Graphics#setDisplayMode(DisplayMode) has been renamed to Graphics#setFullscreenMode(). If the window is in windowed mode, it will be switched to fullscreen mode on the monitor from which the DisplayMode stems from. - API Change: Graphics#setDisplayMode(int, int, boolean) has been renamed to Graphics#setWindowedMode(int, int). This will NOT allow you to switch to fullscreen anymore, use Graphics#setFullscreenMode() instead. If the window is in fullscreen mode, it will be switched to windowed mode on the monitor the window was in fullscreen mode on. - API Addition: Graphics#Monitor, represents a monitor connected to the machine the app is running on. A monitor is defined by a name and it's position relative to other connected monitors. All backends except the LWJGL3 backend will report only the primary monitor - API Addition: Graphics#getPrimaryMonitor() returns the primary monitor you usually want to work with. - API Addition: Graphics#getMonitor() returns the monitor your app's window is shown on, which may not be the primary monitor in >= 2 monitor systems. All backends except the LWJGL3 backend will report only the primary monitor. - API Addition: Graphics#getMonitors() returns all monitors connected to the system. All backends except the LWJGL3 backend will only report the primary monitor. - API Addition: Graphics#getDisplayMode(Monitor) returns the display mode of the monitor the app's window is shown on. All backends except the LWJGL3 backend will report the primary monitor display mode instead of the actual monitor's display mode. Not a problem as all other backends run on systems with only a single monitor so far (primary monitor). - Added option to include credentials on cross-origin http requests (used only for GWT backend). - Added option to specify crossorigin attribute when loading images with AssetDownloader (GWT), see #3216. - API Change: removed Sound#setPriority, this was only implemented for the Android backend. However, Android itself never honored priority settings. - API Change: cursor API has been cleaned up. To create a custom cursor, call Graphics#newCursor(), to set the custom cursor call Graphics#setCursor(), to set a system cursor call Graphics#setSystemCursor(). The Cursor#setSystemCursor method has been removed as that was not the right place. Note that cursors only work on the LWJGL, LWJGL3 and GWT backends. Note that system cursors only fully work on LWJGL3 as the other two backends lack a means to set a specific system cursor. These backends fall back to displaying an arrow cursor when setting any system cursor. - API Addition: Added Lwjgl3WindowListener, allows you to hook into per-window iconficiation, focus and close events. Also allows you to prevent closing the window when a close event arrives. [1.7.2] - Added AndroidAudio#newMusic(FileDescriptor) to allow loading music from a file descriptor, see #2970 - Added GLOnlyTextureData, which is now the default for FrameBuffer and FrameBufferCubemap, see #3539 - Added rotationChanged() for Actor class, called when rotation changes, see https://github.com/libgdx/libgdx/pull/3563 - Fixed crash on MacOS when enumerating connected gamepads. - ParticleEmitter no longer says it's complete when it's set to continuous, see #3516 - Improved JSON parsing and object mapping error messages. - Updated FreeType from version 2.5.5 to 2.6.2. - Fixed corrupt FreeType rendering for some font sizes. - API Change: FreeTypeFontParameter has new fields for rendering borders and shadows. - FreeTypeFontParameter can render much better fonts at small sizes using gamma settings. - BitmapFont can now render missing (tofu) glyph for glyphs not in the font. - FreeTypeFontGenerator depreacted methods removed. - Fixed BitmapFont color tags changing glyph spacing versus not using color tags. BitmapFont#getGlyphs has a new paramter. See #3455. - Skin's TintedDrawable now works with TiledDrawable. #3627 - Updated jnigen to Java Parser 2.3.0 (http://javaparser.github.io/javaparser/). - FreeType fonts no longer look terrible at small size. This is a big deal! - Updated to RoboVM 1.12.0, includes tvOS support! [1.7.1] - Fixes AtlasTmxMapLoader region name loading to tileset name instead of filename - Changes TiledMapPacker output, region names are tileset names, adjusts gid, defaults to one atlas per map - API Change: members of Renderable and MeshPart are changed, see https://github.com/libgdx/libgdx/pull/3483 - Added Vector#setToRandomDirection(), see #3222 - Updated to stb_image v2.08 - Added Node#copy(), used when creating a ModelInstance from a Model to allow using custom nodes - Add ModelCache, see https://github.com/libgdx/libgdx/wiki/ModelCache - Updated bullet to v2.83.6 - Updated to RoboVM 1.9, for free life-time license read http://www.badlogicgames.com/wordpress/?p=3762 [1.7.0] - Gdx.input.setCursorImage removed, replaced with Gdx.graphics.setCursor and Gdx.graphics.newCursor see https://github.com/libgdx/libgdx/pull/2841/ - Fixed an issue with UTF8 decoding in GWT emulation of InputStreamReader - Updated to RoboVM 1.8 for iOS 9 support. [1.6.5] - Objects from animated tiles in TMX maps are now supported. - Made possible to use any actor for tooltips. - Improved cross-platform reflection api for annotations. - NinePatch#scale now also scales middle patch size. - GLFrameBuffer is now abstract, renamed setupTexture to createColorTexture, added disposeColorTexture - Added LwjglApplicationConfiguration#gles30Context*Version, see https://github.com/libgdx/libgdx/pull/2941 - Added OpenGL error checking to GLProfiler, see https://github.com/libgdx/libgdx/pull/2889 - Updated to RoboVM 1.6 [1.6.4] - TextField cursor and selection size changed. https://github.com/libgdx/libgdx/commit/2a830dea348948d2a37bd8f6338af2023fec9b09 - FreeTypeFontGenerator setting to improve shadows and borders. - ScrollPane scrolls smoothly when the scrolled area is much larger than the scrollbars. - TexturePacker sorts page regions by name. - GlyphLayout text wrapping changed to not trim whitespace. https://github.com/libgdx/libgdx/commit/ee42693da067da7c5ddd747f051c1423d262cb96 - Fixed BitmapFont computing space width incorrectly when padding is used and no space glyph is in the font. - Fixed TextArea cursor and selection drawing positions. - Fixed ActorGestureListener pan and zoom when the actor is rotated or scaled. - Fixed TextField for non-pixel display. - Allow ellipsis string to be set on Label. - AssetManager gets hook for handling loading failure. - TextField now fires a ChangeEvent when the text change. Can be cancelled too! - Added tooltips to scene2d.ui. - Updated to RoboVM 1.5 [1.6.3] - Updated to RoboVM 1.4 [1.6.2] - API Change: TiledMapImageLayer now uses floats instead of ints for positioning - API Change: Added GLFrameBuffer and FrameBufferCubemap: Framebuffer now extends GLFramebuffer, see #2933 [1.6.1] - Added optional hostname argument to Net.newServerSocket method to allow specific ip bindings for server applications made with gdx. - Changed the way iOS native libs are handled. Removed updateRoboVMXML and copyNatives task from ios/build.gradle. Instead natives are now packaged in jars, within the META-INF/robovm/ios folder. Additionally, a robovm.xml file is stored there that gets merged with the project's robovm.xml file by RoboVM. [1.6.0] - API Change: GlyphLayout xAdvances now have an additional entry at the beginning. This was required to implement tighter text bounds. #3034 - API Change: Label#getTextBounds changed to getGlyphLayout. This exposes all the runs, not just the width and height. - In the 2D ParticleEditor, all chart points can be dragged at once by holding ctrl. They can be dragged proportionally by holding ctrl-shift. - Added Merge button to the 2D ParticleEditor, for merging a loaded particle effect file with the currently open particle effect. - Added ability to retrieve method annotations to reflection api - Added PixmapPacker.updateTextureRegions() method. - Added ability to pack "anonymous" pixmaps into PixmapPacker, which will appear in the generated texture but not a generated or updated TextureAtlas - Added PixmapPacker.packDirectToTexture() methods. - API Change: PixmapPacker.generateTextureAtlas(...) now returns an atlas which can be updated with subsequent calls to PixmapPacker.updateTextureAtlas(...) - API Change: FreeTypeFontGenerator.generateFont(...) now works with a user-provided PixmapPacker. - Added DirectionalLightsAttribute, PointLightsAttribute and SpotLightsAttribute, removed Environment#directionalLights/pointLights/spotLights, added Environment#remove, lights are now just like any other attribute. See also https://github.com/libgdx/libgdx/wiki/Material-and-environment#lights - API Change: BitmapFont metrics now respect padding. #3074 - Update bullet wrapper to v2.83 - Added AnimatedTiledMapTile.getFrameTiles() method [1.5.6] - API Change: Refactored Window. https://github.com/libgdx/libgdx/commit/7d372b3c67d4fcfe4e82546b0ad6891d14d03242 - Added VertexBufferObjectWithVAO, see https://github.com/libgdx/libgdx/pull/2527 - API Change: Removed Mesh.create(...), use MeshBuilder instead - API Change: BitmapFontData, BitmapFont, and BitmapFontCache have been refactored. http://www.badlogicgames.com/wordpress/?p=3658 - FreeTypeFontGenerator can now render glyphs on the fly. - Attribute now implements Comparable, custom attributes might need to be updated, see: https://github.com/libgdx/libgdx/wiki/Material-and-environment#custom-attributes - API Change: Removed (previously deprecated) GLTexture#createTextureData/createGLHandle, Ray#getEndPoint(float), Color#tmp, Node#parent/children, VertexAttribute#Color(), Usage#Color, ModelBuilder#createFromMesh, BoundingBox#getCenter()/updateCorners()/getCorners(), Matrix4.tmp [1.5.5] - Added iOS ARM-64 bit support for Bullet physics - 3D Animation, NodeAnimation keyframes are separated into translation, rotation and scaling - Added capability to enable color markup from inside skin json file. - Exposed method ControllerManager#clearListeners on Controllers class - Net#openURI now returns a boolean to indicate whether the uri was actually opened. - DefaultShader now always combines material and environment attributes - Added ShapeRenderer constructor to pass a custom shader program to ImmediateModeRenderer20. - API Change: Group#toString now returns actor hierarchy. Group#print is gone. - Added SpotLight class, see https://github.com/libgdx/libgdx/pull/2907 - Added support for resolving file handles using classpaths (ClasspathFileHandleResolver) [1.5.4] - Added support for image layers in Tiled maps (TiledMapImageLayer) - Added support for loading texture objects from TMX Maps (TextureMapObject) - Added support for border and shadow with FreeTypeFontGenerator - see https://github.com/libgdx/libgdx/pull/2774 - Now unknown markup colors are silently ignored and considered as normal text. - Updated freetype from version 2.4.10 to 2.5.5 - Added 3rd party extensions to setup application, see - Updated to RoboVM 1.0.0-beta-04 - Updated to GWT 2.6.1, sadly GWT 2.7.0 isn't production ready yet. [1.5.3] - API Change: TextField#setRightAlign -> TextField#setAlignment - I18NBundle is now compatible with Android 2.2 - Fixed GWT reflection includes for 3D particles - 3D ParticleEffectLoader registered by default - Added HttpRequestBuilder, see https://github.com/libgdx/libgdx/pull/2698 - Added LwjglApplicationConfiguration.useHDPI for Mac OS X with retina displays. Allows you to get "real" pixel coordinates for mouse and display coordinates. - Updated RoboVM to 1.0.0-beta-03 [1.5.2] - Fixed issue #2433 with color markup and alpha animation. - Fixed natives loading for LWJGL on Mac OS X [1.5.1] - Gradle updated to 2.2 - Android Gradle tooling updated to 1.0.0 - API Change: Switched from Timer to AnimationScheduler for driving main loop on GWT. Removed fps field from GwtApplicationConfiguration to instead let the browser choose the most optimal rate. - API Change: Added pause and resume handling on GWT backend. When the browser supports the page visibility api, pause and resume will be called when the tab or window loses and gains visibility. - API Change: Added concept of target actor, separate from the actor the action is added to. This allows an action to be added to one actor but affect another. This is useful to create a sequence of actions that affect many different actors. Previously this would require adding actions to each actor and using delays to get them to play in the correct order. - Added 64-bit support for iOS sim and device - Deprecated Node#children and Node#parent, added inheritTransform flag and methods to add/get/remove children - API Change: By default keyframes are no longer copied from Model to ModelInstance but shared instead, can be changed using the `ModelInstance.defaultShareKeyframes` flag or `shareKeyframes` constructor argument. - JSON minimal format now makes commas optional: newline can be used in place of any comma. - JSON minimal format is now more lenient with unquoted strings: spaces and more are allowed. - API Change: Added support for KTX/ZKTX file format, https://github.com/libgdx/libgdx/pull/2431 - Update stb_image from v1.33 to v1.48, see https://github.com/libgdx/libgdx/pull/2668 - Bullet Wrapper: added Gimpact, see https://github.com/libgdx/libgdx/issues/2619 - API Addition: Added MeshPartBuilder#addMesh(...), can be used to more easily combine meshes/models - Update to LWJGL 2.9.2, fixes fullscreen mode on "retina" displays - Fixes to RoboVM backend which would crash if accelerometer is used. [1.5.0] - API Addition: IOSInput now uses CMCoreMotion for accelerometer and magnetometer - API Addition: Added getter for UITextField on IOS for keyboard customization - API Addition: Added ability to save PixmapPackers to atlas files. See PixmapPackerIO. - API Addition: Added HttpRequestHeader and HttpResponseHeader with constants for HTTP headers. - API Addition: HttpRequest is now poolable. - New PNG encoder that supports compression, more efficient vertical flipping, and minimal allocation when encoding multiple PNGs. - API Change: Label#setEllipse -> Label#setEllipsis. - API Change: BatchTiledMapRenderer *SpriteBatch fields and methods renamed to *Batch - API Change: ScrollPane#scrollToCenter -> ScrollPane#scrollTo; see optional boolean arguments centerHorizontal and centerVertical (scrollToCenter centered vertically only). - API Change: Changed Input#getTextInput to accept both text and hint, removed Input#getPlaceholderTextInput. - Bug Fix: Fixed potential NPE with immersive mode in the Android fragment backend. - iOS backend now supports sound ids, thanks Tomski! [1.4.1] - Update to the Gradle Integration plugin nightly build if you are on Eclipse 4.4.x! - Update Intellij IDEA to 13.1.5+, because Gradle! - Updated to Gradle 2.1 and Android build tools 20, default Android version to 20. You need to install the latest Android build tools via the SDK manager - API Change: deprecation of bounding box methods, see https://github.com/libgdx/libgdx/pull/2408 - Added non-continuous rendering to iOS backend, thanks Dominik! - Setup now uses Gradle 2.1 with default Android API level 20, build tools 20.0.0 - Non-continuous renderering implemented for iOS - Added color markup support for scene2d label and window title. - API Change: removed default constructor of DecalBatch, removed DefaultGroupStrategy - Updated to latests RoboVM release, 1.0.0-alpha-04, please update your RoboVM plugins/installations - Reduced I18NBundle loading times on Android and bypassed unclosed stream on iOS. - Removed the gdx-ai extension from the libGDX repository. Now it lives in its own repository under the libGDX umbrella, see https://github.com/libgdx/gdx-ai - API Addition: Added randomSign and randomTriangular methods to MathUtils. - API Addition: Decal has now a getter for the Color. - API Addition: now I18NBundle can be set so that no exception is thrown when the key can not be found. - API Addition: added annotation support in reflection layer, thanks code-disaster! https://github.com/libgdx/libgdx/pull/2215 - API Addition: shapes like Rect, Circle etc. now implement Shape2D interface so you can put them all into a single collection https://github.com/libgdx/libgdx/pull/2178 - API Addition: bitmap fonts can now be loaded from an atlas via AssetManager/BitmapFontLoader, see https://github.com/libgdx/libgdx/pull/2110 - API Change: updated to RoboVM 1.0.0-SNAPSHOT for now until the next alpha is released. - API Change: Table now uses padding from its background drawable by default. https://github.com/libgdx/libgdx/issues/2322 - Drawables now know their names, making debugging easier. - API Change: Table fill now respects the widget's minimum size. - Texture packer, fixed image size written to atlas file. - API Change: Cell no longer uses primitive wrappers in public API and boxing is minimized. - API Addition: TextureAttribute now supports uv transform (texture regions). - API Change: Added parameters to Elastic Interpolation. - API Change: Removed Actor#setCenterPosition, added setPosition(x,y,align). - API Change: JsonReader, forward slash added to characters an unquoted strings cannot start with. - API Change: Stage#cancelTouchFocus(EventListener,Actor) changed to cancelTouchFocusExcept. - API Change: Json/JsonWriter.setQuoteLongValues() quotes Long, BigDecimal and BigInteger types to prevent truncation in languages like JavaScript and PHP. [1.3.1] - API change: Viewport refactoring. https://github.com/libgdx/libgdx/pull/2220 - Fixed GWT issues [1.3.0] - Added Input.isKeyJustPressed. - API Addition: multiple recipients are now supported by MessageDispatcher, see https://github.com/libgdx/libgdx/wiki/Message-Handling#multiple-recipients - API Change: State#onMessage now takes the message receiver as argument. - API Addition: added StackStateMachine to the gdx-ai extension. - API change: ShapeRenderer: rect methods accept scale, more methods can work under both line and fill types, auto shape type changing. - API change: Built-in ShapeRenderer debugging for Stage, see https://github.com/libgdx/libgdx/pull/2011 - Files#getLocalStoragePath now returns the actual path instead of the empty string synonym on desktop (LWJGL and JGLFW). - Fixed and improved xorshift128+ PRNG implementation. - Added support for Tiled's animated tiles, and varying frame duration tile animations. - Fixed an issue with time granularity in MessageDispatcher. - Updated to Android API level 19 and build tools 19.1.0 which will require the latest Eclipse ADT 23.02, see http://stackoverflow.com/questions/24437564/update-eclipse-with-android-development-tools-23 for how things are broken this time... - Updated to RoboVM 0.0.14 and RoboVM Gradle plugin version 0.0.10 - API Addition: added FreeTypeFontLoader so you can transparently load BitmapFonts generated through gdx-freetype via AssetManager, see https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/FreeTypeFontLoaderTest.java - Preferences put methods now return "this" for chaining - Fixed issue 2048 where MessageDispatcher was dispatching delayed messages immediately. - API Addition: 3d particle system and accompanying editor, contributed by lordjone, see https://github.com/libgdx/libgdx/pull/2005 - API Addition: extended shape classes like Circle, Ellipse etc. with hashcode/equals and other helper methods, see https://github.com/libgdx/libgdx/pull/2018 - minor API change (will not increase minor revision number): fixed a bug in handling of atlasPrefixes, https://github.com/libgdx/libgdx/pull/2023 - Bullet: btManifoldPoint member getters/setters changed from btVector3 to Vector3, also it is no longer pooled, instead static instances are used for callback methods - Added Intersector#intersectRayRay to detect if two 2D rays intersect, see https://github.com/libgdx/libgdx/pull/2132 - Bullet: ClosestRayResultCallback, AllHitsRayResultCallback, LocalConvexResult, ClosestConvexResultCallback and subclasses now use getter/setters taking a Vector3 instead of btVector3, see https://github.com/libgdx/libgdx/pull/2176 - 2d particle system supports pre-multiplied alpha. - Bullet: btIDebugDrawer/DebugDrawer now use pooled Vector3 instances instead of btVector3, see https://github.com/libgdx/libgdx/issues/2174 [1.2.0] - API Addition: Some OpenGL profiling utilities have been added, see https://github.com/libgdx/libgdx/wiki/Profiling - API Addition: A FreeTypeFontGeneratorLoader has been added to the gdx-freetype extension - API change: Animation#frameDuration and #animationDuration are now hidden behind a getter/setter and dynamic - API Addition: Vector#setZero - API Addition: gdx-ai, extension for AI algorithms. Currently supports FSMs, see https://github.com/libgdx/libgdx/wiki/Artificial-Intelligence - API change: TableLayout has been forked and integrated into libgdx more tightly, see http://www.badlogicgames.com/wordpress/?p=3458 - API Addition: added equals/hashCode methods to Rectangle, may break old code (very, very unlikely) - API Addition: scene2D Actors now have a setCenterPosition method, see https://github.com/libgdx/libgdx/pull/2000 [1.1.0] - Updated to RoboVM 0.0.13 and RoboVM Gradle plugin 0.0.9 - Big improvements to setup-ui and build times in Intellij IDEA https://github.com/libgdx/libgdx/pull/1865 - Setup now uses android build tools version: 19.1.0 - BitmapFontCache now supports in-string colored text through a simple markup language, see https://github.com/libgdx/libgdx/wiki/Color-Markup-Language - Added i18n localization/internationalization support, thanks davebaol, see https://github.com/libgdx/libgdx/wiki/Internationalization-and-Localization - Possibility to override density on desktop to simulate mobile devices, see https://github.com/libgdx/libgdx/pull/1825 - Progressive JPEG support through JPGD (https://code.google.com/p/jpeg-compressor/). - Mavenized JGLFW backend - Box2D: Added MotorJoint and ghost vertices on EdgeShape - Updated GWT Box2D to latest version - Updated native Box2D to latest version 2.3.1, no API changes - API change: Matrix4.set(x,y,z, translation) changed, z axis is no more flipped - API addition: Matrix4.avg(Matrix4[],float[]) that lets weighted averaging multiple matrices, Quaternion.slerp(Quaternion[],float[]) that lets weighted slerping multiple Quaternions - fixed the long standing issue of the alpha=1 not actually being fully opaque, thanks kalle! https://github.com/libgdx/libgdx/issues/1815 - down to 25 issues on the tracker, 8 bugs, 17 enhancement requests :) [1.0.1] - updated to RoboVM 0.12 (and so should you!) - fixed GC issues on iOS with regards to touch (thanks Niklas!), see https://github.com/libgdx/libgdx/pull/1758 - updated gwt gradle plugin to 0.4, android build tools to 0.10, gradle version to 1.11 - Tiled maps are now always y-up - Tiled maps now support drawing offsets for tiles - FileHandle#list is now supported in GWT! - FileHandle#list now supports FileFilters - Controllers now reinitialize on the desktop when switching between windowed/fullscreen - added a Texture unpacker that will extract all images from a texture atlas, see https://github.com/libgdx/libgdx/pull/1774 - updates to gdx-setup - CustomCollisionDispatcher in bullet, see https://github.com/libgdx/libgdx/commit/916fc85cecf433c3461b458e00f8afc516ad21e3 [1.0.0] - Box2D is no longer in the core, it has been moved to an extension. See http://www.badlogicgames.com/wordpress/?p=3404 - Merged gdx-openal project into gdx-backend-lwjgl - Now LoadedCallback in AssetLoaderParameters is always called after loading an asset from AssetManager, even if the asset is already loaded - Added Payload as a new parameter to Source.dragStop, see https://github.com/libgdx/libgdx/pull/1666 - You can now load PolygonRegions via AssetLoader, see https://github.com/libgdx/libgdx/pull/1602 - implemented software keyboard support in RoboVM iOS backend - Fixed an issue where key event timestamp is not set by the android backend. - scene2d.ui, added to TextArea the preferred number of rows used to calculate the preferred height. - scene2d.actions, fixed infinite recursion for event listener's handle(event). - Various Quaternion changes. - scene2d.ui, fixed a drawing issue with knobBefore when there's no knob (typical progress bar). - Various MeshBuilder fixes and additions. - Math package: added cumulative distribution. - Fixed Music isPlaying() on iOS when is paused. - Added support for C-style comments to JsonReader (mainly used for json skin files). - Support for resource removal from Skin objects. - Added fling gesture to generate fling in scrollpane. - Vector classes now have mulAdd method for adding pre-multiplied values - Vector implementations no longer use squared value for margin comparisons, see: isZero(float margin), isUnit(float margin). - Vector2 now has isUnit and isZero methods (copied from Vector3) - Removed deprecated methods from Vector classes. - Added new headless backend for server applications - Support 'scaledSize' as a json skin data value for BitmapFont - Added setAlpha(float a) method to Sprite class - Added Input.Keys.toString(int keycode) and Input.Keys.valueOf(String keyname) methods - Added Immersive Mode support to Android backend - Added userObject to Actor in scene2d, allowing for custom data storage - Altered Android's hide status bar behavior - Changed the way wakelocks are implemented. You no longer need any special permissions for the libgdx wakelock - BitmapFontCache setColor changes to match SpriteBatch and friends. http://www.badlogicgames.com/forum/viewtopic.php?f=23&t=12112 - Changed ParticleEffect: the ParticleEffect.save method now takes a Writer instead of a File - TexturePacker2 renamed to TexturePacker, added grid and scaling settings. - Added support for custom prefrences on the desktop backends. - Fixed double resume calls on iOS. - Android Music no longer throws exceptions if MediaPlayer is null. - PolygonSpriteBatch implements Batch. - New scene2d actions: EventAction, CountdownEventAction. - Adds cancelHttpRequest() method to Net interface - Updated GWT/HTML5 Backend to GWT 2.6.0 - Minimal Android version is 2.2, see http://www.badlogicgames.com/wordpress/?p=3297 - Updated to LWJGL 2.9.1 - Can now embed your libgdx app as a fragment, more info on the wiki - scene2d.ui, renamed Actor methods translate, rotate, scale, size to moveBy, rotateBy, scaleBy, sizeBy. May have conflicts with Actions static import, eg you'll need to use "Actions.moveBy" - scene2d.ui, Table background is now drawn usign the table's transform - scene2d.ui, added Container which is similar to a Table with one cell, but more lightweight - Added texture filters and mip map generation to BitMapFontLoader and FreeTypeFontGenerator - scene2d.ui, VerticalGroup and HorizontalGroup got pad, fill and an API similar to Table/Container - Removed OpenGL ES 1.0, 1.1 support; see http://www.badlogicgames.com/wordpress/?p=3311 - Added OpenGL ES 3 support - Updated Android backend, demos, tests to 4.4 - Added Viewport, changed Stage to have a Viewport instead of a Camera (API change, see http://www.badlogicgames.com/wordpress/?p=3322 ). - Changed play mode constants of Animation class to enumeration, see http://www.badlogicgames.com/wordpress/?p=3330 - Updated to RoboVM 0.0.11 and RoboVM Gradle plugin 0.0.6, see http://www.badlogicgames.com/wordpress/?p=3351 - Updated to Swig 3.0 for Bullet, disabled SIMD on Mac OS X as alignements are broken in Bullet, see https://github.com/libgdx/libgdx/pull/1595 - TextureData can only be Custom or Pixmap; compressed image files are considered custom [0.9.9] - added setCursorImage method to Input interface to support custom mouse cursors on the desktop - removed Xamarin backend, see http://www.badlogicgames.com/wordpress/?p=3213 - added Select class for selecting kth ordered statistic from arrays (see Array.selectRanked() method) - refactored Box2D to use badlogic Arrays instead of java.util.ArrayLists - MipMapGenerator methods now don't take disposePixmap argument anymore - added GLTexture, base class for all textures, encapsulates target (2d, cubemap, ...) - added CubeMap, 6 sided texture - changed TextureData#consumeCompressedData, takes target now - added RoboVM backend jar and native libs (libObjectAL, libgdx, in ios/ folder of distribution) - added RoboVM backend to build - changed Bullet wrapper API, see http://www.badlogicgames.com/wordpress/?p=3150 - changed MusicLoader and SoundLoader to be asynchronous loaders - changed behaviour of Net#sendHttpRequest() so HttpResponseListener#handleHttpResponse() callback is executed in worker thread instead of main thread - added Bresenham2, for drawing lines on an integer 2D grid - added GridPoint2 and GridPoint3, representing integer points in a 2D or 3D grid - added attribute location caching for VertexData/Mesh. Hand vertex attribs to a ShaderProgram, get back int[], pass that to Mesh - added Android x86 builds, removed libandroidgl20.so, it's now build as part of gdx-core for Android - changed method signature on Box2D World#getBodies and World#getJoints, pass in an Array to fill - removed glGetShaderSource from GL20, use ShaderProgram#getVertexShaderSource/getFragmentShaderSource instead - added reflection api - added AsynchExecutor, execute tasks asynchronously. Used for GWT mainly. - removed FileHandle#file(), has no business in there. - removed box2deditor - removed custom typedarrays in gwt backend - added classpath files support for gwt backend (limited) - moved AndroidWallpaperListener to Android Backend - added new VertexAttribute Usage flags, bone weight, tangent, binormal. previously encoded as Usage.Generic. Also added field "unit" to VertexAttribute, used by texture coordinates and bone weights to specify index/unit. - setup-ui template for iOS disables pngcrush, also updated wiki iOS article - add Pixmap#fillTriangle via jni gdx2d_fill_triangle() to fill a triangle based on its vertices. - add asynchronous download with continuous progress feedback to GWT asset preloader, see https://github.com/libgdx/libgdx/pull/409?w=1 - add capability to add/exclude package/classes GWT Reflection system, see https://github.com/libgdx/libgdx/pull/409?w=1 - add updated gdx-tiled-preprocessor, generate one single TextureAtlas for all the specified Tiled maps, see http://www.badlogicgames.com/forum/viewtopic.php?f=17&t=8911 - maps API, add new AtlasTiledMapLoader for loading maps produced by the tiled preprocessor tool - ImageProcessor, TexturePacker2 now accepts BufferedImage objects as input - TexturePacker2 now avoids duplicated aliases - Updated to LWJGL 2.9.0 - refactored JSON API, see http://www.badlogicgames.com/wordpress/?p=2993 - Updated Box2D to the latest trunk. Body#applyXXX methods now take an additional boolean parameter. - TmxMapLoader has a flag in Parameters that lets you specify whether to generate mipmaps - Animation#isAnimationFinished was fixed to behave as per javadocs (ignores looping) - remove GLU interface and implementations. Use Matrix4 et al instead. see http://www.badlogicgames.com/wordpress/?p=2886 - new maps API, see http://www.badlogicgames.com/wordpress/?p=2870 - removed static public tmp Vector2 instances, manage such temporary vars yourself, see http://www.badlogicgames.com/wordpress/?p=2840 - changed Scene2D Group#clear(), see http://www.badlogicgames.com/wordpress/?p=2837 - changed the build system, natives are now fetched from the build server, see http://www.badlogicgames.com/wordpress/?p=2821 - freetype extension supported on iOS, see http://www.badlogicgames.com/wordpress/?p=2819 - changed ShapeRenderer API, see http://www.badlogicgames.com/wordpress/?p=2809 - changed Actions.add to addAction, changed parameter order, and added removeAction, addListener, removeListener - Box2d joints now allow for user data - Changes to Intersector, Circle, Rectangle and BoundingBox for consistency in #overlap, #intersect and #contains methods, see https://github.com/libgdx/libgdx/pull/312 - Removed LwjglApplicationConfiguration CPU sync. Added foreground and background target framerate. - scene2d, no longer use getters/setters internally for Actor x, y, width, height, scalex, scaley and rotation. - Array, detect nested iterator usage and throw exception. - Added getVolume to Music class and Android, IOS and GWT backends - 1381, fixed JSON parsing of longs. In addition to Float, it now parses Long if no decimal point is found. - Changed Array constructors that took an array to have offset and count - scene2d, Actor parentToLocalCoordinates and localToParentCoordinates refactoring, see http://www.badlogicgames.com/forum/viewtopic.php?p=40441#p40441 - scene2d, Action#setActor no longer calls reset if the Action has no pool. This allows non-pooled actions to be add and removed from actors, restarted, and reused. - ScrollBar#setForceOverscroll renamed to setForceScroll, as it affects more than just overscroll. - ArrayMap#addAll renamed to putAll to match the other maps. - Added ObjectSet and IntSet. - Added completion listener to Music. - Added Music#setPan. - Sound#play and Sound#loop on Android now return -1 on failure, to match other backends. - DelegateAction subclasses need to implement delegate() instead of act(). http://www.badlogicgames.com/forum/viewtopic.php?p=43576#p43576 - Added pause and resume methods to Sound. - Changed AssetErrorListener#error to have AssetDescriptor to enable access to parameters of failed asset. - Changed SelectBoxStyle to have ScrollPaneStyle and ListStyle for fully customizing the drop down list. http://www.badlogicgames.com/wordpress/?p=3110 - AssetLoader now takes a FileHandle that is the resolved file name. The AssetLoader no longer has to resolve the file name, so we can prevent it from being resolved twice. - Rewrote EarClippingTriangulator to not allocate (no more Vector2s). - Added ParticleEffectLoader to make AssetManager load ParticleEffects - Added GeometryUtils, more Intersector functions, DelaunayTriangulator, ConvexHull. - Added getBoundingBox to ParticleEffect - EarClippingTriangulator changed to return triangle indices. - PolygonSpriteBatch and friends refactored to use triangle indices. - Added add(T, float), remove(int), remove(T) and clear() methods to BinaryHeap - Bitmap Font changes: - FreeTypeFontGenerator allows you to specify the PixmapPacker now, to create an atlas with many different fonts (see FreeTypePackTest) - BitmapFont, BitmapFontCache and FreeTypeFontGenerator now support fonts with multiple texture pages. (see BitmapFontTest and FreeTypePackTest) - BitmapFontData.imagePath and getImagePath() is depreacted, use imagePaths[] and getImagePath(int) instead - Added two BitmapFont constructors for convenience; no need to specify flip boolean - Added getCache() to BitmapFont, for expert users who wish to use the BitmapFontCache (see BitmapFontTest) - FreeTypeFontGenerator now includes setMaxTextureSize and getMaxTextureSize to cap the generated glyph atlas size (default 1024) - added render-hooks beginRender() and endRender() to BatchTiledMapRenderer - Added panStop to GestureListener interface. - ScissorStack#calculateScissors changed to take viewport, enabling it to work with glViewport. - Added Bits#getAndClear, Bits#getAndSet and Bits#containsAll - Added setX and setY to TextureAtlas.AtlasSprite so it matches expected behavior [0.9.8] - see http://www.badlogicgames.com/wordpress/?p=2791 [0.9.7] - see http://www.badlogicgames.com/wordpress/?p=2664 [0.9.6] - see http://www.badlogicgames.com/wordpress/?p=2513
[1.12.1] - LWJGL3 Improvement: Audio device is automatically switched if it was changed in the operating system. - Tiled Fix: TiledLayer parallax default values fix - Android: Removed mouse catching added on 1.12.0 due to unintended effects (see #7187). - API Addition: Using "object" property in Tiled object now fetches MapObject being pointed to, and BaseTmxMapLoader includes method for fetching map where key is id and value is MapObject instance. - Update to LWJGL 3.3.3 [1.12.0] - [BREAKING CHANGE] Added #touchCancelled to InputProcessor interface, see #6871. - [BREAKING CHANGE] Android: Immersive mode is now true by default. Set `useImmersiveMode` config to `false` to disable it. - [BREAKING CHANGE] iOS: Increased min supported iOS version to 11.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] iOS: `hideHomeIndicator` set to `false` by default (was `true`). - [BREAKING CHANGE] iOS: `screenEdgesDeferringSystemGestures` set to `UIRectEdge.All` by default (was `UIRectEdge.None`). - [BREAKING CHANGE] iOS: preferred FPS is now uncapped by default, see #6717 - [BREAKING CHANGE] iOS: `ApplicationListener.create` and first `resize` are now called within `UIApplicationDelegate.didFinishLaunching`. Allows for earlier rendering and prevents black screen frames after launch screen. NOTE: App will get terminated if this method is blocked for more than 10-20 sec. - [BREAKING CHANGE] Actor#localToAscendantCoordinates throws an exception if the specified actor is not an ascendant. - [BREAKING CHANGE] WidgetGroup#hit first validates the layout. - [BREAKING CHANGE] Cell getters return object wrapper instead of primitives. - [BREAKING CHANGE] MeshPartBuilder#lastIndex now returns int instead of short. - [BREAKING CHANGE] 3D API - max bone weights is now configurable and limited to 4 by default. Change this value if you need less or more. See #6522. - [BREAKING CHANGE] Mesh#getVerticesBuffer, Mesh#getIndicesBuffer, VertexData#getBuffer, and IndexData#getBuffer are deprecated in favor to new methods with boolean parameter. If you subclassed some of these classes, you need to implement the new methods. - [BREAKING CHANGE] Desktop: The return value of AudioDevice#getLatency() is now in samples, and not milliseconds - [BREAKING CHANGE] iOS: 32 bit (armv7) builds are no longer supported. Builds must be 64 bit (arm64) only. - [BREAKING CHANGE] iOS: Use dynamic frameworks instead of static libs - [BREAKING CHANGE] optimized Mesh#bind and Mesh#unbind have a new parameter for instanced attribute locations. If you use these methods without instancing, you can pass a null value. - [BREAKING CHANGE] Dropped support for older libc versions since libGDX is now built on Ubuntu 20.04 (#7005) - [KNOWN ISSUE] Android drag behaviour. Gdx.input.getDeltaX() and Gdx.input.getDeltaY always return 0 for pointer 0. Fixed on next version. - Update to jnigen 2.4.1 - LWJGL Fix: setPosision() for MP3 files. - iOS: Add new MobiVM MetalANGLE backend - iOS: Update to MobiVM 2.3.19 - Update to LWJGL 3.3.2 - API Addition: Added Audio#switchOutputDevice and Audio#getAvailableOutputDevices to specify output devices. Only works for LWJGL3 - Fix LWJGL3: Audio doesn't die anymore, if a device gets disconnected - API Addition: Added Haptics API with 4 different Input#vibrate() methods with complete Android and iOS implementations. - Fix: Fixed Android and iOS touch cancelled related issues, see #6871. - Javadoc: Add "-use" flag to javadoc generation - Android: gdx-setup now uses AGP 7.2.2 and SDK 32, requiring Android Studio Chipmunk or IntelliJ IDEA 2022.2 and JDK 11. - libGDX is now built using Java 11 due to new Android requirements. The rest of libGDX can still be built with JDK 8 and runtime compatibility of libGDX projects should be unaffected. - Fixed glViewport when using HdpiMode.Logical with the LWJGL3 backend. - Added Stage#actorRemoved to fire exit events just before an actor is removed. - ScrollPane#setScrollingDisabled avoids invalidate() if nothing changed. - Fixed incorrect ScrollPane#scrollTo. - API Addition: Added Texture3D support - Fix: Throw an exception when maximum Attribute count is reached to prevent silent failure. - API Fix: The cursor can now be catched on Android. - LWJGL3 Fix: Stereo audio can now be played on mono output devices. This may also improve downmixing to stereo and upmixing to surround. - API Addition: Added CheckBox#getImageDrawable. - FIX: HexagonalTiledMapRenderer now displays maps with the correct stagger index. - API Addition: Added I18NBundle#keys() method. - TOOLS Features: Save mode can be changed in Flame particle 3D editor. - API Addition: added WebGL 2.0 implementation to Gwt backend : you can enable it by GwtApplicationConfiguration#useGL30 - Added GLES31 and GLES32 support with Lwjgl3 backend implementation - API Addition: JsonReader#stop() to stop parsing. - API Change: TextureAtlas now uses FileHandle#reader so outside code can control the charset - API Fix: Intersector#isPointInTriangle - API Addition: The Skin serializer now supports useIntegerPositions - API Change: The skin serializer now treats scaledSize as a float - API Change: DataInput throws an EOF-Exception - API Fix: RenderBuffer leak in GLFrameBuffer class - API Change: Pixmap#setPixels will now verify it has been given a direct ByteBuffer - API Addition: glTexImage2D and glTexSubImage2D with offset parameter - API Addition: OrientedBoundingBox - API Addition: Tiled parallax factor support - API Fix: LWJGL 3’s borderless fullscreen works with negative monitor coords - API Fix: Update mouse x and y values immediately after calling #setCursorPosition - API Change: Never stall with AssetManager on GWT - API Change: Allow packed depth stencil buffer creation when not using GL30 - API Fix: Fixed DataInput#readString for non-ASCII - API Fix: LwjglGraphics.setupDisplay() is no longer choosing the wrong display mode - API Fix: MathUtils.lerpAngle() fixed for extreme inputs - MathUtils trigonometry improvements - Various Scene2D fixes and improvements [1.11.0] - [BREAKING CHANGE] iOS: Increased min supported iOS version to 9.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] Removed Maven and Ant build systems. libGDX is now solely built with Gradle. See https://libgdx.com/dev/from-source/ for updated build instructions. - [BREAKING CHANGE] Android Moved natives loading out of static init block, see #5795 - [BREAKING CHANGE] Linux: Shared libraries are now built on Ubuntu 18.04 (up from Ubuntu 16.04) - [BREAKING CHANGE] The built-in font files arial-15.fnt and arial-15.png have been replaced with lsans-15.fnt and lsans-15.png; this may change some text layout that uses the built-in font, and code that expects arial-15 assets to be present must change to lsans-15. - [BREAKING CHANGE] Legacy LWJGL3 projects must update the sourceCompatibility to 1.8 or higher. - [BREAKING CHANGE] Android Removed hideStatusBar configuration, see #6683 - [BREAKING CHANGE] Lwjgl3ApplicationConfiguration#useOpenGL3 was replaced by #setOpenGLEmulation - Gradle build now takes -PjavaVersion=7|8|9... to specify the Java version against which to compile libGDX. Default is Java 7 for everything, except the LWJGL3 backend, which is compiled for Java 8. - LWJGL3 extension: Added gdx-lwjgl3-glfw-awt-macos extension. Fixes GLFW in such a way, that the LWJGL3/libGDX must no longer run on the main thread in macOS, which allows AWT to work in parallel, i.e. file dialogs, JFrames, ImageIO, etc. You no longer need to pass `-XstartOnFirstThread` when starting an LWJGL3 app on macOS. See `AwtTestLWJGL` in gdx-tests-lwjgl3. For more information, see https://github.com/libgdx/libgdx/pull/6772 - API Addition: Added LWJGL3 ANGLE support for x86_64 Windows, Linux, and macOS. Emulates OpenGL ES 2.0 through DirectX (Windows), desktop OpenGL (Linux), and Metal (macOS). May become the preferred method of rendering on macOS if Apple removes OpenGL support entirely. May fix some OpenGL driver issues. More information here: https://github.com/libgdx/libgdx/pull/6672 - iOS: Update to MobiVM 2.3.16 - Update to LWJGL 3.3.1 - API Addition: ObjLoader now supports ambientColor, ambientTexture, transparencyTexture, specularTexture and shininessTexture - API Addition: PointSpriteParticleBatch blending is now configurable. - TOOLS Features: Blending mode and sort mode can be changed in Flame particle 3D editor. - API Addition: Polygon methods setVertex, getVertex, getVertexCount, getCentroid. - API Addition: TMX built-in tile property "type" is now supported. - API Addition: Octree structure. - API Addition: Added StringBuilder#toStringAndClear() method. - FirstPersonCameraController keys mapping is now configurable - Fix: GlyphLayout: Several fixes for color markup runs with multi-line or wrapping texts - API change: GlyphLayout#GlyphRun is now one GlyphRun per line. "color" was removed from GlyphRun and is now handled by GlyphLayout. - Gdx Setup Tool: Target Android API 30 and update AGP plugin to 4.1.3 - API Fix: Sound IDs are now properly removed; this prevents changes to music instances with the same ID - API Fix: LWJGL3Net#openURI does now work on macOS & JDK >= 16 - API Fix: Fixed a possible deadlock with AssetManager#dispose() and #clear() - API Change: Enable the AL_DIRECT_CHANNELS_SOFT option for Sounds and AudioDevices as well to fix stereo sound - API Addition: CameraInputController#setInvertedControls(boolean) - API Removal: AnimatedTiledMapTile#frameCount - LWJGL 3 is now the default desktop backend. If you want to port your existing applications, take a look here: https://gist.github.com/crykn/eb37cb4f7a03d006b3a0ecad27292a2d - Brought the official and third-party extensions in gdx-setup up to date. Removed some unmaintained ones and added gdx-websockets & jbump. - API Fix: Escaped characters in XML attributes are now properly un-escaped - Bug Fix: AssetManager backslash conversion removed - fixes use of filenames containing backslashes - gdx-setup now places the assets directory in project root instead of android or core. See advanced settings (UI) or arguments (command line) if you don't want it in root. - API Fix: Resolved issues with LWJGL 3 and borderless fullscreen - API Addition: GeometryUtils,polygons isCCW, ensureClockwise, reverseVertices - API Addition: Added FreeTypeFontGenerator#hasCharGlyph method. - API Fix: Pool discard method now resets object by default. This fixes the known issue about Pool in libGDX 1.10.0. - API Addition: Split GWT reflection cache into two generated classes - API Fix: Fix Box2D memory leak with ropes on GWT - API Fix: Fix NPE in Type#getDeclaredAnnotation - API Addition: Add pause/resume methods to AudioDevice - API Fix: Protection against NullPointerException in World#destroyBody() - API Fix: Prevent repeated mipmap generation in FileTextureArrayData - API Fix: Fix issue with camera reference in CameraGroupStrategy’s default sorter - API Fix: Move vertex array index buffer limit to backends to fix issue with numIndices parameter - API Fix: TexturePacker: Fix wrong Y value when using padding - API Fix: Lwjgl3Net: Add fallback to xdg-open on Linux if Desktop.BROWSE is unavailable - API Addition: Add NWSEResize, NESWResize, AllResize, NotAllowed and None SystemCursors - API Addition: GWTApplication#getJavaHeap and getNativeHeap are now supported - API Addition: Box2D Shape now implements Disposable - API Addition: Added ChainShape#clear method - API Addition: Added Tooltip#setTouchIndependent; see #6758 - API Addition: Emulate Timer#isEmpty on GWT - API Addition: Bits add copy constructor public Bits (Bits bitsToCpy) - API Addition: Added List#drawSelection(). - API Addition: GwtApplicationConfiguration#xrCompatible - API Fix: setSystemCursor() now works on Android - API Fix: getDisplayMode() is now more accurate on Android and GWT. - API Addition: JsonValue#iterator(String) to more easily iterate a child that may not exist. - API Addition: Added ExtendViewport#setScaling, eg for use with Scaling.contain. - API Addition: Added application lifecycle methods to IOSAudio for custom audio implementations. - API Addition: Added getBoundingRectangle() to Polyline - API Addition: ShapeRenderer#check() has now protected visibility - API Addition: Add ability to host GWT module on a different domain than the site, see #6851 - API Addition: Addes Tooltip#setTouchIndependent; see #6758 - API ADDITION: Emulate Timer#isEmpty on GWT - API Addition: OrientedBoundingBox. [1.10.0] - [BREAKING CHANGE] Android armeabi support has been removed. To migrate your projects: remove any dependency with natives-armeabi qualifier from your gradle build file, this apply to gdx-platform, gdx-bullet-platform, gdx-freetype-platform and gdx-box2d-platform. - [BREAKING CHANGE] tvOS libraries have been removed. No migration steps required. - [BREAKING CHANGE] Linux x86 (32-bit) support has been removed. No migration steps required. - [BREAKING CHANGE] Requires Java 7 or above. - [BREAKING CHANGE] API Change: Scaling is now an object instead of an enum. This may change behavior when used with serialization. - [BREAKING CHANGE] Group#clear() and #clearChildren() now unfocus the children. Added clear(boolean) and clearChildren(boolean) for when this isn't wanted. Code that overrides clear()/clearChildren() probably should change to override the (boolean) method. #6423 - [BREAKING CHANGE] Lwjgl3WindowConfiguration#autoIconify is enabled by default. - [KNOWN ISSUE] Pool no longer reset freed objects when pool size is above its retention limit. Pool will discard objects instead. If you want to keep the old behavior, you should override Pool#discard method to reset discarded objects. - Scene2d.ui: Added new ParticleEffectActor to use particle effects on Stage - API addition: iOS: Added HdpiMode option to IOSApplicationConfiguration to allow users to set whether they want to work in logical or raw pixels (default logical). - Fix for #6377 Gdx.net.openURI not working with targetSdk 30 - Api Addition: Added a Pool#discard(T) method. - Architecture support: Linux ARM and AARCH64 support has been added. The gdx-xxx-natives.jar files now contain native libraries of these architectures as well. - API Addition: Desktop Sound now returns number of channels and sample rate. [1.9.14] - [BREAKING CHANGE] iOS: IOSUIViewController has been moved to its own separate class - [BREAKING CHANGE] API Change: G3D AnimationDesc#update now returns -1 (instead of 0) if animation not finished. - [BREAKING CHANGE] InputEventQueue no longer implements InputProcessor, pass InputProcessor to #drain. - [BREAKING CHANGE] HeadlessApplicationConfiguration#renderInterval was changed to #updatesPerSecond - API addition: Added Pixmap#setPixels(ByteBuffer). - API change: ScreenUtils#getFrameBufferPixmap is deprecated in favor to new method Pixmap#createFromFrameBuffer. - API Addition: Added overridable createFiles() methods to backend application classes to allow initializing custom module implementations. - API Addition: Add a Graphics#setForegroundFPS() method. [1.9.13] - [BREAKING CHANGE] Fixed keycode representations for ESCAPE, END, INSERT and F1 to F12. These keys are working on Android now, but if you hardcoded or saved the values you might need to migrate. - [BREAKING CHANGE] TextureAtlas.AtlasRegion and Region splits and pads fields have been removed and moved to name/value pairs, use #findValue("split") and #findValue("pad") instead. - iOS: Update to MobiVM 2.3.12 - GWT: Key codes set with Gdx.input.setCatchKey prevent default browser behaviour - Added Scaling.contain mode: Scales the source to fit the target while keeping the same aspect ratio, but the source is not scaled at all if smaller in both directions. - API Addition: Added hasContents() to Clipboard interface, to reduce clipboard notifications on iOS 14 - TOOLS Features: Blending mode can be changed in Flame particle 3D editor. - Input Keycodes added: CAPS_LOCK, PAUSE (aka Break), PRINT_SCREEN, SCROLL_LOCK, F13 to F24, NUMPAD_DIVIDE, NUMPAD_MULTIPLY, NUMPAD_SUBTRACT, NUMPAD_ADD, NUMPAD_DOT, NUMPAD_COMMA, NUMPAD_ENTER, NUMPAD_EQUALS, NUMPAD_LEFT_PAREN, NUMPAD_RIGHT_PAREN, NUM_LOCK. Following changes might be done depending on platform: Keys.STAR to Keys.NUMPAD_MULTIPLY, Keys.SLASH to Keys.NUMPAD_DIVIDE, Keys.NUM to Keys.NUM_LOCK, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.PERIOD to Keys.NUMPAD_DOT, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.ENTER to Keys.NUMPAD_ENTER, Keys.PLUS to Keys.NUMPAD_ADD, Keys.MINUS to Keys.NUMPAD_SUBTRACT - Added a QuadFloatTree class. - Desktop: Cubemap Seamless feature is now enabled by default when supported, can be changed via backend specific methods, see supportsCubeMapSeamless and enableCubeMapSeamless in both LwjglGraphics and Lwjgl3Graphics. - API Addition: TextureAtlas reads arbitrary name/value pairs for each region. See #6316. - TexturePacker writes using a new format when legacyOutput is false (default is true). TextureAtlas can read both old and new formats. See #6316. [1.9.12] - [BREAKING CHANGE] iOS: Changed how Retina/hdpi handled on iOS. See #3709. - [BREAKING CHANGE] API Change: InputProcessor scrolled method now receives scroll amount for X and Y. Changed type to float to support devices which report fractional scroll amounts. Updated InputEvent in scene2d accordingly: added scrollAmountX, scrollAmountY attributes and corresponding setters and getters. See #6154. - [BREAKING CHANGE] API Change: Vector2 angleRad(Vector2) now correctly returns counter-clockwise angles. See #5428 - [BREAKING CHANGE] Android: getDeltaTime() now returns the raw delta time instead of a smoothed one. See #6228. - Fixed vertices returned by Decal.getVertices() not being updated - Fixes Issue #5048. The function Intersector.overlapConvexPolygons now should return the right minimum translation vector values. - Update to MobiVM 2.3.11 - API Change: Removed Pool constructor with preFill parameter in favor of using Pool#fill() method. See #6117 - API Addition: Slider can now be configured to only trigger on certain mouse button clicks (Slider#setButton(int)). - Fixed GlyphLayout not laying out correctly with color markup. - Fixed TileDrawable not applying its scale correctly. - API Addition: Added epsilon methods to maps with float values. - API Addition: Added an insertRange method to array collections. - Fixed GestureDetector maxFlingDelay. - API Change: Changed default GestureDetector maxFlingDelay to Integer.MAX_VALUE (didn't work before, this matches that). - Gdx.files.external on Android now uses app external storage - see wiki article File handling for more information - Improved text, cursor and selection rendering in TextArea. - API Addition: Added setProgrammaticChangeEvents, updateVisualValue, round methods to ProgressBar/Slider. - iOS: Keyboard events working on RoboVM on iOS 13.5 and up, uses same API as on other platforms - API Addition: Added AndroidLiveWallpaper.notifyColorsChanged() to communicate visually significant colors back to the wallpaper engine. - API Change: AssetManager invokes the loaded callback when an asset is unloaded from the load queue if the asset is already loaded. - GWT: changed audio backend to WebAudio API. Now working on mobiles, pitch implemented. Configuration change: preferFlash removed. When updating existing projects, you can remove the soundmanager js files from your webapp folder and the references to it from index.html - GWT: added possibility to lazy load assets via AssetManager instead of preload them before game start. See GWT specifics wiki article for more information. - GWT: New configuration setting usePhysicalPixels to use native resolution on mobile / Retina / HDPI screens. When using this option, make sure to update your code in index.html and HTMLLauncher from setup template. - GWT: GwtApplicationConfiguration and GWT backend now support an application to be resizable or fixed size. You can remove your own resizing code from your HTMLLaunchers. - GWT: Assets in distribute build are renamed with md5 hash suffix to bypass browser cache on changes - GWT: Fixed GwtFileHandle that was only returning text assets when listing a directory, now returns all children - API Addition: Pixmap.downloadFromUrl() downloads an image from http(s) URLs and passes it back as a Pixmap on all platforms - Added support for Linux ARM builds. - 32-bit: ARMv7/armhf - 64-bit: ARMv8/AArch64 - API Change: Removed arm abi from SharedLibraryLoader - API Addition: Added a Lwjgl3ApplicationConfiguration#foregroundFPS option. - API Change: Utility classes are now final and have a private constructor to prevent instantiation. - API Change: ScrollPane now supports all combinations of scrollBarsOnTop and fadeScrollBars. - API Addition: Added new methods with a "deg" suffix in the method's name for all Vector2 degrees-based methods and deprecated the old ones. - API Addition: Added Slider#setVisualPercent. - API Change: Enabling fullscreen mode on the lwjgl3 backend now automatically sets the vsync setting again. - API Addition: Added put(key, value, defaultValue) for maps with primitive keys, so the old value can be returned. - API Addition: Added ObjectLongMap. - Added Intersector#intersectRayOrientedBoundsFast to detect if a ray intersects an oriented bounding box, see https://github.com/libgdx/libgdx/pull/6139 - API Addition: Added Table#clip() and Container#clip() methods. - API Addition: Added getBackgroundDrawable() to Button. - API Addition: Added imageCheckedDown and getImageDrawable() to ImageButton and ImageTextButton. - API Addition: Added focusedFontColor, checkedFocusedFontColor, and getFontColor() to TextButton and ImageTextButton. - API Addition: Added wrapReverse setting to HorizontalGroup. - API Addition: Added Slider style drawables for over and down: background, knobBefore, and knobAfter. - Fixed LwjglFrame not hiding the canvas in some situations. - API Change: Table#round uses ceil/floor and is applied during layout, rather than afterward. - Fixed blurry NinePatch rendering when using a single center region. - API Change: Upon changing the window size with the lwjgl3 backend, the window is centered on the monitor. - Fixed DepthShaderProvider no longer creates one DepthShader per bones count. Now it creates only one skinned variant and one non-skinned variant based on DepthShader/Config numBones. - API Addition: Added Intersector#intersectPlanes to calculate the point intersected by three planes, see https://github.com/libgdx/libgdx/pull/6217 - API Addition: Added alternative Android Audio implementation for performant sound. See https://github.com/libgdx/libgdx/pull/6243. - API Addition: Expose SpriteBatch and PolygonSpriteBatch setupMatrices() as protected. - API Addition: New parameter OnscreenKeyboardType for Input.setOnscreenKeyboardVisible and Input.getTextInput [1.9.11] - Update to MobiVM 2.3.8 - Update to LWJGL 3.2.3 - Fixed AndroidInput crashes due to missing array resize (pressure array). - API Change: Ray#set methods and Ray#mul(Matrix4) normalize direction vector. Use public field to set and avoid nor() - API Change: New internal implementation of all Map and Set classes (except ArrayMap) to avoid OutOfMemoryErrors when too many keys collide. This also helps resistance against malicious users who can choose problematic names. - API Addition: OrderedMap#alter(Object,Object) and OrderedMap#alterIndex(int,Object) allow swapping out a key in-place without changing its value; OrderedSet also has this. - API Addition: Json can now read/write: ObjectIntMap, ObjectFloatMap, IntMap, LongMap. - API Addition: Added @Null annotation for IDE null analysis. All parameters and return values should be considered non-null unless annotated (or javadoc'ed if not yet annotated). - API Addition: Added ParticleEmitter#preAllocateParticles() and ParticleEffect#preAllocateParticles() to avoid particle allocations during updates. - Fixed changing looping state of already playing sounds on Android by first pausing the sound before setting the looping state (see #5822). - API Change: scene2d: Table#getRow now returns -1 when over the table but not over a row (used to return the last row). - API Change: scene2d: Tree#addToTree and #removeFromTree now have an "int actorIndex" parameter. - API Addition: scene2d: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: scene2d: In TextField, only revert the text if the change event was cancelled. This allows the text to be manipulated in the change listener. - API Change: scene2d: Tree.Node#removeAll renamed to clearChildren. - API Addition: scene2d: Added SelectBox#setSelectedPrefWidth to make the pref width based on the selected item and SelectBoxStyle#overFontColor. - API Change: DefaultTextureBinder WEIGHTED strategy replaced by LRU strategy. - API Change: ShaderProgram begin and end methods are deprecated in favor to bind method. - API Addition: Added a OpenALAudio#getSourceId(long) method. - API Addition: Added a ShaderProgram#getHandle() method. - API Change: Replaced deprecated android support libraries with androidx. AndroidFragmentApplication is only affected. - API Addition: Created interfaces AndroidAudio and AndroidInput and added AndroidApplication#createAudio and AndroidApplication#createInput to allow initializing custom module implementations. - Allows up to 64k (65536) vertices in a Mesh instead of 32k before. Indices can use unsigned short range, so index above 32767 should be converted to int using bitwise mask, eg. int unsigneShortIndex = (shortIndex & 0xFFFF). - API Change: DragAndDrop only removes actors that were not already in the stage. This is to better support using a source actor as the drag actor, see #5675 and #5403. - API Change: Changed TiledMapTileLayer#tileWidth & #tileHeight from float to int - API Addition: convenient Matrix4 rotate methods: rotateTowardDirection and rotateTowardTarget - API Addition: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: Correction of TextField#ENTER_ANDROID renamed to NEWLINE and TextField#ENTER_DESKTOP renamed to CARRIAGE_RETURN. - API Change: Changed the visibility of TextField#BULLET, TextField#DELETE, TextField#TAB and TextField#BACKSPACE to protected. - API Addition: TextField and TextArea are providing the protected method TextField#checkFocusTraverse(char) to handle the focus traversal. - API Addition: UIUtils provides the constants UIUtils#isAndroid and UIUtils#isIos now. - Fixed: The behaving of TextFields and TextAreas new line and focus traversal works like intended on all platforms now. - API Change: Changed Base64Coder#encodeString() to use UTF-8 instead of the platform default encoding. See #6061 - Fixed: SphereShapeBuilder poles are now merged which removes lighting artifacts, see #6068 for more information. - API Change: Matrix3#setToRotation(Vector3, float float) now rotates counter-clockwise about the axis provided. This also changes Matrix3:setToRotation(Vector3, float) and the 3d particles will rotate counter-clockwise as well. - API Change: TexturePacker uses a dash when naming atlas page image files if the name ends with a digit or a digit + 'x'. - API Addition: Added Skin#setScale to control the size of drawables from the skin. This enables scaling a UI and using different sized images to match, without affecting layout. - API Change: Moved adding touch focus from Actor#notify to InputListener#handle (see #6082). Code that overrides InputListener#handle or otherwise handles InputEvent.Type.touchDown events must now call Stage#addTouchFocus to get touchDragged and touchUp events. - API Addition: Added AsynchronousAssetLoader#unloadAsync to fix memory leaks when an asset is unloaded during loading. - Fixed Label text wrapping when it shouldn't (#6098). - Fixed ShapeRenderer not being able to render alpha 0xff (was max 0xfe). - API Change: glGetActiveUniform and glGetActiveAttrib parameter changed from Buffer to IntBuffer. [1.9.10] - API Addition: Allow target display for maximization LWJGL3 backend - API Addition: Accelerometer support on GWT - API Change: Set default behaviour of iOS audio to allow use of iPod - API Change: IOSDevice is no longer an enum to allow users to add their own new devices when LibGDX is not up to date - API Addition: Add statusBarVisible configuration to IOSApplicationConfiguration - Update GWT Backend to GWT 2.8.2 - Update Android backend to build against API 28 (Android 9.0) - API Addition: Input.isButtonJustPressed - Update to LWJGL 2 backend to 2.9.3 - Update to MobiVM 2.3.6 release - Update to LWJGL 3.2.1 - API Addition: Input allows getting the maximum number of pointers supported by the backend - API Addition: Configuration option added to allow setting a max number of threads to use for net requests - API Change: NetJavaImpl now uses a cached thread pool to allow concurrent requests (by default, the thread pool is unbounded - use maxNetThreads in backend configurations to set a limit - set to 1 for previous behavior) - API Addition: New MathUtils norm and map methods - API Change: Pixmap blending was incorrect. Generated fonts may change for the better, but may require adjusting font settings. - API Change: Particle effects obtained from a ParticleEffectPool are now automatically started - Removed OSX 32-bit support - API Change: By default LWJGL2 backend no longer does pause/resume when becoming background/foreground window. New app config setting was added to enable the old behavior. - API Change: By default LWJGL2 backend now does pause/resume when window is minimized/restored. New app config setting was added to disable this behavior. - LWJGL3: Fixed window creation ignoring refresh rate of fullscreen mode. - TmxMapLoader and AtlasTmxMapLoader refactoring: Shared functionality was moved to BaseTmxMapLoader, duplicate code was removed. - AtlasTmxMapLoader supports group layers now (a positive side effect of the BaseTmxMapLoader refactoring). - API Change: TmxMapLoader and AtlasTmxMapLoader: load/loadAsync methods work exactly as before, but many methods of these classes had to change. This makes it possible implement new Tiled features. - API Addition: TextField#drawMessageText. - Fixed TextField rendering text outside the widget at small sizes. - API Addition: Group#getChild(int) - API Addition: notEmpty() for collections. - API Change: scene2d.ui Tree methods renamed for node set/getObject to set/getValue. - API Change: scene2d.ui Tree and Tree.Node require generics for the type of node, values, and actors. - API Change: For Selection in scene2d.utils "toggle" is now respected when !required and selected.size == 1. - API Addition: new InstanceBufferObject and InstanceBufferObjectSubData classes to enable instanced rendering. - API Addition: Support for InstancedRendering via Mesh - API Change: Cell#setLayout renamed to setTable. - API Addition: Added Collections#allocateIterators. When true, iterators are allocated. When false (default), iterators cannot be used nested. - API Addition: Added Group#removeActorAt(int,boolean) to avoid looking up the actor index. Subclasses intending to take action when an actor is removed may need to override this new method. - API Change: If Group#addActorAfter is called with an afterActor not in the group, the actor is added as the last child (not the first). [1.9.9] - API Addition: Add support for stripping whitespace in PixmapPacker - API Addition: Add support for 9 patch packing in PixmapPacker - API Addition: Pressure support for ios/android. https://github.com/libgdx/libgdx/pull/5270 - Update to Lwjgl 3.2.0 - Update android level we build against to 7.1 (API 25) - API Change: gdx-tools no longer bundles dependencies to be compatible with java 9 - Skin JSON files can now use the simple names of classes, i.e. "BitmapFont" rather than "com.badlogic.gdx.graphics.g2d.BitmapFont". Custom classes can be added by overriding Skin.getJsonLoader() and calling json.setClassTag(). - Skin supports cascading styles in JSON. Use the "parent" property to tag another style by name to use its values as defaults. See https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests-android/assets/data/uiskin.json for example. - SkinLoader can be used on subclasses of Skin by overriding generateSkin(). - API addition: Tree indentation can be customized. - Fixed GlyphLayout not respecting BitmapFontData#down. - API Addition: Added faceIndex paramter to #FreeTypeFontGenerator(FileHandle, int). - API Change: BitmapFont#getSpaceWidth changed to BitmapFont#getSpaceXadvance. - Many GlyphLayout fixes. - API Addition: Added FileHandle#map(), can be used to memory map a file - API Change: BitmapFontData#getGlyphs changed for better glyph layout. See https://github.com/libgdx/libgdx/commit/9a7dfdff3c6374a5ebd2f33a819982aceb287dfa - API Change: Actor#hit is now responsible for returning null if invisible. #5264 - API Addition: Added [Collection]#isEmpty() method to all 22 custom LibGDX-collections (e.g. Array, ObjectMap, ObjectSet, Queue, ...) - API Addition: StringBuilder#clear() - API Addition: Color#WHITE_FLOAT_BITS - Table layout fixed when expand is used and the layout width is less than the table's min width. - InputMultiplexer#setProcessors(Array) now copies the items instead of using the specified array instance. - API Change: A wrapped HorizontalGroup or VerticalGroup will now size children down to their min size if the group is smaller than their pref size. - LWJGL3: useVSync() is now a per-window setting. Any additional windows should disable vsync to avoid frames dropping to (refresh rate / # of windows). - Batch and sprite implementations and SpriteCache store Color separately from the float packed color, since converting to/from float is lossy. - API Change: NumberUtils floatToIntColor expands the alpha from 0-254 to 0-255, so 255 doesn't become 254 from conversion from int to float to int. - API Change: Batch and Decal setColor(float) renamed to setPackedColor for differentiation, since the conversion from float to Color is lossy. - API Change: PolygonSprite getVertexColor renamed to getPackedColor to match other classes. - API Change: FreeTypeFontGenerator only generates a missing glyph if \0 is in the characters. - API Change: DragScrollListener no longer requires the touch/mouse cursor to be directly above/below the scroll pane. - API Change: List#toString(Object) changed from protected to public. Subclasses overriding this need to change to public. - API Change: List now handles more key presses. - API Change: TexturePacker ImageProcessor#addImage(File, String) now returns the Rect. [1.9.8] - Add iPhoneX images - Fix MacOS issue with GL_ARB_texture_float extension check - Fix AtlasTmxMapLoader tileset tile id offset - Bullet: updated to 2.87, see: http://bulletphysics.org/wordpress/?p=485 - API Addition: Possibility to specify TexturePacker settings for resampling when scaling. - API Addition: Support for customizing render buffer attachments in GLFrameBuffers - API Change: Revert to constructors for GLFrameBuffers for easier customization [1.9.7] - Update to MobiVM(RoboVM) 2.3.3 - Add iOS 11 support - Update to Lwjgl 3.1.3 - Update to MOE 1.4.0 - API Change: GLFrameBuffer has been refactored https://github.com/libgdx/libgdx/pull/4882. Create standard FrameBuffers with static methods. Customized FBOS with FrameBufferBuilder - API addition: Tiled group layer support - Fix Tiled properties, offset parsing for image layers - API addition: Added utility methods for Vector equals with epsilon - Fix Animation backing array type - Fix Mesh copying with 0 indices - Fix restoration of pooled particle effects scale - Fix loss of controller listeners on reconnect - Added basic kotlin project generation support in the setup tool - API addition: Allow APK expansion to be used in fragments and activities - API addition: Added color properties support from tiled maps - API Change: Added rotation vector sensor support on Android - API Change: GLProfiler refactored for OOP and lwjgl3 multi windows - LWJGL3: The creation of additional windows via Lwjgl3Application.newWindow() is now deferred, with postRunnable(), until all existing windows have been updated. This fixes a potential native crash with NVidia GL drivers on Windows, presumably caused by a GL context conflict. - API addition: Lwjgl3WindowListener.created() is called after a new window has been created. It's unsafe to call Lwjgl3Window functions in between Lwjgl3Application.newWindow() and this callback. - Updated LWJGL3 backend to 3.1.3. - Lwjgl3Graphics.setUndecorated() and Lwjgl3Graphics.setResizable() now delegate their work to the respective GLFW functions. - API addition: ProgressBar.isVertical() - returns whether a progress bar is vertical or horizontal. - API Change: SplitPane now by default does not allow the split amount to shrink children below their minimum sizes (cropping them). This behavior can be reverted by overriding clampSplitAmount or wrapping the children in Containers set to minSize(0) and fill(). SplitPane also now correctly includes the handle min size in its own min size calculations. - API Change: SplitPane.getSplit() renamed to SplitPane.getSplitAmount() to match other getter and setter names. - Improved internal Timer synchronization. - API Change: List#drawItem, added float width parameter. - API Addition: Make it possible to disable sound on the GWT-Backend with disableSound=true. - API Change: ScrollPane setWidget deprecated in favor of setActor to match other APIs. - API Change: removed JGLFW backend - Fixed mixed up use of TexturePacker.Settings.stripWhitespaceX|Y. - Added joystick POV support to LWJGL3 controller backend. - Added support for 2d particles sprite animation. - API Change: ParticleEmitter getSprite, setSprite, getImagePath, setImagePath are now getSprites, setSprites, getImagePaths, setImagePaths. - Added support for 2d particles independant scale X and Y. - API Change: ParticleEmitter getScale, matchSize are now getScaleX/getScaleY, matchSizeX/matchSizeY. Added scaleSize(float scaleX, float scaleY) - API Change: Added iconDropped() callback to AndroidWallpaperListener. [1.9.6] - Fix performance regression in LWJGL3 backend, use java.nio instead of BufferUtils. Those are intrinsics and quite a bit faster than BufferUtils on HotSpot. - Updated to latest Sound Manager 2 - Added mappings for Xbox 360 controller for Linux - Separated error log for vertex/fragment shaders for easier debugging - Minimum Android API level is now level 9 (Android 2.3) - API addition: Configurable TexturePacker bleed iterations - Updated IOS Multi-OS Engine backend to 1.3.6 - API Change: Pixmap.setBlending, Pixmap.setFilter are now instance methods - VertexAttribute expert constructors exposed. Short types can now be used for attributes. [1.9.5] - Fix NPE swallowing "video driver unsupported" error on LWJGL 2 backend. - Allow window icons to be set in Lwjgl3ApplicationConfiguration or Lwjgl3WindowConfiguration. - Allow window icon and title to be changed in Lwjgl3Window - API Addition: ApplicationLogger interface, allowing easier access to custom logging - DefaultRenderableSorter accounts for center of Renderable mesh, see https://github.com/libgdx/libgdx/pull/4319 - Bullet: added FilterableVehicleRaycaster, see https://github.com/libgdx/libgdx/pull/4361 - Bullet: updated to 2.85, see: http://bulletphysics.org/wordpress/?p=456 - Updated iOS native build scripts to iOS 10.1 and TVOS 10.0 - API Addition: BitmapFont#blankLineScale. - Fixed rounding of Drawables in ProgressBar. Allow rounding to be disabled with setRound(). - Updated LWJGL3 backend to LWJGL 3.1.0, see https://blog.lwjgl.org/lwjgl-3-1-0-released/ - LWJGL3 backend now supports non-continuous rendering, see https://github.com/libgdx/libgdx/pull/3772 - API Change: Lwjgl3WindowListener.refreshRequested() is called when the windowing system (GLFW) reports contents of a window are dirty and need to be redrawn. - API Change: Lwjgl3WindowListener.maximized() is called when a window enters or exits a maximized state. - API Change: Lwjgl3WindowListener.deiconified() removed, combined with .iconified(). - API Change: Lwjgl3Window.deiconify() renamed to .restore() since it can also be used to de-maximize a window. - Lwjgl3Window now has a maximize() method, and windows can be started maximized using the window or app configuration's setMaximized() method. - NinePatch can now be drawn rotated or scaled. - NinepatchDrawable is now a TransformDrawable. - API Change: Group add* methods no longer remove and re-add the actor if it is already in the group, instead they do nothing. - API Change: g2d.Animation is now generic so it can support Drawables, PolygonRegions, NinePatches, etc. To fix existing code, specify the TextureRegion type in animation declarations (and instantiations in Java 6), i.e. Animation<TextureRegion> myAnimation = new Animation<TextureRegion>(...); - TiledDrawable throws unsupported operation if trying to draw rotated/scaled. #4005 - API Change: DragAndDrop now puts default position of drag actor at pointer location. The original default offset from the pointer was (14, -20). - Added ShaderProgramLoader for AssetManager. - BoundingBox#isValid now returns also true when min==max, see: https://github.com/libgdx/libgdx/pull/4460 [1.9.4] - Moved snapping from ProgressBar to Slider to prevent snapping when setting the value programmatically. - Bullet: added btSoftBody#getLinkCount() and btSoftBody#getLink(int), see https://github.com/libgdx/libgdx/issues/4152 - API Change: Wrapping for scene2d's HorizontalGroup and VerticalGroup. - Fix hiero problem with certain unicode characters. See https://github.com/libgdx/libgdx/issues/4202 - Switched to RoboVM fork 2.2.0, fixes incompatibility with Android Gradle plugin and iOS 9.3.4 [1.9.3] - Switched to MobiDevelop's RoboVM fork (http://robovm.mobidevelop.com) - Addition of Intel Multi-OS Engine backend for deploying to iOS - Updated iOS native build scripts to iOS 9.3 and TVOS 9.2 - API Addition: GestureDetector#pinchStop() called when no longer pinching - API Addition: Gdx.graphics.setUndecorated/setResizable API added to Graphics https://github.com/libgdx/libgdx/pull/3847 - API Addition: Gdx.graphics.getGLVersion(), grab the GL version and implementation type. https://github.com/libgdx/libgdx/pull/3788 - API Change: Lwjgl3WindowListener -> filesDropped(String[] files) adds drag'n drop support for the lwjgl3 backend - Added isComplete() to ParticleEffect to make it easier to know when all the emitters are done, behaves the same as in the 2D API. - API Change: renamed Lwjgl3WindowListener.windowIsClosing() to closeRequested() to better communicate its intent. - Add IndexData.updateIndices method to increase performance when used with IndexBufferObjectSubData. - Added FlushablePool - Added ShapeCache see https://github.com/libgdx/libgdx/pull/3953 - API Change: moved shape builder logic out of MeshBuilder, see: https://github.com/libgdx/libgdx/pull/3996 - API Change: changed copy constructor OrderedMap(ObjectMap) to OrderedMap(OrderedMap) - API Change: Table reset now calls clearChildren, not clear. - Fixed crashes in AndroidMusic.java when isPlaying is called. Errors are now logged only rather than crashing the app. - Added emulation of ScreenUtils for GWT - Improved performance of glReadPixels() on GWT. New method is 20-30 times faster - Fixed crash on Mac when using LWJGL2, custom cursors and embedding the game in an AWT window - Fixed getDisplayModes(Monitor monitor) returning wrong data on LWJGL2 backend - Fixed Gdx.input.getCurrentEventTime() not being set on LWJGL3, fixes GestureDetector and flick scroll not working - Fixed not being able to select non-latin characters in TextFields - Bullet: added CustomActionInterface, see https://github.com/libgdx/libgdx/pull/4025 - Add window size limits option to LWJGL3 app and window configurations - Add handling of tag "<objectgroup>" within tags "<tile>" in TmxMap loaders. [1.9.2] - Added TextureArray wrapper see https://github.com/libgdx/libgdx/pull/3807 - Fixed bug in AndroidGL20.cpp which cast a pointer to a 32-bit int. Crash on 64-bit ARM, but only for a specific code path and address... - Fixed multiple controllers registering on same index with LWJGL3, see https://github.com/libgdx/libgdx/issues/3774 - Fixed the FreeTypeFontGenerator texture bleeding, see https://github.com/libgdx/libgdx/issues/3521 [1.9.1] - API Change: Override GwtApplication#createApplicationListener() to create your ApplicationListener on GWT, overriding GwtApplication#getApplicationListener() isn't needed anymore, see https://github.com/libgdx/libgdx/issues/3628 - Fixed ARM64 and x86_64 binaries for Android [1.9.0] - API Change: Lwjgl3ApplicationConfiguration#setBackbufferConfig -> setBackBufferConfig - Fixed HexagonalTiledMapRenderer, see https://github.com/libgdx/libgdx/pull/3654 - Added support for locking the screen orientation in GWT, see https://github.com/libgdx/libgdx/pull/3633 - Added Gdx-Kiwi and gdx-lml to extensions, see https://github.com/libgdx/libgdx/pull/3597 - Added Gyroscope support in Input, implemented for Android, see https://github.com/libgdx/libgdx/pull/3594 - Fixed touch mapping on iOS, see https://github.com/libgdx/libgdx/pull/3590 - Added orientation to Box2D Transform class, see https://github.com/libgdx/libgdx/pull/3308 - Added system cursors to GWT, fix 'Ibeam' system cursor not working on LWJGL3. - Added experimental AndroidApplicationConfiguration#useGL30 and IOSApplicationConfiguration#useGL30 for testing OpenGL ES 3.0 support on mobile devices, do not use in production. - Fix broken kerning for FreeType fonts, see https://github.com/libgdx/libgdx/pull/3756 - Added ARM64 and x86_64 binaries for Android - API Addition: FreeTypeFontParameter has an additional field for tweaking hinting, see https://github.com/libgdx/libgdx/pull/3757 [1.8.0] - API Change: Rewrote FreeType shadow rendering (much better). - Added spaceX/Y to FreeType fonts. - Higher quality FreeType font rendering. - Hiero updated to v5, now with FreeType support and other new features! - GlyphLayout now allocates much, much less memory when processing long text that wraps. - Added LWJGL 3 backend, see https://github.com/libgdx/libgdx/issues/3673 for more info. - Added Graphics#getBackBufferWidth and Graphics#getBackBufferHeight for HDPI handling - API Change: Added HdpiUtils. Instead of calling GL20#glViewport and GL20#glScissor yourself please use HdpiUtils instead. It will ensure that you handle HDPI monitors correctly when using those OpenGL functions. On HDPI monitors, the size reported by Gdx.graphics getWidth/getHeight is in logical coordinates as dictated by the operating system, usually half the HDPI resolution. The OpenGL drawing surface works in backbuffer coordinates at the full HDPI resolution. If you pass logical coordinates to glViewport and glScissor, you only affect a quarter of the real backbuffer size. Use HdpiUtils instead, it will do the right thing, while letting you continue to work in logical (aka returned by Gdx.graphics.getWidth/getHeight) coordinates. - API Change: Graphis#getDesktopDisplayMode() has been renamed to Graphics#getDisplayMode() and returns the current display mode of the monitor the window is shown on (primary monitor on all backends except LWJGL3, which supports real multi-monitor setups). - API Change: Graphics#getDisplayModes() return the display modes of the monitor the monitor the window is shown on (primary monitor on all backends except LWJGL3 which supports real multi-monitor setups). - API Change: Graphics#setDisplayMode(DisplayMode) has been renamed to Graphics#setFullscreenMode(). If the window is in windowed mode, it will be switched to fullscreen mode on the monitor from which the DisplayMode stems from. - API Change: Graphics#setDisplayMode(int, int, boolean) has been renamed to Graphics#setWindowedMode(int, int). This will NOT allow you to switch to fullscreen anymore, use Graphics#setFullscreenMode() instead. If the window is in fullscreen mode, it will be switched to windowed mode on the monitor the window was in fullscreen mode on. - API Addition: Graphics#Monitor, represents a monitor connected to the machine the app is running on. A monitor is defined by a name and it's position relative to other connected monitors. All backends except the LWJGL3 backend will report only the primary monitor - API Addition: Graphics#getPrimaryMonitor() returns the primary monitor you usually want to work with. - API Addition: Graphics#getMonitor() returns the monitor your app's window is shown on, which may not be the primary monitor in >= 2 monitor systems. All backends except the LWJGL3 backend will report only the primary monitor. - API Addition: Graphics#getMonitors() returns all monitors connected to the system. All backends except the LWJGL3 backend will only report the primary monitor. - API Addition: Graphics#getDisplayMode(Monitor) returns the display mode of the monitor the app's window is shown on. All backends except the LWJGL3 backend will report the primary monitor display mode instead of the actual monitor's display mode. Not a problem as all other backends run on systems with only a single monitor so far (primary monitor). - Added option to include credentials on cross-origin http requests (used only for GWT backend). - Added option to specify crossorigin attribute when loading images with AssetDownloader (GWT), see #3216. - API Change: removed Sound#setPriority, this was only implemented for the Android backend. However, Android itself never honored priority settings. - API Change: cursor API has been cleaned up. To create a custom cursor, call Graphics#newCursor(), to set the custom cursor call Graphics#setCursor(), to set a system cursor call Graphics#setSystemCursor(). The Cursor#setSystemCursor method has been removed as that was not the right place. Note that cursors only work on the LWJGL, LWJGL3 and GWT backends. Note that system cursors only fully work on LWJGL3 as the other two backends lack a means to set a specific system cursor. These backends fall back to displaying an arrow cursor when setting any system cursor. - API Addition: Added Lwjgl3WindowListener, allows you to hook into per-window iconficiation, focus and close events. Also allows you to prevent closing the window when a close event arrives. [1.7.2] - Added AndroidAudio#newMusic(FileDescriptor) to allow loading music from a file descriptor, see #2970 - Added GLOnlyTextureData, which is now the default for FrameBuffer and FrameBufferCubemap, see #3539 - Added rotationChanged() for Actor class, called when rotation changes, see https://github.com/libgdx/libgdx/pull/3563 - Fixed crash on MacOS when enumerating connected gamepads. - ParticleEmitter no longer says it's complete when it's set to continuous, see #3516 - Improved JSON parsing and object mapping error messages. - Updated FreeType from version 2.5.5 to 2.6.2. - Fixed corrupt FreeType rendering for some font sizes. - API Change: FreeTypeFontParameter has new fields for rendering borders and shadows. - FreeTypeFontParameter can render much better fonts at small sizes using gamma settings. - BitmapFont can now render missing (tofu) glyph for glyphs not in the font. - FreeTypeFontGenerator depreacted methods removed. - Fixed BitmapFont color tags changing glyph spacing versus not using color tags. BitmapFont#getGlyphs has a new paramter. See #3455. - Skin's TintedDrawable now works with TiledDrawable. #3627 - Updated jnigen to Java Parser 2.3.0 (http://javaparser.github.io/javaparser/). - FreeType fonts no longer look terrible at small size. This is a big deal! - Updated to RoboVM 1.12.0, includes tvOS support! [1.7.1] - Fixes AtlasTmxMapLoader region name loading to tileset name instead of filename - Changes TiledMapPacker output, region names are tileset names, adjusts gid, defaults to one atlas per map - API Change: members of Renderable and MeshPart are changed, see https://github.com/libgdx/libgdx/pull/3483 - Added Vector#setToRandomDirection(), see #3222 - Updated to stb_image v2.08 - Added Node#copy(), used when creating a ModelInstance from a Model to allow using custom nodes - Add ModelCache, see https://github.com/libgdx/libgdx/wiki/ModelCache - Updated bullet to v2.83.6 - Updated to RoboVM 1.9, for free life-time license read http://www.badlogicgames.com/wordpress/?p=3762 [1.7.0] - Gdx.input.setCursorImage removed, replaced with Gdx.graphics.setCursor and Gdx.graphics.newCursor see https://github.com/libgdx/libgdx/pull/2841/ - Fixed an issue with UTF8 decoding in GWT emulation of InputStreamReader - Updated to RoboVM 1.8 for iOS 9 support. [1.6.5] - Objects from animated tiles in TMX maps are now supported. - Made possible to use any actor for tooltips. - Improved cross-platform reflection api for annotations. - NinePatch#scale now also scales middle patch size. - GLFrameBuffer is now abstract, renamed setupTexture to createColorTexture, added disposeColorTexture - Added LwjglApplicationConfiguration#gles30Context*Version, see https://github.com/libgdx/libgdx/pull/2941 - Added OpenGL error checking to GLProfiler, see https://github.com/libgdx/libgdx/pull/2889 - Updated to RoboVM 1.6 [1.6.4] - TextField cursor and selection size changed. https://github.com/libgdx/libgdx/commit/2a830dea348948d2a37bd8f6338af2023fec9b09 - FreeTypeFontGenerator setting to improve shadows and borders. - ScrollPane scrolls smoothly when the scrolled area is much larger than the scrollbars. - TexturePacker sorts page regions by name. - GlyphLayout text wrapping changed to not trim whitespace. https://github.com/libgdx/libgdx/commit/ee42693da067da7c5ddd747f051c1423d262cb96 - Fixed BitmapFont computing space width incorrectly when padding is used and no space glyph is in the font. - Fixed TextArea cursor and selection drawing positions. - Fixed ActorGestureListener pan and zoom when the actor is rotated or scaled. - Fixed TextField for non-pixel display. - Allow ellipsis string to be set on Label. - AssetManager gets hook for handling loading failure. - TextField now fires a ChangeEvent when the text change. Can be cancelled too! - Added tooltips to scene2d.ui. - Updated to RoboVM 1.5 [1.6.3] - Updated to RoboVM 1.4 [1.6.2] - API Change: TiledMapImageLayer now uses floats instead of ints for positioning - API Change: Added GLFrameBuffer and FrameBufferCubemap: Framebuffer now extends GLFramebuffer, see #2933 [1.6.1] - Added optional hostname argument to Net.newServerSocket method to allow specific ip bindings for server applications made with gdx. - Changed the way iOS native libs are handled. Removed updateRoboVMXML and copyNatives task from ios/build.gradle. Instead natives are now packaged in jars, within the META-INF/robovm/ios folder. Additionally, a robovm.xml file is stored there that gets merged with the project's robovm.xml file by RoboVM. [1.6.0] - API Change: GlyphLayout xAdvances now have an additional entry at the beginning. This was required to implement tighter text bounds. #3034 - API Change: Label#getTextBounds changed to getGlyphLayout. This exposes all the runs, not just the width and height. - In the 2D ParticleEditor, all chart points can be dragged at once by holding ctrl. They can be dragged proportionally by holding ctrl-shift. - Added Merge button to the 2D ParticleEditor, for merging a loaded particle effect file with the currently open particle effect. - Added ability to retrieve method annotations to reflection api - Added PixmapPacker.updateTextureRegions() method. - Added ability to pack "anonymous" pixmaps into PixmapPacker, which will appear in the generated texture but not a generated or updated TextureAtlas - Added PixmapPacker.packDirectToTexture() methods. - API Change: PixmapPacker.generateTextureAtlas(...) now returns an atlas which can be updated with subsequent calls to PixmapPacker.updateTextureAtlas(...) - API Change: FreeTypeFontGenerator.generateFont(...) now works with a user-provided PixmapPacker. - Added DirectionalLightsAttribute, PointLightsAttribute and SpotLightsAttribute, removed Environment#directionalLights/pointLights/spotLights, added Environment#remove, lights are now just like any other attribute. See also https://github.com/libgdx/libgdx/wiki/Material-and-environment#lights - API Change: BitmapFont metrics now respect padding. #3074 - Update bullet wrapper to v2.83 - Added AnimatedTiledMapTile.getFrameTiles() method [1.5.6] - API Change: Refactored Window. https://github.com/libgdx/libgdx/commit/7d372b3c67d4fcfe4e82546b0ad6891d14d03242 - Added VertexBufferObjectWithVAO, see https://github.com/libgdx/libgdx/pull/2527 - API Change: Removed Mesh.create(...), use MeshBuilder instead - API Change: BitmapFontData, BitmapFont, and BitmapFontCache have been refactored. http://www.badlogicgames.com/wordpress/?p=3658 - FreeTypeFontGenerator can now render glyphs on the fly. - Attribute now implements Comparable, custom attributes might need to be updated, see: https://github.com/libgdx/libgdx/wiki/Material-and-environment#custom-attributes - API Change: Removed (previously deprecated) GLTexture#createTextureData/createGLHandle, Ray#getEndPoint(float), Color#tmp, Node#parent/children, VertexAttribute#Color(), Usage#Color, ModelBuilder#createFromMesh, BoundingBox#getCenter()/updateCorners()/getCorners(), Matrix4.tmp [1.5.5] - Added iOS ARM-64 bit support for Bullet physics - 3D Animation, NodeAnimation keyframes are separated into translation, rotation and scaling - Added capability to enable color markup from inside skin json file. - Exposed method ControllerManager#clearListeners on Controllers class - Net#openURI now returns a boolean to indicate whether the uri was actually opened. - DefaultShader now always combines material and environment attributes - Added ShapeRenderer constructor to pass a custom shader program to ImmediateModeRenderer20. - API Change: Group#toString now returns actor hierarchy. Group#print is gone. - Added SpotLight class, see https://github.com/libgdx/libgdx/pull/2907 - Added support for resolving file handles using classpaths (ClasspathFileHandleResolver) [1.5.4] - Added support for image layers in Tiled maps (TiledMapImageLayer) - Added support for loading texture objects from TMX Maps (TextureMapObject) - Added support for border and shadow with FreeTypeFontGenerator - see https://github.com/libgdx/libgdx/pull/2774 - Now unknown markup colors are silently ignored and considered as normal text. - Updated freetype from version 2.4.10 to 2.5.5 - Added 3rd party extensions to setup application, see - Updated to RoboVM 1.0.0-beta-04 - Updated to GWT 2.6.1, sadly GWT 2.7.0 isn't production ready yet. [1.5.3] - API Change: TextField#setRightAlign -> TextField#setAlignment - I18NBundle is now compatible with Android 2.2 - Fixed GWT reflection includes for 3D particles - 3D ParticleEffectLoader registered by default - Added HttpRequestBuilder, see https://github.com/libgdx/libgdx/pull/2698 - Added LwjglApplicationConfiguration.useHDPI for Mac OS X with retina displays. Allows you to get "real" pixel coordinates for mouse and display coordinates. - Updated RoboVM to 1.0.0-beta-03 [1.5.2] - Fixed issue #2433 with color markup and alpha animation. - Fixed natives loading for LWJGL on Mac OS X [1.5.1] - Gradle updated to 2.2 - Android Gradle tooling updated to 1.0.0 - API Change: Switched from Timer to AnimationScheduler for driving main loop on GWT. Removed fps field from GwtApplicationConfiguration to instead let the browser choose the most optimal rate. - API Change: Added pause and resume handling on GWT backend. When the browser supports the page visibility api, pause and resume will be called when the tab or window loses and gains visibility. - API Change: Added concept of target actor, separate from the actor the action is added to. This allows an action to be added to one actor but affect another. This is useful to create a sequence of actions that affect many different actors. Previously this would require adding actions to each actor and using delays to get them to play in the correct order. - Added 64-bit support for iOS sim and device - Deprecated Node#children and Node#parent, added inheritTransform flag and methods to add/get/remove children - API Change: By default keyframes are no longer copied from Model to ModelInstance but shared instead, can be changed using the `ModelInstance.defaultShareKeyframes` flag or `shareKeyframes` constructor argument. - JSON minimal format now makes commas optional: newline can be used in place of any comma. - JSON minimal format is now more lenient with unquoted strings: spaces and more are allowed. - API Change: Added support for KTX/ZKTX file format, https://github.com/libgdx/libgdx/pull/2431 - Update stb_image from v1.33 to v1.48, see https://github.com/libgdx/libgdx/pull/2668 - Bullet Wrapper: added Gimpact, see https://github.com/libgdx/libgdx/issues/2619 - API Addition: Added MeshPartBuilder#addMesh(...), can be used to more easily combine meshes/models - Update to LWJGL 2.9.2, fixes fullscreen mode on "retina" displays - Fixes to RoboVM backend which would crash if accelerometer is used. [1.5.0] - API Addition: IOSInput now uses CMCoreMotion for accelerometer and magnetometer - API Addition: Added getter for UITextField on IOS for keyboard customization - API Addition: Added ability to save PixmapPackers to atlas files. See PixmapPackerIO. - API Addition: Added HttpRequestHeader and HttpResponseHeader with constants for HTTP headers. - API Addition: HttpRequest is now poolable. - New PNG encoder that supports compression, more efficient vertical flipping, and minimal allocation when encoding multiple PNGs. - API Change: Label#setEllipse -> Label#setEllipsis. - API Change: BatchTiledMapRenderer *SpriteBatch fields and methods renamed to *Batch - API Change: ScrollPane#scrollToCenter -> ScrollPane#scrollTo; see optional boolean arguments centerHorizontal and centerVertical (scrollToCenter centered vertically only). - API Change: Changed Input#getTextInput to accept both text and hint, removed Input#getPlaceholderTextInput. - Bug Fix: Fixed potential NPE with immersive mode in the Android fragment backend. - iOS backend now supports sound ids, thanks Tomski! [1.4.1] - Update to the Gradle Integration plugin nightly build if you are on Eclipse 4.4.x! - Update Intellij IDEA to 13.1.5+, because Gradle! - Updated to Gradle 2.1 and Android build tools 20, default Android version to 20. You need to install the latest Android build tools via the SDK manager - API Change: deprecation of bounding box methods, see https://github.com/libgdx/libgdx/pull/2408 - Added non-continuous rendering to iOS backend, thanks Dominik! - Setup now uses Gradle 2.1 with default Android API level 20, build tools 20.0.0 - Non-continuous renderering implemented for iOS - Added color markup support for scene2d label and window title. - API Change: removed default constructor of DecalBatch, removed DefaultGroupStrategy - Updated to latests RoboVM release, 1.0.0-alpha-04, please update your RoboVM plugins/installations - Reduced I18NBundle loading times on Android and bypassed unclosed stream on iOS. - Removed the gdx-ai extension from the libGDX repository. Now it lives in its own repository under the libGDX umbrella, see https://github.com/libgdx/gdx-ai - API Addition: Added randomSign and randomTriangular methods to MathUtils. - API Addition: Decal has now a getter for the Color. - API Addition: now I18NBundle can be set so that no exception is thrown when the key can not be found. - API Addition: added annotation support in reflection layer, thanks code-disaster! https://github.com/libgdx/libgdx/pull/2215 - API Addition: shapes like Rect, Circle etc. now implement Shape2D interface so you can put them all into a single collection https://github.com/libgdx/libgdx/pull/2178 - API Addition: bitmap fonts can now be loaded from an atlas via AssetManager/BitmapFontLoader, see https://github.com/libgdx/libgdx/pull/2110 - API Change: updated to RoboVM 1.0.0-SNAPSHOT for now until the next alpha is released. - API Change: Table now uses padding from its background drawable by default. https://github.com/libgdx/libgdx/issues/2322 - Drawables now know their names, making debugging easier. - API Change: Table fill now respects the widget's minimum size. - Texture packer, fixed image size written to atlas file. - API Change: Cell no longer uses primitive wrappers in public API and boxing is minimized. - API Addition: TextureAttribute now supports uv transform (texture regions). - API Change: Added parameters to Elastic Interpolation. - API Change: Removed Actor#setCenterPosition, added setPosition(x,y,align). - API Change: JsonReader, forward slash added to characters an unquoted strings cannot start with. - API Change: Stage#cancelTouchFocus(EventListener,Actor) changed to cancelTouchFocusExcept. - API Change: Json/JsonWriter.setQuoteLongValues() quotes Long, BigDecimal and BigInteger types to prevent truncation in languages like JavaScript and PHP. [1.3.1] - API change: Viewport refactoring. https://github.com/libgdx/libgdx/pull/2220 - Fixed GWT issues [1.3.0] - Added Input.isKeyJustPressed. - API Addition: multiple recipients are now supported by MessageDispatcher, see https://github.com/libgdx/libgdx/wiki/Message-Handling#multiple-recipients - API Change: State#onMessage now takes the message receiver as argument. - API Addition: added StackStateMachine to the gdx-ai extension. - API change: ShapeRenderer: rect methods accept scale, more methods can work under both line and fill types, auto shape type changing. - API change: Built-in ShapeRenderer debugging for Stage, see https://github.com/libgdx/libgdx/pull/2011 - Files#getLocalStoragePath now returns the actual path instead of the empty string synonym on desktop (LWJGL and JGLFW). - Fixed and improved xorshift128+ PRNG implementation. - Added support for Tiled's animated tiles, and varying frame duration tile animations. - Fixed an issue with time granularity in MessageDispatcher. - Updated to Android API level 19 and build tools 19.1.0 which will require the latest Eclipse ADT 23.02, see http://stackoverflow.com/questions/24437564/update-eclipse-with-android-development-tools-23 for how things are broken this time... - Updated to RoboVM 0.0.14 and RoboVM Gradle plugin version 0.0.10 - API Addition: added FreeTypeFontLoader so you can transparently load BitmapFonts generated through gdx-freetype via AssetManager, see https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/FreeTypeFontLoaderTest.java - Preferences put methods now return "this" for chaining - Fixed issue 2048 where MessageDispatcher was dispatching delayed messages immediately. - API Addition: 3d particle system and accompanying editor, contributed by lordjone, see https://github.com/libgdx/libgdx/pull/2005 - API Addition: extended shape classes like Circle, Ellipse etc. with hashcode/equals and other helper methods, see https://github.com/libgdx/libgdx/pull/2018 - minor API change (will not increase minor revision number): fixed a bug in handling of atlasPrefixes, https://github.com/libgdx/libgdx/pull/2023 - Bullet: btManifoldPoint member getters/setters changed from btVector3 to Vector3, also it is no longer pooled, instead static instances are used for callback methods - Added Intersector#intersectRayRay to detect if two 2D rays intersect, see https://github.com/libgdx/libgdx/pull/2132 - Bullet: ClosestRayResultCallback, AllHitsRayResultCallback, LocalConvexResult, ClosestConvexResultCallback and subclasses now use getter/setters taking a Vector3 instead of btVector3, see https://github.com/libgdx/libgdx/pull/2176 - 2d particle system supports pre-multiplied alpha. - Bullet: btIDebugDrawer/DebugDrawer now use pooled Vector3 instances instead of btVector3, see https://github.com/libgdx/libgdx/issues/2174 [1.2.0] - API Addition: Some OpenGL profiling utilities have been added, see https://github.com/libgdx/libgdx/wiki/Profiling - API Addition: A FreeTypeFontGeneratorLoader has been added to the gdx-freetype extension - API change: Animation#frameDuration and #animationDuration are now hidden behind a getter/setter and dynamic - API Addition: Vector#setZero - API Addition: gdx-ai, extension for AI algorithms. Currently supports FSMs, see https://github.com/libgdx/libgdx/wiki/Artificial-Intelligence - API change: TableLayout has been forked and integrated into libgdx more tightly, see http://www.badlogicgames.com/wordpress/?p=3458 - API Addition: added equals/hashCode methods to Rectangle, may break old code (very, very unlikely) - API Addition: scene2D Actors now have a setCenterPosition method, see https://github.com/libgdx/libgdx/pull/2000 [1.1.0] - Updated to RoboVM 0.0.13 and RoboVM Gradle plugin 0.0.9 - Big improvements to setup-ui and build times in Intellij IDEA https://github.com/libgdx/libgdx/pull/1865 - Setup now uses android build tools version: 19.1.0 - BitmapFontCache now supports in-string colored text through a simple markup language, see https://github.com/libgdx/libgdx/wiki/Color-Markup-Language - Added i18n localization/internationalization support, thanks davebaol, see https://github.com/libgdx/libgdx/wiki/Internationalization-and-Localization - Possibility to override density on desktop to simulate mobile devices, see https://github.com/libgdx/libgdx/pull/1825 - Progressive JPEG support through JPGD (https://code.google.com/p/jpeg-compressor/). - Mavenized JGLFW backend - Box2D: Added MotorJoint and ghost vertices on EdgeShape - Updated GWT Box2D to latest version - Updated native Box2D to latest version 2.3.1, no API changes - API change: Matrix4.set(x,y,z, translation) changed, z axis is no more flipped - API addition: Matrix4.avg(Matrix4[],float[]) that lets weighted averaging multiple matrices, Quaternion.slerp(Quaternion[],float[]) that lets weighted slerping multiple Quaternions - fixed the long standing issue of the alpha=1 not actually being fully opaque, thanks kalle! https://github.com/libgdx/libgdx/issues/1815 - down to 25 issues on the tracker, 8 bugs, 17 enhancement requests :) [1.0.1] - updated to RoboVM 0.12 (and so should you!) - fixed GC issues on iOS with regards to touch (thanks Niklas!), see https://github.com/libgdx/libgdx/pull/1758 - updated gwt gradle plugin to 0.4, android build tools to 0.10, gradle version to 1.11 - Tiled maps are now always y-up - Tiled maps now support drawing offsets for tiles - FileHandle#list is now supported in GWT! - FileHandle#list now supports FileFilters - Controllers now reinitialize on the desktop when switching between windowed/fullscreen - added a Texture unpacker that will extract all images from a texture atlas, see https://github.com/libgdx/libgdx/pull/1774 - updates to gdx-setup - CustomCollisionDispatcher in bullet, see https://github.com/libgdx/libgdx/commit/916fc85cecf433c3461b458e00f8afc516ad21e3 [1.0.0] - Box2D is no longer in the core, it has been moved to an extension. See http://www.badlogicgames.com/wordpress/?p=3404 - Merged gdx-openal project into gdx-backend-lwjgl - Now LoadedCallback in AssetLoaderParameters is always called after loading an asset from AssetManager, even if the asset is already loaded - Added Payload as a new parameter to Source.dragStop, see https://github.com/libgdx/libgdx/pull/1666 - You can now load PolygonRegions via AssetLoader, see https://github.com/libgdx/libgdx/pull/1602 - implemented software keyboard support in RoboVM iOS backend - Fixed an issue where key event timestamp is not set by the android backend. - scene2d.ui, added to TextArea the preferred number of rows used to calculate the preferred height. - scene2d.actions, fixed infinite recursion for event listener's handle(event). - Various Quaternion changes. - scene2d.ui, fixed a drawing issue with knobBefore when there's no knob (typical progress bar). - Various MeshBuilder fixes and additions. - Math package: added cumulative distribution. - Fixed Music isPlaying() on iOS when is paused. - Added support for C-style comments to JsonReader (mainly used for json skin files). - Support for resource removal from Skin objects. - Added fling gesture to generate fling in scrollpane. - Vector classes now have mulAdd method for adding pre-multiplied values - Vector implementations no longer use squared value for margin comparisons, see: isZero(float margin), isUnit(float margin). - Vector2 now has isUnit and isZero methods (copied from Vector3) - Removed deprecated methods from Vector classes. - Added new headless backend for server applications - Support 'scaledSize' as a json skin data value for BitmapFont - Added setAlpha(float a) method to Sprite class - Added Input.Keys.toString(int keycode) and Input.Keys.valueOf(String keyname) methods - Added Immersive Mode support to Android backend - Added userObject to Actor in scene2d, allowing for custom data storage - Altered Android's hide status bar behavior - Changed the way wakelocks are implemented. You no longer need any special permissions for the libgdx wakelock - BitmapFontCache setColor changes to match SpriteBatch and friends. http://www.badlogicgames.com/forum/viewtopic.php?f=23&t=12112 - Changed ParticleEffect: the ParticleEffect.save method now takes a Writer instead of a File - TexturePacker2 renamed to TexturePacker, added grid and scaling settings. - Added support for custom prefrences on the desktop backends. - Fixed double resume calls on iOS. - Android Music no longer throws exceptions if MediaPlayer is null. - PolygonSpriteBatch implements Batch. - New scene2d actions: EventAction, CountdownEventAction. - Adds cancelHttpRequest() method to Net interface - Updated GWT/HTML5 Backend to GWT 2.6.0 - Minimal Android version is 2.2, see http://www.badlogicgames.com/wordpress/?p=3297 - Updated to LWJGL 2.9.1 - Can now embed your libgdx app as a fragment, more info on the wiki - scene2d.ui, renamed Actor methods translate, rotate, scale, size to moveBy, rotateBy, scaleBy, sizeBy. May have conflicts with Actions static import, eg you'll need to use "Actions.moveBy" - scene2d.ui, Table background is now drawn usign the table's transform - scene2d.ui, added Container which is similar to a Table with one cell, but more lightweight - Added texture filters and mip map generation to BitMapFontLoader and FreeTypeFontGenerator - scene2d.ui, VerticalGroup and HorizontalGroup got pad, fill and an API similar to Table/Container - Removed OpenGL ES 1.0, 1.1 support; see http://www.badlogicgames.com/wordpress/?p=3311 - Added OpenGL ES 3 support - Updated Android backend, demos, tests to 4.4 - Added Viewport, changed Stage to have a Viewport instead of a Camera (API change, see http://www.badlogicgames.com/wordpress/?p=3322 ). - Changed play mode constants of Animation class to enumeration, see http://www.badlogicgames.com/wordpress/?p=3330 - Updated to RoboVM 0.0.11 and RoboVM Gradle plugin 0.0.6, see http://www.badlogicgames.com/wordpress/?p=3351 - Updated to Swig 3.0 for Bullet, disabled SIMD on Mac OS X as alignements are broken in Bullet, see https://github.com/libgdx/libgdx/pull/1595 - TextureData can only be Custom or Pixmap; compressed image files are considered custom [0.9.9] - added setCursorImage method to Input interface to support custom mouse cursors on the desktop - removed Xamarin backend, see http://www.badlogicgames.com/wordpress/?p=3213 - added Select class for selecting kth ordered statistic from arrays (see Array.selectRanked() method) - refactored Box2D to use badlogic Arrays instead of java.util.ArrayLists - MipMapGenerator methods now don't take disposePixmap argument anymore - added GLTexture, base class for all textures, encapsulates target (2d, cubemap, ...) - added CubeMap, 6 sided texture - changed TextureData#consumeCompressedData, takes target now - added RoboVM backend jar and native libs (libObjectAL, libgdx, in ios/ folder of distribution) - added RoboVM backend to build - changed Bullet wrapper API, see http://www.badlogicgames.com/wordpress/?p=3150 - changed MusicLoader and SoundLoader to be asynchronous loaders - changed behaviour of Net#sendHttpRequest() so HttpResponseListener#handleHttpResponse() callback is executed in worker thread instead of main thread - added Bresenham2, for drawing lines on an integer 2D grid - added GridPoint2 and GridPoint3, representing integer points in a 2D or 3D grid - added attribute location caching for VertexData/Mesh. Hand vertex attribs to a ShaderProgram, get back int[], pass that to Mesh - added Android x86 builds, removed libandroidgl20.so, it's now build as part of gdx-core for Android - changed method signature on Box2D World#getBodies and World#getJoints, pass in an Array to fill - removed glGetShaderSource from GL20, use ShaderProgram#getVertexShaderSource/getFragmentShaderSource instead - added reflection api - added AsynchExecutor, execute tasks asynchronously. Used for GWT mainly. - removed FileHandle#file(), has no business in there. - removed box2deditor - removed custom typedarrays in gwt backend - added classpath files support for gwt backend (limited) - moved AndroidWallpaperListener to Android Backend - added new VertexAttribute Usage flags, bone weight, tangent, binormal. previously encoded as Usage.Generic. Also added field "unit" to VertexAttribute, used by texture coordinates and bone weights to specify index/unit. - setup-ui template for iOS disables pngcrush, also updated wiki iOS article - add Pixmap#fillTriangle via jni gdx2d_fill_triangle() to fill a triangle based on its vertices. - add asynchronous download with continuous progress feedback to GWT asset preloader, see https://github.com/libgdx/libgdx/pull/409?w=1 - add capability to add/exclude package/classes GWT Reflection system, see https://github.com/libgdx/libgdx/pull/409?w=1 - add updated gdx-tiled-preprocessor, generate one single TextureAtlas for all the specified Tiled maps, see http://www.badlogicgames.com/forum/viewtopic.php?f=17&t=8911 - maps API, add new AtlasTiledMapLoader for loading maps produced by the tiled preprocessor tool - ImageProcessor, TexturePacker2 now accepts BufferedImage objects as input - TexturePacker2 now avoids duplicated aliases - Updated to LWJGL 2.9.0 - refactored JSON API, see http://www.badlogicgames.com/wordpress/?p=2993 - Updated Box2D to the latest trunk. Body#applyXXX methods now take an additional boolean parameter. - TmxMapLoader has a flag in Parameters that lets you specify whether to generate mipmaps - Animation#isAnimationFinished was fixed to behave as per javadocs (ignores looping) - remove GLU interface and implementations. Use Matrix4 et al instead. see http://www.badlogicgames.com/wordpress/?p=2886 - new maps API, see http://www.badlogicgames.com/wordpress/?p=2870 - removed static public tmp Vector2 instances, manage such temporary vars yourself, see http://www.badlogicgames.com/wordpress/?p=2840 - changed Scene2D Group#clear(), see http://www.badlogicgames.com/wordpress/?p=2837 - changed the build system, natives are now fetched from the build server, see http://www.badlogicgames.com/wordpress/?p=2821 - freetype extension supported on iOS, see http://www.badlogicgames.com/wordpress/?p=2819 - changed ShapeRenderer API, see http://www.badlogicgames.com/wordpress/?p=2809 - changed Actions.add to addAction, changed parameter order, and added removeAction, addListener, removeListener - Box2d joints now allow for user data - Changes to Intersector, Circle, Rectangle and BoundingBox for consistency in #overlap, #intersect and #contains methods, see https://github.com/libgdx/libgdx/pull/312 - Removed LwjglApplicationConfiguration CPU sync. Added foreground and background target framerate. - scene2d, no longer use getters/setters internally for Actor x, y, width, height, scalex, scaley and rotation. - Array, detect nested iterator usage and throw exception. - Added getVolume to Music class and Android, IOS and GWT backends - 1381, fixed JSON parsing of longs. In addition to Float, it now parses Long if no decimal point is found. - Changed Array constructors that took an array to have offset and count - scene2d, Actor parentToLocalCoordinates and localToParentCoordinates refactoring, see http://www.badlogicgames.com/forum/viewtopic.php?p=40441#p40441 - scene2d, Action#setActor no longer calls reset if the Action has no pool. This allows non-pooled actions to be add and removed from actors, restarted, and reused. - ScrollBar#setForceOverscroll renamed to setForceScroll, as it affects more than just overscroll. - ArrayMap#addAll renamed to putAll to match the other maps. - Added ObjectSet and IntSet. - Added completion listener to Music. - Added Music#setPan. - Sound#play and Sound#loop on Android now return -1 on failure, to match other backends. - DelegateAction subclasses need to implement delegate() instead of act(). http://www.badlogicgames.com/forum/viewtopic.php?p=43576#p43576 - Added pause and resume methods to Sound. - Changed AssetErrorListener#error to have AssetDescriptor to enable access to parameters of failed asset. - Changed SelectBoxStyle to have ScrollPaneStyle and ListStyle for fully customizing the drop down list. http://www.badlogicgames.com/wordpress/?p=3110 - AssetLoader now takes a FileHandle that is the resolved file name. The AssetLoader no longer has to resolve the file name, so we can prevent it from being resolved twice. - Rewrote EarClippingTriangulator to not allocate (no more Vector2s). - Added ParticleEffectLoader to make AssetManager load ParticleEffects - Added GeometryUtils, more Intersector functions, DelaunayTriangulator, ConvexHull. - Added getBoundingBox to ParticleEffect - EarClippingTriangulator changed to return triangle indices. - PolygonSpriteBatch and friends refactored to use triangle indices. - Added add(T, float), remove(int), remove(T) and clear() methods to BinaryHeap - Bitmap Font changes: - FreeTypeFontGenerator allows you to specify the PixmapPacker now, to create an atlas with many different fonts (see FreeTypePackTest) - BitmapFont, BitmapFontCache and FreeTypeFontGenerator now support fonts with multiple texture pages. (see BitmapFontTest and FreeTypePackTest) - BitmapFontData.imagePath and getImagePath() is depreacted, use imagePaths[] and getImagePath(int) instead - Added two BitmapFont constructors for convenience; no need to specify flip boolean - Added getCache() to BitmapFont, for expert users who wish to use the BitmapFontCache (see BitmapFontTest) - FreeTypeFontGenerator now includes setMaxTextureSize and getMaxTextureSize to cap the generated glyph atlas size (default 1024) - added render-hooks beginRender() and endRender() to BatchTiledMapRenderer - Added panStop to GestureListener interface. - ScissorStack#calculateScissors changed to take viewport, enabling it to work with glViewport. - Added Bits#getAndClear, Bits#getAndSet and Bits#containsAll - Added setX and setY to TextureAtlas.AtlasSprite so it matches expected behavior [0.9.8] - see http://www.badlogicgames.com/wordpress/?p=2791 [0.9.7] - see http://www.badlogicgames.com/wordpress/?p=2664 [0.9.6] - see http://www.badlogicgames.com/wordpress/?p=2513
1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java
package com.badlogic.gdx.maps.tiled; import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.assets.AssetLoaderParameters; import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; import com.badlogic.gdx.assets.loaders.FileHandleResolver; import com.badlogic.gdx.assets.loaders.TextureLoader; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.maps.*; import com.badlogic.gdx.maps.objects.EllipseMapObject; import com.badlogic.gdx.maps.objects.PolygonMapObject; import com.badlogic.gdx.maps.objects.PolylineMapObject; import com.badlogic.gdx.maps.objects.RectangleMapObject; import com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell; import com.badlogic.gdx.maps.tiled.objects.TiledMapTileMapObject; import com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile; import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; import com.badlogic.gdx.math.Polygon; import com.badlogic.gdx.math.Polyline; import com.badlogic.gdx.utils.*; import com.badlogic.gdx.utils.XmlReader.Element; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.StringTokenizer; import java.util.zip.GZIPInputStream; import java.util.zip.InflaterInputStream; public abstract class BaseTmxMapLoader<P extends BaseTmxMapLoader.Parameters> extends AsynchronousAssetLoader<TiledMap, P> { public static class Parameters extends AssetLoaderParameters<TiledMap> { /** generate mipmaps? **/ public boolean generateMipMaps = false; /** The TextureFilter to use for minification **/ public TextureFilter textureMinFilter = TextureFilter.Nearest; /** The TextureFilter to use for magnification **/ public TextureFilter textureMagFilter = TextureFilter.Nearest; /** Whether to convert the objects' pixel position and size to the equivalent in tile space. **/ public boolean convertObjectToTileSpace = false; /** Whether to flip all Y coordinates so that Y positive is up. All libGDX renderers require flipped Y coordinates, and thus * flipY set to true. This parameter is included for non-rendering related purposes of TMX files, or custom renderers. */ public boolean flipY = true; } protected static final int FLAG_FLIP_HORIZONTALLY = 0x80000000; protected static final int FLAG_FLIP_VERTICALLY = 0x40000000; protected static final int FLAG_FLIP_DIAGONALLY = 0x20000000; protected static final int MASK_CLEAR = 0xE0000000; protected XmlReader xml = new XmlReader(); protected Element root; protected boolean convertObjectToTileSpace; protected boolean flipY = true; protected int mapTileWidth; protected int mapTileHeight; protected int mapWidthInPixels; protected int mapHeightInPixels; protected TiledMap map; public BaseTmxMapLoader (FileHandleResolver resolver) { super(resolver); } @Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle tmxFile, P parameter) { this.root = xml.parse(tmxFile); TextureLoader.TextureParameter textureParameter = new TextureLoader.TextureParameter(); if (parameter != null) { textureParameter.genMipMaps = parameter.generateMipMaps; textureParameter.minFilter = parameter.textureMinFilter; textureParameter.magFilter = parameter.textureMagFilter; } return getDependencyAssetDescriptors(tmxFile, textureParameter); } protected abstract Array<AssetDescriptor> getDependencyAssetDescriptors (FileHandle tmxFile, TextureLoader.TextureParameter textureParameter); /** Loads the map data, given the XML root element * * @param tmxFile the Filehandle of the tmx file * @param parameter * @param imageResolver * @return the {@link TiledMap} */ protected TiledMap loadTiledMap (FileHandle tmxFile, P parameter, ImageResolver imageResolver) { this.map = new TiledMap(); if (parameter != null) { this.convertObjectToTileSpace = parameter.convertObjectToTileSpace; this.flipY = parameter.flipY; } else { this.convertObjectToTileSpace = false; this.flipY = true; } String mapOrientation = root.getAttribute("orientation", null); int mapWidth = root.getIntAttribute("width", 0); int mapHeight = root.getIntAttribute("height", 0); int tileWidth = root.getIntAttribute("tilewidth", 0); int tileHeight = root.getIntAttribute("tileheight", 0); int hexSideLength = root.getIntAttribute("hexsidelength", 0); String staggerAxis = root.getAttribute("staggeraxis", null); String staggerIndex = root.getAttribute("staggerindex", null); String mapBackgroundColor = root.getAttribute("backgroundcolor", null); MapProperties mapProperties = map.getProperties(); if (mapOrientation != null) { mapProperties.put("orientation", mapOrientation); } mapProperties.put("width", mapWidth); mapProperties.put("height", mapHeight); mapProperties.put("tilewidth", tileWidth); mapProperties.put("tileheight", tileHeight); mapProperties.put("hexsidelength", hexSideLength); if (staggerAxis != null) { mapProperties.put("staggeraxis", staggerAxis); } if (staggerIndex != null) { mapProperties.put("staggerindex", staggerIndex); } if (mapBackgroundColor != null) { mapProperties.put("backgroundcolor", mapBackgroundColor); } this.mapTileWidth = tileWidth; this.mapTileHeight = tileHeight; this.mapWidthInPixels = mapWidth * tileWidth; this.mapHeightInPixels = mapHeight * tileHeight; if (mapOrientation != null) { if ("staggered".equals(mapOrientation)) { if (mapHeight > 1) { this.mapWidthInPixels += tileWidth / 2; this.mapHeightInPixels = mapHeightInPixels / 2 + tileHeight / 2; } } } Element properties = root.getChildByName("properties"); if (properties != null) { loadProperties(map.getProperties(), properties); } Array<Element> tilesets = root.getChildrenByName("tileset"); for (Element element : tilesets) { loadTileSet(element, tmxFile, imageResolver); root.removeChild(element); } for (int i = 0, j = root.getChildCount(); i < j; i++) { Element element = root.getChild(i); loadLayer(map, map.getLayers(), element, tmxFile, imageResolver); } // update hierarchical parallax scrolling factors // in Tiled the final parallax scrolling factor of a layer is the multiplication of its factor with all its parents // 1) get top level groups final Array<MapGroupLayer> groups = map.getLayers().getByType(MapGroupLayer.class); while (groups.notEmpty()) { final MapGroupLayer group = groups.first(); groups.removeIndex(0); for (MapLayer child : group.getLayers()) { child.setParallaxX(child.getParallaxX() * group.getParallaxX()); child.setParallaxY(child.getParallaxY() * group.getParallaxY()); if (child instanceof MapGroupLayer) { // 2) handle any child groups groups.add((MapGroupLayer)child); } } } return map; } protected void loadLayer (TiledMap map, MapLayers parentLayers, Element element, FileHandle tmxFile, ImageResolver imageResolver) { String name = element.getName(); if (name.equals("group")) { loadLayerGroup(map, parentLayers, element, tmxFile, imageResolver); } else if (name.equals("layer")) { loadTileLayer(map, parentLayers, element); } else if (name.equals("objectgroup")) { loadObjectGroup(map, parentLayers, element); } else if (name.equals("imagelayer")) { loadImageLayer(map, parentLayers, element, tmxFile, imageResolver); } } protected void loadLayerGroup (TiledMap map, MapLayers parentLayers, Element element, FileHandle tmxFile, ImageResolver imageResolver) { if (element.getName().equals("group")) { MapGroupLayer groupLayer = new MapGroupLayer(); loadBasicLayerInfo(groupLayer, element); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(groupLayer.getProperties(), properties); } for (int i = 0, j = element.getChildCount(); i < j; i++) { Element child = element.getChild(i); loadLayer(map, groupLayer.getLayers(), child, tmxFile, imageResolver); } for (MapLayer layer : groupLayer.getLayers()) { layer.setParent(groupLayer); } parentLayers.add(groupLayer); } } protected void loadTileLayer (TiledMap map, MapLayers parentLayers, Element element) { if (element.getName().equals("layer")) { int width = element.getIntAttribute("width", 0); int height = element.getIntAttribute("height", 0); int tileWidth = map.getProperties().get("tilewidth", Integer.class); int tileHeight = map.getProperties().get("tileheight", Integer.class); TiledMapTileLayer layer = new TiledMapTileLayer(width, height, tileWidth, tileHeight); loadBasicLayerInfo(layer, element); int[] ids = getTileIds(element, width, height); TiledMapTileSets tilesets = map.getTileSets(); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int id = ids[y * width + x]; boolean flipHorizontally = ((id & FLAG_FLIP_HORIZONTALLY) != 0); boolean flipVertically = ((id & FLAG_FLIP_VERTICALLY) != 0); boolean flipDiagonally = ((id & FLAG_FLIP_DIAGONALLY) != 0); TiledMapTile tile = tilesets.getTile(id & ~MASK_CLEAR); if (tile != null) { Cell cell = createTileLayerCell(flipHorizontally, flipVertically, flipDiagonally); cell.setTile(tile); layer.setCell(x, flipY ? height - 1 - y : y, cell); } } } Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(layer.getProperties(), properties); } parentLayers.add(layer); } } protected void loadObjectGroup (TiledMap map, MapLayers parentLayers, Element element) { if (element.getName().equals("objectgroup")) { MapLayer layer = new MapLayer(); loadBasicLayerInfo(layer, element); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(layer.getProperties(), properties); } for (Element objectElement : element.getChildrenByName("object")) { loadObject(map, layer, objectElement); } parentLayers.add(layer); } } protected void loadImageLayer (TiledMap map, MapLayers parentLayers, Element element, FileHandle tmxFile, ImageResolver imageResolver) { if (element.getName().equals("imagelayer")) { float x = 0; float y = 0; if (element.hasAttribute("offsetx")) { x = Float.parseFloat(element.getAttribute("offsetx", "0")); } else { x = Float.parseFloat(element.getAttribute("x", "0")); } if (element.hasAttribute("offsety")) { y = Float.parseFloat(element.getAttribute("offsety", "0")); } else { y = Float.parseFloat(element.getAttribute("y", "0")); } if (flipY) y = mapHeightInPixels - y; TextureRegion texture = null; Element image = element.getChildByName("image"); if (image != null) { String source = image.getAttribute("source"); FileHandle handle = getRelativeFileHandle(tmxFile, source); texture = imageResolver.getImage(handle.path()); y -= texture.getRegionHeight(); } TiledMapImageLayer layer = new TiledMapImageLayer(texture, x, y); loadBasicLayerInfo(layer, element); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(layer.getProperties(), properties); } parentLayers.add(layer); } } protected void loadBasicLayerInfo (MapLayer layer, Element element) { String name = element.getAttribute("name", null); float opacity = Float.parseFloat(element.getAttribute("opacity", "1.0")); boolean visible = element.getIntAttribute("visible", 1) == 1; float offsetX = element.getFloatAttribute("offsetx", 0); float offsetY = element.getFloatAttribute("offsety", 0); float parallaxX = element.getFloatAttribute("parallaxx", 1f); float parallaxY = element.getFloatAttribute("parallaxy", 1f); layer.setName(name); layer.setOpacity(opacity); layer.setVisible(visible); layer.setOffsetX(offsetX); layer.setOffsetY(offsetY); layer.setParallaxX(parallaxX); layer.setParallaxY(parallaxY); } protected void loadObject (TiledMap map, MapLayer layer, Element element) { loadObject(map, layer.getObjects(), element, mapHeightInPixels); } protected void loadObject (TiledMap map, TiledMapTile tile, Element element) { loadObject(map, tile.getObjects(), element, tile.getTextureRegion().getRegionHeight()); } protected void loadObject (TiledMap map, MapObjects objects, Element element, float heightInPixels) { if (element.getName().equals("object")) { MapObject object = null; float scaleX = convertObjectToTileSpace ? 1.0f / mapTileWidth : 1.0f; float scaleY = convertObjectToTileSpace ? 1.0f / mapTileHeight : 1.0f; float x = element.getFloatAttribute("x", 0) * scaleX; float y = (flipY ? (heightInPixels - element.getFloatAttribute("y", 0)) : element.getFloatAttribute("y", 0)) * scaleY; float width = element.getFloatAttribute("width", 0) * scaleX; float height = element.getFloatAttribute("height", 0) * scaleY; if (element.getChildCount() > 0) { Element child = null; if ((child = element.getChildByName("polygon")) != null) { String[] points = child.getAttribute("points").split(" "); float[] vertices = new float[points.length * 2]; for (int i = 0; i < points.length; i++) { String[] point = points[i].split(","); vertices[i * 2] = Float.parseFloat(point[0]) * scaleX; vertices[i * 2 + 1] = Float.parseFloat(point[1]) * scaleY * (flipY ? -1 : 1); } Polygon polygon = new Polygon(vertices); polygon.setPosition(x, y); object = new PolygonMapObject(polygon); } else if ((child = element.getChildByName("polyline")) != null) { String[] points = child.getAttribute("points").split(" "); float[] vertices = new float[points.length * 2]; for (int i = 0; i < points.length; i++) { String[] point = points[i].split(","); vertices[i * 2] = Float.parseFloat(point[0]) * scaleX; vertices[i * 2 + 1] = Float.parseFloat(point[1]) * scaleY * (flipY ? -1 : 1); } Polyline polyline = new Polyline(vertices); polyline.setPosition(x, y); object = new PolylineMapObject(polyline); } else if ((child = element.getChildByName("ellipse")) != null) { object = new EllipseMapObject(x, flipY ? y - height : y, width, height); } } if (object == null) { String gid = null; if ((gid = element.getAttribute("gid", null)) != null) { int id = (int)Long.parseLong(gid); boolean flipHorizontally = ((id & FLAG_FLIP_HORIZONTALLY) != 0); boolean flipVertically = ((id & FLAG_FLIP_VERTICALLY) != 0); TiledMapTile tile = map.getTileSets().getTile(id & ~MASK_CLEAR); TiledMapTileMapObject tiledMapTileMapObject = new TiledMapTileMapObject(tile, flipHorizontally, flipVertically); TextureRegion textureRegion = tiledMapTileMapObject.getTextureRegion(); tiledMapTileMapObject.getProperties().put("gid", id); tiledMapTileMapObject.setX(x); tiledMapTileMapObject.setY(flipY ? y : y - height); float objectWidth = element.getFloatAttribute("width", textureRegion.getRegionWidth()); float objectHeight = element.getFloatAttribute("height", textureRegion.getRegionHeight()); tiledMapTileMapObject.setScaleX(scaleX * (objectWidth / textureRegion.getRegionWidth())); tiledMapTileMapObject.setScaleY(scaleY * (objectHeight / textureRegion.getRegionHeight())); tiledMapTileMapObject.setRotation(element.getFloatAttribute("rotation", 0)); object = tiledMapTileMapObject; } else { object = new RectangleMapObject(x, flipY ? y - height : y, width, height); } } object.setName(element.getAttribute("name", null)); String rotation = element.getAttribute("rotation", null); if (rotation != null) { object.getProperties().put("rotation", Float.parseFloat(rotation)); } String type = element.getAttribute("type", null); if (type != null) { object.getProperties().put("type", type); } int id = element.getIntAttribute("id", 0); if (id != 0) { object.getProperties().put("id", id); } object.getProperties().put("x", x); if (object instanceof TiledMapTileMapObject) { object.getProperties().put("y", y); } else { object.getProperties().put("y", (flipY ? y - height : y)); } object.getProperties().put("width", width); object.getProperties().put("height", height); object.setVisible(element.getIntAttribute("visible", 1) == 1); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(object.getProperties(), properties); } objects.add(object); } } protected void loadProperties (MapProperties properties, Element element) { if (element == null) return; if (element.getName().equals("properties")) { for (Element property : element.getChildrenByName("property")) { String name = property.getAttribute("name", null); String value = property.getAttribute("value", null); String type = property.getAttribute("type", null); if (value == null) { value = property.getText(); } Object castValue = castProperty(name, value, type); properties.put(name, castValue); } } } protected Object castProperty (String name, String value, String type) { if (type == null) { return value; } else if (type.equals("int")) { return Integer.valueOf(value); } else if (type.equals("float")) { return Float.valueOf(value); } else if (type.equals("bool")) { return Boolean.valueOf(value); } else if (type.equals("color")) { // Tiled uses the format #AARRGGBB String opaqueColor = value.substring(3); String alpha = value.substring(1, 3); return Color.valueOf(opaqueColor + alpha); } else { throw new GdxRuntimeException( "Wrong type given for property " + name + ", given : " + type + ", supported : string, bool, int, float, color"); } } protected Cell createTileLayerCell (boolean flipHorizontally, boolean flipVertically, boolean flipDiagonally) { Cell cell = new Cell(); if (flipDiagonally) { if (flipHorizontally && flipVertically) { cell.setFlipHorizontally(true); cell.setRotation(Cell.ROTATE_270); } else if (flipHorizontally) { cell.setRotation(Cell.ROTATE_270); } else if (flipVertically) { cell.setRotation(Cell.ROTATE_90); } else { cell.setFlipVertically(true); cell.setRotation(Cell.ROTATE_270); } } else { cell.setFlipHorizontally(flipHorizontally); cell.setFlipVertically(flipVertically); } return cell; } static public int[] getTileIds (Element element, int width, int height) { Element data = element.getChildByName("data"); String encoding = data.getAttribute("encoding", null); if (encoding == null) { // no 'encoding' attribute means that the encoding is XML throw new GdxRuntimeException("Unsupported encoding (XML) for TMX Layer Data"); } int[] ids = new int[width * height]; if (encoding.equals("csv")) { String[] array = data.getText().split(","); for (int i = 0; i < array.length; i++) ids[i] = (int)Long.parseLong(array[i].trim()); } else { if (true) if (encoding.equals("base64")) { InputStream is = null; try { String compression = data.getAttribute("compression", null); byte[] bytes = Base64Coder.decode(data.getText()); if (compression == null) is = new ByteArrayInputStream(bytes); else if (compression.equals("gzip")) is = new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(bytes), bytes.length)); else if (compression.equals("zlib")) is = new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(bytes))); else throw new GdxRuntimeException("Unrecognised compression (" + compression + ") for TMX Layer Data"); byte[] temp = new byte[4]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int read = is.read(temp); while (read < temp.length) { int curr = is.read(temp, read, temp.length - read); if (curr == -1) break; read += curr; } if (read != temp.length) throw new GdxRuntimeException("Error Reading TMX Layer Data: Premature end of tile data"); ids[y * width + x] = unsignedByteToInt(temp[0]) | unsignedByteToInt(temp[1]) << 8 | unsignedByteToInt(temp[2]) << 16 | unsignedByteToInt(temp[3]) << 24; } } } catch (IOException e) { throw new GdxRuntimeException("Error Reading TMX Layer Data - IOException: " + e.getMessage()); } finally { StreamUtils.closeQuietly(is); } } else { // any other value of 'encoding' is one we're not aware of, probably a feature of a future version of Tiled // or another editor throw new GdxRuntimeException("Unrecognised encoding (" + encoding + ") for TMX Layer Data"); } } return ids; } protected static int unsignedByteToInt (byte b) { return b & 0xFF; } protected static FileHandle getRelativeFileHandle (FileHandle file, String path) { StringTokenizer tokenizer = new StringTokenizer(path, "\\/"); FileHandle result = file.parent(); while (tokenizer.hasMoreElements()) { String token = tokenizer.nextToken(); if (token.equals("..")) result = result.parent(); else { result = result.child(token); } } return result; } protected void loadTileSet (Element element, FileHandle tmxFile, ImageResolver imageResolver) { if (element.getName().equals("tileset")) { int firstgid = element.getIntAttribute("firstgid", 1); String imageSource = ""; int imageWidth = 0; int imageHeight = 0; FileHandle image = null; String source = element.getAttribute("source", null); if (source != null) { FileHandle tsx = getRelativeFileHandle(tmxFile, source); try { element = xml.parse(tsx); Element imageElement = element.getChildByName("image"); if (imageElement != null) { imageSource = imageElement.getAttribute("source"); imageWidth = imageElement.getIntAttribute("width", 0); imageHeight = imageElement.getIntAttribute("height", 0); image = getRelativeFileHandle(tsx, imageSource); } } catch (SerializationException e) { throw new GdxRuntimeException("Error parsing external tileset."); } } else { Element imageElement = element.getChildByName("image"); if (imageElement != null) { imageSource = imageElement.getAttribute("source"); imageWidth = imageElement.getIntAttribute("width", 0); imageHeight = imageElement.getIntAttribute("height", 0); image = getRelativeFileHandle(tmxFile, imageSource); } } String name = element.get("name", null); int tilewidth = element.getIntAttribute("tilewidth", 0); int tileheight = element.getIntAttribute("tileheight", 0); int spacing = element.getIntAttribute("spacing", 0); int margin = element.getIntAttribute("margin", 0); Element offset = element.getChildByName("tileoffset"); int offsetX = 0; int offsetY = 0; if (offset != null) { offsetX = offset.getIntAttribute("x", 0); offsetY = offset.getIntAttribute("y", 0); } TiledMapTileSet tileSet = new TiledMapTileSet(); // TileSet tileSet.setName(name); final MapProperties tileSetProperties = tileSet.getProperties(); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(tileSetProperties, properties); } tileSetProperties.put("firstgid", firstgid); // Tiles Array<Element> tileElements = element.getChildrenByName("tile"); addStaticTiles(tmxFile, imageResolver, tileSet, element, tileElements, name, firstgid, tilewidth, tileheight, spacing, margin, source, offsetX, offsetY, imageSource, imageWidth, imageHeight, image); Array<AnimatedTiledMapTile> animatedTiles = new Array<AnimatedTiledMapTile>(); for (Element tileElement : tileElements) { int localtid = tileElement.getIntAttribute("id", 0); TiledMapTile tile = tileSet.getTile(firstgid + localtid); if (tile != null) { AnimatedTiledMapTile animatedTile = createAnimatedTile(tileSet, tile, tileElement, firstgid); if (animatedTile != null) { animatedTiles.add(animatedTile); tile = animatedTile; } addTileProperties(tile, tileElement); addTileObjectGroup(tile, tileElement); } } // replace original static tiles by animated tiles for (AnimatedTiledMapTile animatedTile : animatedTiles) { tileSet.putTile(animatedTile.getId(), animatedTile); } map.getTileSets().addTileSet(tileSet); } } protected abstract void addStaticTiles (FileHandle tmxFile, ImageResolver imageResolver, TiledMapTileSet tileset, Element element, Array<Element> tileElements, String name, int firstgid, int tilewidth, int tileheight, int spacing, int margin, String source, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image); protected void addTileProperties (TiledMapTile tile, Element tileElement) { String terrain = tileElement.getAttribute("terrain", null); if (terrain != null) { tile.getProperties().put("terrain", terrain); } String probability = tileElement.getAttribute("probability", null); if (probability != null) { tile.getProperties().put("probability", probability); } String type = tileElement.getAttribute("type", null); if (type != null) { tile.getProperties().put("type", type); } Element properties = tileElement.getChildByName("properties"); if (properties != null) { loadProperties(tile.getProperties(), properties); } } protected void addTileObjectGroup (TiledMapTile tile, Element tileElement) { Element objectgroupElement = tileElement.getChildByName("objectgroup"); if (objectgroupElement != null) { for (Element objectElement : objectgroupElement.getChildrenByName("object")) { loadObject(map, tile, objectElement); } } } protected AnimatedTiledMapTile createAnimatedTile (TiledMapTileSet tileSet, TiledMapTile tile, Element tileElement, int firstgid) { Element animationElement = tileElement.getChildByName("animation"); if (animationElement != null) { Array<StaticTiledMapTile> staticTiles = new Array<StaticTiledMapTile>(); IntArray intervals = new IntArray(); for (Element frameElement : animationElement.getChildrenByName("frame")) { staticTiles.add((StaticTiledMapTile)tileSet.getTile(firstgid + frameElement.getIntAttribute("tileid"))); intervals.add(frameElement.getIntAttribute("duration")); } AnimatedTiledMapTile animatedTile = new AnimatedTiledMapTile(intervals, staticTiles); animatedTile.setId(tile.getId()); return animatedTile; } return null; } protected void addStaticTiledMapTile (TiledMapTileSet tileSet, TextureRegion textureRegion, int tileId, float offsetX, float offsetY) { TiledMapTile tile = new StaticTiledMapTile(textureRegion); tile.setId(tileId); tile.setOffsetX(offsetX); tile.setOffsetY(flipY ? -offsetY : offsetY); tileSet.putTile(tileId, tile); } }
package com.badlogic.gdx.maps.tiled; import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.assets.AssetLoaderParameters; import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; import com.badlogic.gdx.assets.loaders.FileHandleResolver; import com.badlogic.gdx.assets.loaders.TextureLoader; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.maps.*; import com.badlogic.gdx.maps.objects.EllipseMapObject; import com.badlogic.gdx.maps.objects.PolygonMapObject; import com.badlogic.gdx.maps.objects.PolylineMapObject; import com.badlogic.gdx.maps.objects.RectangleMapObject; import com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell; import com.badlogic.gdx.maps.tiled.objects.TiledMapTileMapObject; import com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile; import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; import com.badlogic.gdx.math.Polygon; import com.badlogic.gdx.math.Polyline; import com.badlogic.gdx.utils.*; import com.badlogic.gdx.utils.XmlReader.Element; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.StringTokenizer; import java.util.zip.GZIPInputStream; import java.util.zip.InflaterInputStream; public abstract class BaseTmxMapLoader<P extends BaseTmxMapLoader.Parameters> extends AsynchronousAssetLoader<TiledMap, P> { public static class Parameters extends AssetLoaderParameters<TiledMap> { /** generate mipmaps? **/ public boolean generateMipMaps = false; /** The TextureFilter to use for minification **/ public TextureFilter textureMinFilter = TextureFilter.Nearest; /** The TextureFilter to use for magnification **/ public TextureFilter textureMagFilter = TextureFilter.Nearest; /** Whether to convert the objects' pixel position and size to the equivalent in tile space. **/ public boolean convertObjectToTileSpace = false; /** Whether to flip all Y coordinates so that Y positive is up. All libGDX renderers require flipped Y coordinates, and thus * flipY set to true. This parameter is included for non-rendering related purposes of TMX files, or custom renderers. */ public boolean flipY = true; } protected static final int FLAG_FLIP_HORIZONTALLY = 0x80000000; protected static final int FLAG_FLIP_VERTICALLY = 0x40000000; protected static final int FLAG_FLIP_DIAGONALLY = 0x20000000; protected static final int MASK_CLEAR = 0xE0000000; protected XmlReader xml = new XmlReader(); protected Element root; protected boolean convertObjectToTileSpace; protected boolean flipY = true; protected int mapTileWidth; protected int mapTileHeight; protected int mapWidthInPixels; protected int mapHeightInPixels; protected TiledMap map; protected IntMap<MapObject> idToObject; protected Array<Runnable> runOnEndOfLoadTiled; public BaseTmxMapLoader (FileHandleResolver resolver) { super(resolver); } @Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle tmxFile, P parameter) { this.root = xml.parse(tmxFile); TextureLoader.TextureParameter textureParameter = new TextureLoader.TextureParameter(); if (parameter != null) { textureParameter.genMipMaps = parameter.generateMipMaps; textureParameter.minFilter = parameter.textureMinFilter; textureParameter.magFilter = parameter.textureMagFilter; } return getDependencyAssetDescriptors(tmxFile, textureParameter); } /** Gets a map of the object ids to the {@link MapObject} instances. Returns null if * {@link #loadTiledMap(FileHandle, Parameters, ImageResolver)} has not been called yet. * * @return the map of the ids to {@link MapObject}, or null if {@link #loadTiledMap(FileHandle, Parameters, ImageResolver)} * method has not been called yet. */ public @Null IntMap<MapObject> getIdToObject () { return idToObject; } protected abstract Array<AssetDescriptor> getDependencyAssetDescriptors (FileHandle tmxFile, TextureLoader.TextureParameter textureParameter); /** Loads the map data, given the XML root element * * @param tmxFile the Filehandle of the tmx file * @param parameter * @param imageResolver * @return the {@link TiledMap} */ protected TiledMap loadTiledMap (FileHandle tmxFile, P parameter, ImageResolver imageResolver) { this.map = new TiledMap(); this.idToObject = new IntMap<>(); this.runOnEndOfLoadTiled = new Array<>(); if (parameter != null) { this.convertObjectToTileSpace = parameter.convertObjectToTileSpace; this.flipY = parameter.flipY; } else { this.convertObjectToTileSpace = false; this.flipY = true; } String mapOrientation = root.getAttribute("orientation", null); int mapWidth = root.getIntAttribute("width", 0); int mapHeight = root.getIntAttribute("height", 0); int tileWidth = root.getIntAttribute("tilewidth", 0); int tileHeight = root.getIntAttribute("tileheight", 0); int hexSideLength = root.getIntAttribute("hexsidelength", 0); String staggerAxis = root.getAttribute("staggeraxis", null); String staggerIndex = root.getAttribute("staggerindex", null); String mapBackgroundColor = root.getAttribute("backgroundcolor", null); MapProperties mapProperties = map.getProperties(); if (mapOrientation != null) { mapProperties.put("orientation", mapOrientation); } mapProperties.put("width", mapWidth); mapProperties.put("height", mapHeight); mapProperties.put("tilewidth", tileWidth); mapProperties.put("tileheight", tileHeight); mapProperties.put("hexsidelength", hexSideLength); if (staggerAxis != null) { mapProperties.put("staggeraxis", staggerAxis); } if (staggerIndex != null) { mapProperties.put("staggerindex", staggerIndex); } if (mapBackgroundColor != null) { mapProperties.put("backgroundcolor", mapBackgroundColor); } this.mapTileWidth = tileWidth; this.mapTileHeight = tileHeight; this.mapWidthInPixels = mapWidth * tileWidth; this.mapHeightInPixels = mapHeight * tileHeight; if (mapOrientation != null) { if ("staggered".equals(mapOrientation)) { if (mapHeight > 1) { this.mapWidthInPixels += tileWidth / 2; this.mapHeightInPixels = mapHeightInPixels / 2 + tileHeight / 2; } } } Element properties = root.getChildByName("properties"); if (properties != null) { loadProperties(map.getProperties(), properties); } Array<Element> tilesets = root.getChildrenByName("tileset"); for (Element element : tilesets) { loadTileSet(element, tmxFile, imageResolver); root.removeChild(element); } for (int i = 0, j = root.getChildCount(); i < j; i++) { Element element = root.getChild(i); loadLayer(map, map.getLayers(), element, tmxFile, imageResolver); } // update hierarchical parallax scrolling factors // in Tiled the final parallax scrolling factor of a layer is the multiplication of its factor with all its parents // 1) get top level groups final Array<MapGroupLayer> groups = map.getLayers().getByType(MapGroupLayer.class); while (groups.notEmpty()) { final MapGroupLayer group = groups.first(); groups.removeIndex(0); for (MapLayer child : group.getLayers()) { child.setParallaxX(child.getParallaxX() * group.getParallaxX()); child.setParallaxY(child.getParallaxY() * group.getParallaxY()); if (child instanceof MapGroupLayer) { // 2) handle any child groups groups.add((MapGroupLayer)child); } } } for (Runnable runnable : runOnEndOfLoadTiled) { runnable.run(); } runOnEndOfLoadTiled = null; return map; } protected void loadLayer (TiledMap map, MapLayers parentLayers, Element element, FileHandle tmxFile, ImageResolver imageResolver) { String name = element.getName(); if (name.equals("group")) { loadLayerGroup(map, parentLayers, element, tmxFile, imageResolver); } else if (name.equals("layer")) { loadTileLayer(map, parentLayers, element); } else if (name.equals("objectgroup")) { loadObjectGroup(map, parentLayers, element); } else if (name.equals("imagelayer")) { loadImageLayer(map, parentLayers, element, tmxFile, imageResolver); } } protected void loadLayerGroup (TiledMap map, MapLayers parentLayers, Element element, FileHandle tmxFile, ImageResolver imageResolver) { if (element.getName().equals("group")) { MapGroupLayer groupLayer = new MapGroupLayer(); loadBasicLayerInfo(groupLayer, element); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(groupLayer.getProperties(), properties); } for (int i = 0, j = element.getChildCount(); i < j; i++) { Element child = element.getChild(i); loadLayer(map, groupLayer.getLayers(), child, tmxFile, imageResolver); } for (MapLayer layer : groupLayer.getLayers()) { layer.setParent(groupLayer); } parentLayers.add(groupLayer); } } protected void loadTileLayer (TiledMap map, MapLayers parentLayers, Element element) { if (element.getName().equals("layer")) { int width = element.getIntAttribute("width", 0); int height = element.getIntAttribute("height", 0); int tileWidth = map.getProperties().get("tilewidth", Integer.class); int tileHeight = map.getProperties().get("tileheight", Integer.class); TiledMapTileLayer layer = new TiledMapTileLayer(width, height, tileWidth, tileHeight); loadBasicLayerInfo(layer, element); int[] ids = getTileIds(element, width, height); TiledMapTileSets tilesets = map.getTileSets(); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int id = ids[y * width + x]; boolean flipHorizontally = ((id & FLAG_FLIP_HORIZONTALLY) != 0); boolean flipVertically = ((id & FLAG_FLIP_VERTICALLY) != 0); boolean flipDiagonally = ((id & FLAG_FLIP_DIAGONALLY) != 0); TiledMapTile tile = tilesets.getTile(id & ~MASK_CLEAR); if (tile != null) { Cell cell = createTileLayerCell(flipHorizontally, flipVertically, flipDiagonally); cell.setTile(tile); layer.setCell(x, flipY ? height - 1 - y : y, cell); } } } Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(layer.getProperties(), properties); } parentLayers.add(layer); } } protected void loadObjectGroup (TiledMap map, MapLayers parentLayers, Element element) { if (element.getName().equals("objectgroup")) { MapLayer layer = new MapLayer(); loadBasicLayerInfo(layer, element); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(layer.getProperties(), properties); } for (Element objectElement : element.getChildrenByName("object")) { loadObject(map, layer, objectElement); } parentLayers.add(layer); } } protected void loadImageLayer (TiledMap map, MapLayers parentLayers, Element element, FileHandle tmxFile, ImageResolver imageResolver) { if (element.getName().equals("imagelayer")) { float x = 0; float y = 0; if (element.hasAttribute("offsetx")) { x = Float.parseFloat(element.getAttribute("offsetx", "0")); } else { x = Float.parseFloat(element.getAttribute("x", "0")); } if (element.hasAttribute("offsety")) { y = Float.parseFloat(element.getAttribute("offsety", "0")); } else { y = Float.parseFloat(element.getAttribute("y", "0")); } if (flipY) y = mapHeightInPixels - y; TextureRegion texture = null; Element image = element.getChildByName("image"); if (image != null) { String source = image.getAttribute("source"); FileHandle handle = getRelativeFileHandle(tmxFile, source); texture = imageResolver.getImage(handle.path()); y -= texture.getRegionHeight(); } TiledMapImageLayer layer = new TiledMapImageLayer(texture, x, y); loadBasicLayerInfo(layer, element); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(layer.getProperties(), properties); } parentLayers.add(layer); } } protected void loadBasicLayerInfo (MapLayer layer, Element element) { String name = element.getAttribute("name", null); float opacity = Float.parseFloat(element.getAttribute("opacity", "1.0")); boolean visible = element.getIntAttribute("visible", 1) == 1; float offsetX = element.getFloatAttribute("offsetx", 0); float offsetY = element.getFloatAttribute("offsety", 0); float parallaxX = element.getFloatAttribute("parallaxx", 1f); float parallaxY = element.getFloatAttribute("parallaxy", 1f); layer.setName(name); layer.setOpacity(opacity); layer.setVisible(visible); layer.setOffsetX(offsetX); layer.setOffsetY(offsetY); layer.setParallaxX(parallaxX); layer.setParallaxY(parallaxY); } protected void loadObject (TiledMap map, MapLayer layer, Element element) { loadObject(map, layer.getObjects(), element, mapHeightInPixels); } protected void loadObject (TiledMap map, TiledMapTile tile, Element element) { loadObject(map, tile.getObjects(), element, tile.getTextureRegion().getRegionHeight()); } protected void loadObject (TiledMap map, MapObjects objects, Element element, float heightInPixels) { if (element.getName().equals("object")) { MapObject object = null; float scaleX = convertObjectToTileSpace ? 1.0f / mapTileWidth : 1.0f; float scaleY = convertObjectToTileSpace ? 1.0f / mapTileHeight : 1.0f; float x = element.getFloatAttribute("x", 0) * scaleX; float y = (flipY ? (heightInPixels - element.getFloatAttribute("y", 0)) : element.getFloatAttribute("y", 0)) * scaleY; float width = element.getFloatAttribute("width", 0) * scaleX; float height = element.getFloatAttribute("height", 0) * scaleY; if (element.getChildCount() > 0) { Element child = null; if ((child = element.getChildByName("polygon")) != null) { String[] points = child.getAttribute("points").split(" "); float[] vertices = new float[points.length * 2]; for (int i = 0; i < points.length; i++) { String[] point = points[i].split(","); vertices[i * 2] = Float.parseFloat(point[0]) * scaleX; vertices[i * 2 + 1] = Float.parseFloat(point[1]) * scaleY * (flipY ? -1 : 1); } Polygon polygon = new Polygon(vertices); polygon.setPosition(x, y); object = new PolygonMapObject(polygon); } else if ((child = element.getChildByName("polyline")) != null) { String[] points = child.getAttribute("points").split(" "); float[] vertices = new float[points.length * 2]; for (int i = 0; i < points.length; i++) { String[] point = points[i].split(","); vertices[i * 2] = Float.parseFloat(point[0]) * scaleX; vertices[i * 2 + 1] = Float.parseFloat(point[1]) * scaleY * (flipY ? -1 : 1); } Polyline polyline = new Polyline(vertices); polyline.setPosition(x, y); object = new PolylineMapObject(polyline); } else if ((child = element.getChildByName("ellipse")) != null) { object = new EllipseMapObject(x, flipY ? y - height : y, width, height); } } if (object == null) { String gid = null; if ((gid = element.getAttribute("gid", null)) != null) { int id = (int)Long.parseLong(gid); boolean flipHorizontally = ((id & FLAG_FLIP_HORIZONTALLY) != 0); boolean flipVertically = ((id & FLAG_FLIP_VERTICALLY) != 0); TiledMapTile tile = map.getTileSets().getTile(id & ~MASK_CLEAR); TiledMapTileMapObject tiledMapTileMapObject = new TiledMapTileMapObject(tile, flipHorizontally, flipVertically); TextureRegion textureRegion = tiledMapTileMapObject.getTextureRegion(); tiledMapTileMapObject.getProperties().put("gid", id); tiledMapTileMapObject.setX(x); tiledMapTileMapObject.setY(flipY ? y : y - height); float objectWidth = element.getFloatAttribute("width", textureRegion.getRegionWidth()); float objectHeight = element.getFloatAttribute("height", textureRegion.getRegionHeight()); tiledMapTileMapObject.setScaleX(scaleX * (objectWidth / textureRegion.getRegionWidth())); tiledMapTileMapObject.setScaleY(scaleY * (objectHeight / textureRegion.getRegionHeight())); tiledMapTileMapObject.setRotation(element.getFloatAttribute("rotation", 0)); object = tiledMapTileMapObject; } else { object = new RectangleMapObject(x, flipY ? y - height : y, width, height); } } object.setName(element.getAttribute("name", null)); String rotation = element.getAttribute("rotation", null); if (rotation != null) { object.getProperties().put("rotation", Float.parseFloat(rotation)); } String type = element.getAttribute("type", null); if (type != null) { object.getProperties().put("type", type); } int id = element.getIntAttribute("id", 0); if (id != 0) { object.getProperties().put("id", id); } object.getProperties().put("x", x); if (object instanceof TiledMapTileMapObject) { object.getProperties().put("y", y); } else { object.getProperties().put("y", (flipY ? y - height : y)); } object.getProperties().put("width", width); object.getProperties().put("height", height); object.setVisible(element.getIntAttribute("visible", 1) == 1); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(object.getProperties(), properties); } idToObject.put(id, object); objects.add(object); } } protected void loadProperties (final MapProperties properties, Element element) { if (element == null) return; if (element.getName().equals("properties")) { for (Element property : element.getChildrenByName("property")) { final String name = property.getAttribute("name", null); String value = property.getAttribute("value", null); String type = property.getAttribute("type", null); if (value == null) { value = property.getText(); } if (type != null && type.equals("object")) { // Wait until the end of [loadTiledMap] to fetch the object try { // Value should be the id of the object being pointed to final int id = Integer.parseInt(value); // Create [Runnable] to fetch object and add it to props Runnable fetch = new Runnable() { @Override public void run () { MapObject object = idToObject.get(id); properties.put(name, object); } }; // [Runnable] should not run until the end of [loadTiledMap] runOnEndOfLoadTiled.add(fetch); } catch (Exception exception) { throw new GdxRuntimeException( "Error parsing property [\" + name + \"] of type \"object\" with value: [" + value + "]", exception); } } else { Object castValue = castProperty(name, value, type); properties.put(name, castValue); } } } } protected Object castProperty (String name, String value, String type) { if (type == null) { return value; } else if (type.equals("int")) { return Integer.valueOf(value); } else if (type.equals("float")) { return Float.valueOf(value); } else if (type.equals("bool")) { return Boolean.valueOf(value); } else if (type.equals("color")) { // Tiled uses the format #AARRGGBB String opaqueColor = value.substring(3); String alpha = value.substring(1, 3); return Color.valueOf(opaqueColor + alpha); } else { throw new GdxRuntimeException( "Wrong type given for property " + name + ", given : " + type + ", supported : string, bool, int, float, color"); } } protected Cell createTileLayerCell (boolean flipHorizontally, boolean flipVertically, boolean flipDiagonally) { Cell cell = new Cell(); if (flipDiagonally) { if (flipHorizontally && flipVertically) { cell.setFlipHorizontally(true); cell.setRotation(Cell.ROTATE_270); } else if (flipHorizontally) { cell.setRotation(Cell.ROTATE_270); } else if (flipVertically) { cell.setRotation(Cell.ROTATE_90); } else { cell.setFlipVertically(true); cell.setRotation(Cell.ROTATE_270); } } else { cell.setFlipHorizontally(flipHorizontally); cell.setFlipVertically(flipVertically); } return cell; } static public int[] getTileIds (Element element, int width, int height) { Element data = element.getChildByName("data"); String encoding = data.getAttribute("encoding", null); if (encoding == null) { // no 'encoding' attribute means that the encoding is XML throw new GdxRuntimeException("Unsupported encoding (XML) for TMX Layer Data"); } int[] ids = new int[width * height]; if (encoding.equals("csv")) { String[] array = data.getText().split(","); for (int i = 0; i < array.length; i++) ids[i] = (int)Long.parseLong(array[i].trim()); } else { if (true) if (encoding.equals("base64")) { InputStream is = null; try { String compression = data.getAttribute("compression", null); byte[] bytes = Base64Coder.decode(data.getText()); if (compression == null) is = new ByteArrayInputStream(bytes); else if (compression.equals("gzip")) is = new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(bytes), bytes.length)); else if (compression.equals("zlib")) is = new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(bytes))); else throw new GdxRuntimeException("Unrecognised compression (" + compression + ") for TMX Layer Data"); byte[] temp = new byte[4]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int read = is.read(temp); while (read < temp.length) { int curr = is.read(temp, read, temp.length - read); if (curr == -1) break; read += curr; } if (read != temp.length) throw new GdxRuntimeException("Error Reading TMX Layer Data: Premature end of tile data"); ids[y * width + x] = unsignedByteToInt(temp[0]) | unsignedByteToInt(temp[1]) << 8 | unsignedByteToInt(temp[2]) << 16 | unsignedByteToInt(temp[3]) << 24; } } } catch (IOException e) { throw new GdxRuntimeException("Error Reading TMX Layer Data - IOException: " + e.getMessage()); } finally { StreamUtils.closeQuietly(is); } } else { // any other value of 'encoding' is one we're not aware of, probably a feature of a future version of Tiled // or another editor throw new GdxRuntimeException("Unrecognised encoding (" + encoding + ") for TMX Layer Data"); } } return ids; } protected static int unsignedByteToInt (byte b) { return b & 0xFF; } protected static FileHandle getRelativeFileHandle (FileHandle file, String path) { StringTokenizer tokenizer = new StringTokenizer(path, "\\/"); FileHandle result = file.parent(); while (tokenizer.hasMoreElements()) { String token = tokenizer.nextToken(); if (token.equals("..")) result = result.parent(); else { result = result.child(token); } } return result; } protected void loadTileSet (Element element, FileHandle tmxFile, ImageResolver imageResolver) { if (element.getName().equals("tileset")) { int firstgid = element.getIntAttribute("firstgid", 1); String imageSource = ""; int imageWidth = 0; int imageHeight = 0; FileHandle image = null; String source = element.getAttribute("source", null); if (source != null) { FileHandle tsx = getRelativeFileHandle(tmxFile, source); try { element = xml.parse(tsx); Element imageElement = element.getChildByName("image"); if (imageElement != null) { imageSource = imageElement.getAttribute("source"); imageWidth = imageElement.getIntAttribute("width", 0); imageHeight = imageElement.getIntAttribute("height", 0); image = getRelativeFileHandle(tsx, imageSource); } } catch (SerializationException e) { throw new GdxRuntimeException("Error parsing external tileset."); } } else { Element imageElement = element.getChildByName("image"); if (imageElement != null) { imageSource = imageElement.getAttribute("source"); imageWidth = imageElement.getIntAttribute("width", 0); imageHeight = imageElement.getIntAttribute("height", 0); image = getRelativeFileHandle(tmxFile, imageSource); } } String name = element.get("name", null); int tilewidth = element.getIntAttribute("tilewidth", 0); int tileheight = element.getIntAttribute("tileheight", 0); int spacing = element.getIntAttribute("spacing", 0); int margin = element.getIntAttribute("margin", 0); Element offset = element.getChildByName("tileoffset"); int offsetX = 0; int offsetY = 0; if (offset != null) { offsetX = offset.getIntAttribute("x", 0); offsetY = offset.getIntAttribute("y", 0); } TiledMapTileSet tileSet = new TiledMapTileSet(); // TileSet tileSet.setName(name); final MapProperties tileSetProperties = tileSet.getProperties(); Element properties = element.getChildByName("properties"); if (properties != null) { loadProperties(tileSetProperties, properties); } tileSetProperties.put("firstgid", firstgid); // Tiles Array<Element> tileElements = element.getChildrenByName("tile"); addStaticTiles(tmxFile, imageResolver, tileSet, element, tileElements, name, firstgid, tilewidth, tileheight, spacing, margin, source, offsetX, offsetY, imageSource, imageWidth, imageHeight, image); Array<AnimatedTiledMapTile> animatedTiles = new Array<AnimatedTiledMapTile>(); for (Element tileElement : tileElements) { int localtid = tileElement.getIntAttribute("id", 0); TiledMapTile tile = tileSet.getTile(firstgid + localtid); if (tile != null) { AnimatedTiledMapTile animatedTile = createAnimatedTile(tileSet, tile, tileElement, firstgid); if (animatedTile != null) { animatedTiles.add(animatedTile); tile = animatedTile; } addTileProperties(tile, tileElement); addTileObjectGroup(tile, tileElement); } } // replace original static tiles by animated tiles for (AnimatedTiledMapTile animatedTile : animatedTiles) { tileSet.putTile(animatedTile.getId(), animatedTile); } map.getTileSets().addTileSet(tileSet); } } protected abstract void addStaticTiles (FileHandle tmxFile, ImageResolver imageResolver, TiledMapTileSet tileset, Element element, Array<Element> tileElements, String name, int firstgid, int tilewidth, int tileheight, int spacing, int margin, String source, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image); protected void addTileProperties (TiledMapTile tile, Element tileElement) { String terrain = tileElement.getAttribute("terrain", null); if (terrain != null) { tile.getProperties().put("terrain", terrain); } String probability = tileElement.getAttribute("probability", null); if (probability != null) { tile.getProperties().put("probability", probability); } String type = tileElement.getAttribute("type", null); if (type != null) { tile.getProperties().put("type", type); } Element properties = tileElement.getChildByName("properties"); if (properties != null) { loadProperties(tile.getProperties(), properties); } } protected void addTileObjectGroup (TiledMapTile tile, Element tileElement) { Element objectgroupElement = tileElement.getChildByName("objectgroup"); if (objectgroupElement != null) { for (Element objectElement : objectgroupElement.getChildrenByName("object")) { loadObject(map, tile, objectElement); } } } protected AnimatedTiledMapTile createAnimatedTile (TiledMapTileSet tileSet, TiledMapTile tile, Element tileElement, int firstgid) { Element animationElement = tileElement.getChildByName("animation"); if (animationElement != null) { Array<StaticTiledMapTile> staticTiles = new Array<StaticTiledMapTile>(); IntArray intervals = new IntArray(); for (Element frameElement : animationElement.getChildrenByName("frame")) { staticTiles.add((StaticTiledMapTile)tileSet.getTile(firstgid + frameElement.getIntAttribute("tileid"))); intervals.add(frameElement.getIntAttribute("duration")); } AnimatedTiledMapTile animatedTile = new AnimatedTiledMapTile(intervals, staticTiles); animatedTile.setId(tile.getId()); return animatedTile; } return null; } protected void addStaticTiledMapTile (TiledMapTileSet tileSet, TextureRegion textureRegion, int tileId, float offsetX, float offsetY) { TiledMapTile tile = new StaticTiledMapTile(textureRegion); tile.setId(tileId); tile.setOffsetX(offsetX); tile.setOffsetY(flipY ? -offsetY : offsetY); tileSet.putTile(tileId, tile); } }
1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests-gwt/src/com/badlogic/gdx/tests/gwt/client/GwtTestWrapper.java
package com.badlogic.gdx.tests.gwt.client; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.tests.AbstractTestWrapper; import com.badlogic.gdx.tests.AccelerometerTest; import com.badlogic.gdx.tests.ActionSequenceTest; import com.badlogic.gdx.tests.ActionTest; import com.badlogic.gdx.tests.AlphaTest; import com.badlogic.gdx.tests.AnimationTest; import com.badlogic.gdx.tests.AnnotationTest; import com.badlogic.gdx.tests.AssetManagerTest; import com.badlogic.gdx.tests.AtlasIssueTest; import com.badlogic.gdx.tests.BigMeshTest; import com.badlogic.gdx.tests.BitmapFontAlignmentTest; import com.badlogic.gdx.tests.BitmapFontFlipTest; import com.badlogic.gdx.tests.BitmapFontMetricsTest; import com.badlogic.gdx.tests.BitmapFontTest; import com.badlogic.gdx.tests.BlitTest; import com.badlogic.gdx.tests.Box2DCharacterControllerTest; import com.badlogic.gdx.tests.Box2DTest; import com.badlogic.gdx.tests.Box2DTestCollection; import com.badlogic.gdx.tests.BufferUtilsTest; import com.badlogic.gdx.tests.ClipboardTest; import com.badlogic.gdx.tests.ColorTest; import com.badlogic.gdx.tests.ComplexActionTest; import com.badlogic.gdx.tests.CustomShaderSpriteBatchTest; import com.badlogic.gdx.tests.DecalTest; import com.badlogic.gdx.tests.DownloadTest; import com.badlogic.gdx.tests.EdgeDetectionTest; import com.badlogic.gdx.tests.FilesTest; import com.badlogic.gdx.tests.FilterPerformanceTest; import com.badlogic.gdx.tests.FloatTextureTest; import com.badlogic.gdx.tests.FrameBufferTest; import com.badlogic.gdx.tests.FramebufferToTextureTest; import com.badlogic.gdx.tests.GLProfilerErrorTest; import com.badlogic.gdx.tests.GWTLossyPremultipliedAlphaTest; import com.badlogic.gdx.tests.GestureDetectorTest; import com.badlogic.gdx.tests.GroupCullingTest; import com.badlogic.gdx.tests.GroupFadeTest; import com.badlogic.gdx.tests.I18NSimpleMessageTest; import com.badlogic.gdx.tests.ImageScaleTest; import com.badlogic.gdx.tests.ImageTest; import com.badlogic.gdx.tests.IndexBufferObjectShaderTest; import com.badlogic.gdx.tests.IntegerBitmapFontTest; import com.badlogic.gdx.tests.InterpolationTest; import com.badlogic.gdx.tests.InverseKinematicsTest; import com.badlogic.gdx.tests.IsometricTileTest; import com.badlogic.gdx.tests.KinematicBodyTest; import com.badlogic.gdx.tests.LabelScaleTest; import com.badlogic.gdx.tests.LabelTest; import com.badlogic.gdx.tests.LifeCycleTest; import com.badlogic.gdx.tests.MeshShaderTest; import com.badlogic.gdx.tests.MeshWithCustomAttributesTest; import com.badlogic.gdx.tests.MipMapTest; import com.badlogic.gdx.tests.MultitouchTest; import com.badlogic.gdx.tests.MusicTest; import com.badlogic.gdx.tests.ParallaxTest; import com.badlogic.gdx.tests.ParticleEmitterTest; import com.badlogic.gdx.tests.PixelsPerInchTest; import com.badlogic.gdx.tests.PixmapPackerTest; import com.badlogic.gdx.tests.PixmapTest; import com.badlogic.gdx.tests.PreferencesTest; import com.badlogic.gdx.tests.ProjectiveTextureTest; import com.badlogic.gdx.tests.QuadTreeFloatNearestTest; import com.badlogic.gdx.tests.QuadTreeFloatTest; import com.badlogic.gdx.tests.ReflectionCorrectnessTest; import com.badlogic.gdx.tests.ReflectionTest; import com.badlogic.gdx.tests.RotationTest; import com.badlogic.gdx.tests.Scene2dTest; import com.badlogic.gdx.tests.ShapeRendererTest; import com.badlogic.gdx.tests.SimpleAnimationTest; import com.badlogic.gdx.tests.SimpleDecalTest; import com.badlogic.gdx.tests.SimpleStageCullingTest; import com.badlogic.gdx.tests.SortedSpriteTest; import com.badlogic.gdx.tests.SoundTest; import com.badlogic.gdx.tests.SpriteBatchShaderTest; import com.badlogic.gdx.tests.SpriteCacheOffsetTest; import com.badlogic.gdx.tests.SpriteCacheTest; import com.badlogic.gdx.tests.StageTest; import com.badlogic.gdx.tests.SystemCursorTest; import com.badlogic.gdx.tests.TableTest; import com.badlogic.gdx.tests.TextAreaTest; import com.badlogic.gdx.tests.TextAreaTest2; import com.badlogic.gdx.tests.TextAreaTest3; import com.badlogic.gdx.tests.TextButtonTest; import com.badlogic.gdx.tests.TextureAtlasTest; import com.badlogic.gdx.tests.TiledMapAtlasAssetManagerTest; import com.badlogic.gdx.tests.TiledMapObjectLoadingTest; import com.badlogic.gdx.tests.TimeUtilsTest; import com.badlogic.gdx.tests.UITest; import com.badlogic.gdx.tests.VertexBufferObjectShaderTest; import com.badlogic.gdx.tests.YDownTest; import com.badlogic.gdx.tests.conformance.DisplayModeTest; import com.badlogic.gdx.tests.g3d.ModelCacheTest; import com.badlogic.gdx.tests.g3d.MultipleRenderTargetTest; import com.badlogic.gdx.tests.g3d.ShadowMappingTest; import com.badlogic.gdx.tests.g3d.TextureArrayTest; import com.badlogic.gdx.tests.gles2.VertexArrayTest; import com.badlogic.gdx.tests.gles3.GL30Texture3DTest; import com.badlogic.gdx.tests.gles3.NonPowerOfTwoTest; import com.badlogic.gdx.tests.gles3.UniformBufferObjectsTest; import com.badlogic.gdx.tests.gles3.InstancedRenderingTest; import com.badlogic.gdx.tests.gwt.GwtInputTest; import com.badlogic.gdx.tests.gwt.GwtWindowModeTest; import com.badlogic.gdx.tests.math.CollisionPlaygroundTest; import com.badlogic.gdx.tests.math.OctreeTest; import com.badlogic.gdx.tests.math.collision.OrientedBoundingBoxTest; import com.badlogic.gdx.tests.net.OpenBrowserExample; import com.badlogic.gdx.tests.superkoalio.SuperKoalio; import com.badlogic.gdx.tests.utils.GdxTest; import java.util.ArrayList; public class GwtTestWrapper extends AbstractTestWrapper { @Override protected AbstractTestWrapper.Instancer[] getTestList () { ArrayList<Instancer> tests = new ArrayList<>(); tests.add(new GwtInstancer() { public GdxTest instance () { return new AccelerometerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ActionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ActionSequenceTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AlphaTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AnimationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AnnotationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AssetManagerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AtlasIssueTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BigMeshTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontAlignmentTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontFlipTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontMetricsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BlitTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Box2DCharacterControllerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Box2DTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Box2DTestCollection(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BufferUtilsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ClipboardTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ColorTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new CollisionPlaygroundTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ComplexActionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new CustomShaderSpriteBatchTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new DecalTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new DisplayModeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new LabelScaleTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new EdgeDetectionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new FilesTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new FilterPerformanceTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new FlickScrollPaneTest();}}, // FIXME this messes up stuff, why? tests.add(new GwtInstancer() { public GdxTest instance () { return new FrameBufferTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new DownloadTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new FramebufferToTextureTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GestureDetectorTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GLProfilerErrorTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GroupCullingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GroupFadeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GwtInputTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GwtWindowModeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new I18NSimpleMessageTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ImageScaleTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ImageTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new IndexBufferObjectShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new IntegerBitmapFontTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new InterpolationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new InverseKinematicsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new IsometricTileTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new KinematicBodyTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new LifeCycleTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new LabelTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new MatrixJNITest();}}, // No purpose tests.add(new GwtInstancer() { public GdxTest instance () { return new MeshShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MeshWithCustomAttributesTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MipMapTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ModelCacheTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MultitouchTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MusicTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new OctreeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new OpenBrowserExample(); } }); // tests.add(new GwtInstancer() { public GdxTest instance () { return new NoncontinuousRenderingTest(); } // FIXME doesn't compile // due to // the use of Thread tests.add(new GwtInstancer() { public GdxTest instance () { return new OrientedBoundingBoxTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ParallaxTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ParticleEmitterTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new PixelsPerInchTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new PixmapPackerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new PixmapTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new PixmapBlendingTest();}}, // FIXME no idea why this doesn't // work tests.add(new GwtInstancer() { public GdxTest instance () { return new PreferencesTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ProjectiveTextureTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new RotationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ReflectionCorrectnessTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Scene2dTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new RunnablePostTest();}}, // Goes into infinite loop // new GwtInstancer() {public GdxTest instance(){return new ScrollPaneTest();}}, // FIXME this messes up stuff, why? // new GwtInstancer() {public GdxTest instance(){return new ShaderMultitextureTest();}}, // FIXME fucks up stuff tests.add(new GwtInstancer() { public GdxTest instance () { return new ShadowMappingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ShapeRendererTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SimpleAnimationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SimpleDecalTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SimpleStageCullingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SortedSpriteTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SpriteBatchShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SpriteCacheOffsetTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SpriteCacheTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SoundTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new StageTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SystemCursorTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new StagePerformanceTest();}}, // FIXME borks out tests.add(new GwtInstancer() { public GdxTest instance () { return new TableTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextButtonTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextButtonTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextureAtlasTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TiledMapObjectLoadingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new UITest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new VertexBufferObjectShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new YDownTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SuperKoalio(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ReflectionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TiledMapAtlasAssetManagerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TimeUtilsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GWTLossyPremultipliedAlphaTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new QuadTreeFloatTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new QuadTreeFloatNearestTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextAreaTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextAreaTest2(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextAreaTest3(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new VertexArrayTest(); } }); // these may have issues with tab getting intercepted by the browser // Add the GL30 tests if applicable if (Gdx.graphics.isGL30Available()) { tests.add(new GwtInstancer() { public GdxTest instance () { return new FloatTextureTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GL30Texture3DTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new InstancedRenderingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MultipleRenderTargetTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new NonPowerOfTwoTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextureArrayTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new UniformBufferObjectsTest(); } }); } Instancer[] testArr = new Instancer[tests.size()]; tests.toArray(testArr); return testArr; } abstract static class GwtInstancer implements AbstractTestWrapper.Instancer { @Override public String getSimpleName () { return instance().getClass().getSimpleName(); } } }
package com.badlogic.gdx.tests.gwt.client; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.tests.AbstractTestWrapper; import com.badlogic.gdx.tests.AccelerometerTest; import com.badlogic.gdx.tests.ActionSequenceTest; import com.badlogic.gdx.tests.ActionTest; import com.badlogic.gdx.tests.AlphaTest; import com.badlogic.gdx.tests.AnimationTest; import com.badlogic.gdx.tests.AnnotationTest; import com.badlogic.gdx.tests.AssetManagerTest; import com.badlogic.gdx.tests.AtlasIssueTest; import com.badlogic.gdx.tests.BigMeshTest; import com.badlogic.gdx.tests.BitmapFontAlignmentTest; import com.badlogic.gdx.tests.BitmapFontFlipTest; import com.badlogic.gdx.tests.BitmapFontMetricsTest; import com.badlogic.gdx.tests.BitmapFontTest; import com.badlogic.gdx.tests.BlitTest; import com.badlogic.gdx.tests.Box2DCharacterControllerTest; import com.badlogic.gdx.tests.Box2DTest; import com.badlogic.gdx.tests.Box2DTestCollection; import com.badlogic.gdx.tests.BufferUtilsTest; import com.badlogic.gdx.tests.ClipboardTest; import com.badlogic.gdx.tests.TiledMapObjectPropertyTest; import com.badlogic.gdx.tests.ColorTest; import com.badlogic.gdx.tests.ComplexActionTest; import com.badlogic.gdx.tests.CustomShaderSpriteBatchTest; import com.badlogic.gdx.tests.DecalTest; import com.badlogic.gdx.tests.DownloadTest; import com.badlogic.gdx.tests.EdgeDetectionTest; import com.badlogic.gdx.tests.FilesTest; import com.badlogic.gdx.tests.FilterPerformanceTest; import com.badlogic.gdx.tests.FloatTextureTest; import com.badlogic.gdx.tests.FrameBufferTest; import com.badlogic.gdx.tests.FramebufferToTextureTest; import com.badlogic.gdx.tests.GLProfilerErrorTest; import com.badlogic.gdx.tests.GWTLossyPremultipliedAlphaTest; import com.badlogic.gdx.tests.GestureDetectorTest; import com.badlogic.gdx.tests.GroupCullingTest; import com.badlogic.gdx.tests.GroupFadeTest; import com.badlogic.gdx.tests.I18NSimpleMessageTest; import com.badlogic.gdx.tests.ImageScaleTest; import com.badlogic.gdx.tests.ImageTest; import com.badlogic.gdx.tests.IndexBufferObjectShaderTest; import com.badlogic.gdx.tests.IntegerBitmapFontTest; import com.badlogic.gdx.tests.InterpolationTest; import com.badlogic.gdx.tests.InverseKinematicsTest; import com.badlogic.gdx.tests.IsometricTileTest; import com.badlogic.gdx.tests.KinematicBodyTest; import com.badlogic.gdx.tests.LabelScaleTest; import com.badlogic.gdx.tests.LabelTest; import com.badlogic.gdx.tests.LifeCycleTest; import com.badlogic.gdx.tests.MeshShaderTest; import com.badlogic.gdx.tests.MeshWithCustomAttributesTest; import com.badlogic.gdx.tests.MipMapTest; import com.badlogic.gdx.tests.MultitouchTest; import com.badlogic.gdx.tests.MusicTest; import com.badlogic.gdx.tests.ParallaxTest; import com.badlogic.gdx.tests.ParticleEmitterTest; import com.badlogic.gdx.tests.PixelsPerInchTest; import com.badlogic.gdx.tests.PixmapPackerTest; import com.badlogic.gdx.tests.PixmapTest; import com.badlogic.gdx.tests.PreferencesTest; import com.badlogic.gdx.tests.ProjectiveTextureTest; import com.badlogic.gdx.tests.QuadTreeFloatNearestTest; import com.badlogic.gdx.tests.QuadTreeFloatTest; import com.badlogic.gdx.tests.ReflectionCorrectnessTest; import com.badlogic.gdx.tests.ReflectionTest; import com.badlogic.gdx.tests.RotationTest; import com.badlogic.gdx.tests.Scene2dTest; import com.badlogic.gdx.tests.ShapeRendererTest; import com.badlogic.gdx.tests.SimpleAnimationTest; import com.badlogic.gdx.tests.SimpleDecalTest; import com.badlogic.gdx.tests.SimpleStageCullingTest; import com.badlogic.gdx.tests.SortedSpriteTest; import com.badlogic.gdx.tests.SoundTest; import com.badlogic.gdx.tests.SpriteBatchShaderTest; import com.badlogic.gdx.tests.SpriteCacheOffsetTest; import com.badlogic.gdx.tests.SpriteCacheTest; import com.badlogic.gdx.tests.StageTest; import com.badlogic.gdx.tests.SystemCursorTest; import com.badlogic.gdx.tests.TableTest; import com.badlogic.gdx.tests.TextAreaTest; import com.badlogic.gdx.tests.TextAreaTest2; import com.badlogic.gdx.tests.TextAreaTest3; import com.badlogic.gdx.tests.TextButtonTest; import com.badlogic.gdx.tests.TextureAtlasTest; import com.badlogic.gdx.tests.TiledMapAtlasAssetManagerTest; import com.badlogic.gdx.tests.TiledMapObjectLoadingTest; import com.badlogic.gdx.tests.TimeUtilsTest; import com.badlogic.gdx.tests.UITest; import com.badlogic.gdx.tests.VertexBufferObjectShaderTest; import com.badlogic.gdx.tests.YDownTest; import com.badlogic.gdx.tests.conformance.DisplayModeTest; import com.badlogic.gdx.tests.g3d.ModelCacheTest; import com.badlogic.gdx.tests.g3d.MultipleRenderTargetTest; import com.badlogic.gdx.tests.g3d.ShadowMappingTest; import com.badlogic.gdx.tests.g3d.TextureArrayTest; import com.badlogic.gdx.tests.gles2.VertexArrayTest; import com.badlogic.gdx.tests.gles3.GL30Texture3DTest; import com.badlogic.gdx.tests.gles3.NonPowerOfTwoTest; import com.badlogic.gdx.tests.gles3.UniformBufferObjectsTest; import com.badlogic.gdx.tests.gles3.InstancedRenderingTest; import com.badlogic.gdx.tests.gwt.GwtInputTest; import com.badlogic.gdx.tests.gwt.GwtWindowModeTest; import com.badlogic.gdx.tests.math.CollisionPlaygroundTest; import com.badlogic.gdx.tests.math.OctreeTest; import com.badlogic.gdx.tests.math.collision.OrientedBoundingBoxTest; import com.badlogic.gdx.tests.net.OpenBrowserExample; import com.badlogic.gdx.tests.superkoalio.SuperKoalio; import com.badlogic.gdx.tests.utils.GdxTest; import java.util.ArrayList; public class GwtTestWrapper extends AbstractTestWrapper { @Override protected AbstractTestWrapper.Instancer[] getTestList () { ArrayList<Instancer> tests = new ArrayList<>(); tests.add(new GwtInstancer() { public GdxTest instance () { return new AccelerometerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ActionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ActionSequenceTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AlphaTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AnimationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AnnotationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AssetManagerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new AtlasIssueTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BigMeshTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontAlignmentTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontFlipTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BitmapFontMetricsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BlitTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Box2DCharacterControllerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Box2DTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Box2DTestCollection(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new BufferUtilsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ClipboardTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ColorTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new CollisionPlaygroundTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ComplexActionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new CustomShaderSpriteBatchTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new DecalTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new DisplayModeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new LabelScaleTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new EdgeDetectionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new FilesTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new FilterPerformanceTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new FlickScrollPaneTest();}}, // FIXME this messes up stuff, why? tests.add(new GwtInstancer() { public GdxTest instance () { return new FrameBufferTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new DownloadTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new FramebufferToTextureTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GestureDetectorTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GLProfilerErrorTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GroupCullingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GroupFadeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GwtInputTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GwtWindowModeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new I18NSimpleMessageTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ImageScaleTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ImageTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new IndexBufferObjectShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new IntegerBitmapFontTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new InterpolationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new InverseKinematicsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new IsometricTileTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new KinematicBodyTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new LifeCycleTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new LabelTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new MatrixJNITest();}}, // No purpose tests.add(new GwtInstancer() { public GdxTest instance () { return new MeshShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MeshWithCustomAttributesTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MipMapTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ModelCacheTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MultitouchTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MusicTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new OctreeTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new OpenBrowserExample(); } }); // tests.add(new GwtInstancer() { public GdxTest instance () { return new NoncontinuousRenderingTest(); } // FIXME doesn't compile // due to // the use of Thread tests.add(new GwtInstancer() { public GdxTest instance () { return new OrientedBoundingBoxTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ParallaxTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ParticleEmitterTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new PixelsPerInchTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new PixmapPackerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new PixmapTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new PixmapBlendingTest();}}, // FIXME no idea why this doesn't // work tests.add(new GwtInstancer() { public GdxTest instance () { return new PreferencesTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ProjectiveTextureTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new RotationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ReflectionCorrectnessTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new Scene2dTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new RunnablePostTest();}}, // Goes into infinite loop // new GwtInstancer() {public GdxTest instance(){return new ScrollPaneTest();}}, // FIXME this messes up stuff, why? // new GwtInstancer() {public GdxTest instance(){return new ShaderMultitextureTest();}}, // FIXME fucks up stuff tests.add(new GwtInstancer() { public GdxTest instance () { return new ShadowMappingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ShapeRendererTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SimpleAnimationTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SimpleDecalTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SimpleStageCullingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SortedSpriteTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SpriteBatchShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SpriteCacheOffsetTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SpriteCacheTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SoundTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new StageTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SystemCursorTest(); } }); // new GwtInstancer() {public GdxTest instance(){return new StagePerformanceTest();}}, // FIXME borks out tests.add(new GwtInstancer() { public GdxTest instance () { return new TableTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextButtonTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextButtonTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextureAtlasTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TiledMapObjectLoadingTest(); } }); tests.add(new GwtInstancer() { @Override public GdxTest instance () { return new TiledMapObjectPropertyTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new UITest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new VertexBufferObjectShaderTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new YDownTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new SuperKoalio(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new ReflectionTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TiledMapAtlasAssetManagerTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TimeUtilsTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GWTLossyPremultipliedAlphaTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new QuadTreeFloatTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new QuadTreeFloatNearestTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextAreaTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextAreaTest2(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextAreaTest3(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new VertexArrayTest(); } }); // these may have issues with tab getting intercepted by the browser // Add the GL30 tests if applicable if (Gdx.graphics.isGL30Available()) { tests.add(new GwtInstancer() { public GdxTest instance () { return new FloatTextureTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new GL30Texture3DTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new InstancedRenderingTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new MultipleRenderTargetTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new NonPowerOfTwoTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new TextureArrayTest(); } }); tests.add(new GwtInstancer() { public GdxTest instance () { return new UniformBufferObjectsTest(); } }); } Instancer[] testArr = new Instancer[tests.size()]; tests.toArray(testArr); return testArr; } abstract static class GwtInstancer implements AbstractTestWrapper.Instancer { @Override public String getSimpleName () { return instance().getClass().getSimpleName(); } } }
1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/utils/GdxTests.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ /* * Copyright 2010 Mario Zechner ([email protected]), Nathan Sweet ([email protected]) * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package com.badlogic.gdx.tests.utils; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.badlogic.gdx.tests.*; import com.badlogic.gdx.tests.bench.TiledMapBench; import com.badlogic.gdx.tests.conformance.AudioSoundAndMusicIsolationTest; import com.badlogic.gdx.tests.conformance.DisplayModeTest; import com.badlogic.gdx.tests.examples.MoveSpriteExample; import com.badlogic.gdx.tests.extensions.FreeTypeAtlasTest; import com.badlogic.gdx.tests.extensions.FreeTypeDisposeTest; import com.badlogic.gdx.tests.extensions.FreeTypeFontLoaderTest; import com.badlogic.gdx.tests.extensions.FreeTypeIncrementalTest; import com.badlogic.gdx.tests.extensions.FreeTypeMetricsTest; import com.badlogic.gdx.tests.extensions.FreeTypePackTest; import com.badlogic.gdx.tests.extensions.FreeTypeTest; import com.badlogic.gdx.tests.extensions.InternationalFontsTest; import com.badlogic.gdx.tests.gles3.NonPowerOfTwoTest; import com.badlogic.gdx.tests.gles3.UniformBufferObjectsTest; import com.badlogic.gdx.tests.math.CollisionPlaygroundTest; import com.badlogic.gdx.tests.math.OctreeTest; import com.badlogic.gdx.tests.g3d.Animation3DTest; import com.badlogic.gdx.tests.g3d.AnisotropyTest; import com.badlogic.gdx.tests.g3d.Basic3DSceneTest; import com.badlogic.gdx.tests.g3d.Basic3DTest; import com.badlogic.gdx.tests.g3d.Benchmark3DTest; import com.badlogic.gdx.tests.g3d.FogTest; import com.badlogic.gdx.tests.g3d.FrameBufferCubemapTest; import com.badlogic.gdx.tests.g3d.HeightMapTest; import com.badlogic.gdx.tests.g3d.LightsTest; import com.badlogic.gdx.tests.g3d.MaterialEmissiveTest; import com.badlogic.gdx.tests.g3d.MaterialTest; import com.badlogic.gdx.tests.g3d.MeshBuilderTest; import com.badlogic.gdx.tests.g3d.ModelCacheTest; import com.badlogic.gdx.tests.g3d.ModelTest; import com.badlogic.gdx.tests.g3d.MultipleRenderTargetTest; import com.badlogic.gdx.tests.g3d.ParticleControllerInfluencerSingleTest; import com.badlogic.gdx.tests.g3d.ParticleControllerTest; import com.badlogic.gdx.tests.g3d.PolarAccelerationTest; import com.badlogic.gdx.tests.g3d.ShaderCollectionTest; import com.badlogic.gdx.tests.g3d.ShaderTest; import com.badlogic.gdx.tests.g3d.ShadowMappingTest; import com.badlogic.gdx.tests.g3d.SkeletonTest; import com.badlogic.gdx.tests.g3d.TangentialAccelerationTest; import com.badlogic.gdx.tests.g3d.TextureArrayTest; import com.badlogic.gdx.tests.g3d.TextureRegion3DTest; import com.badlogic.gdx.tests.g3d.utils.DefaultTextureBinderTest; import com.badlogic.gdx.tests.gles2.HelloTriangle; import com.badlogic.gdx.tests.gles2.SimpleVertexShader; import com.badlogic.gdx.tests.gles2.VertexArrayTest; import com.badlogic.gdx.tests.gles3.GL30Texture3DTest; import com.badlogic.gdx.tests.gles3.InstancedRenderingTest; import com.badlogic.gdx.tests.gles3.ModelInstancedRenderingTest; import com.badlogic.gdx.tests.gles3.PixelBufferObjectTest; import com.badlogic.gdx.tests.gles31.GL31FrameBufferMultisampleTest; import com.badlogic.gdx.tests.gles31.GL31IndirectDrawingIndexedTest; import com.badlogic.gdx.tests.gles31.GL31IndirectDrawingNonIndexedTest; import com.badlogic.gdx.tests.gles31.GL31ProgramIntrospectionTest; import com.badlogic.gdx.tests.gles32.GL32AdvancedBlendingTest; import com.badlogic.gdx.tests.gles32.GL32DebugControlTest; import com.badlogic.gdx.tests.gles32.GL32MultipleRenderTargetsBlendingTest; import com.badlogic.gdx.tests.gles32.GL32OffsetElementsTest; import com.badlogic.gdx.tests.math.collision.OrientedBoundingBoxTest; import com.badlogic.gdx.tests.net.NetAPITest; import com.badlogic.gdx.tests.superkoalio.SuperKoalio; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.StreamUtils; /** List of GdxTest classes. To be used by the test launchers. If you write your own test, add it in here! * * @author [email protected] */ public class GdxTests { public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( // @off IssueTest.class, AccelerometerTest.class, ActionSequenceTest.class, ActionTest.class, Affine2Test.class, AlphaTest.class, Animation3DTest.class, AnimationTest.class, AnisotropyTest.class, AnnotationTest.class, AssetManagerTest.class, AtlasIssueTest.class, AudioChangeDeviceTest.class, AudioDeviceTest.class, AudioRecorderTest.class, AudioSoundAndMusicIsolationTest.class, Basic3DSceneTest.class, Basic3DTest.class, Benchmark3DTest.class, BigMeshTest.class, BitmapFontAlignmentTest.class, BitmapFontDistanceFieldTest.class, BitmapFontFlipTest.class, BitmapFontMetricsTest.class, BitmapFontTest.class, BitmapFontAtlasRegionTest.class, BlitTest.class, Box2DTest.class, Box2DTestCollection.class, Bresenham2Test.class, BufferUtilsTest.class, BulletTestCollection.class, ClipboardTest.class, CollectionsTest.class, CollisionPlaygroundTest.class, ColorTest.class, ContainerTest.class, CoordinatesTest.class, CpuSpriteBatchTest.class, CullTest.class, CursorTest.class, DecalTest.class, DefaultTextureBinderTest.class, DelaunayTriangulatorTest.class, DeltaTimeTest.class, DirtyRenderingTest.class, DisplayModeTest.class, DownloadTest.class, DragAndDropTest.class, ETC1Test.class, // EarClippingTriangulatorTest.class, EdgeDetectionTest.class, ExitTest.class, ExternalMusicTest.class, FilesTest.class, FilterPerformanceTest.class, FloatTextureTest.class, FogTest.class, FrameBufferCubemapTest.class, FrameBufferTest.class, FramebufferToTextureTest.class, FullscreenTest.class, Gdx2DTest.class, GestureDetectorTest.class, GL30Texture3DTest.class, GLES30Test.class, GL31IndirectDrawingIndexedTest.class, GL31IndirectDrawingNonIndexedTest.class, GL31FrameBufferMultisampleTest.class, GL31ProgramIntrospectionTest.class, GL32AdvancedBlendingTest.class, GL32DebugControlTest.class, GL32MultipleRenderTargetsBlendingTest.class, GL32OffsetElementsTest.class, GLProfilerErrorTest.class, GroupCullingTest.class, GroupFadeTest.class, GroupTest.class, HeightMapTest.class, HelloTriangle.class, HexagonalTiledMapTest.class, I18NMessageTest.class, I18NSimpleMessageTest.class, ImageScaleTest.class, ImageTest.class, ImmediateModeRendererTest.class, IndexBufferObjectShaderTest.class, InputTest.class, InstancedRenderingTest.class, IntegerBitmapFontTest.class, InterpolationTest.class, IntersectorOverlapConvexPolygonsTest.class, InverseKinematicsTest.class, IsometricTileTest.class, KinematicBodyTest.class, KTXTest.class, LabelScaleTest.class, LabelTest.class, LifeCycleTest.class, LightsTest.class, MaterialTest.class, MaterialEmissiveTest.class, MatrixJNITest.class, MeshBuilderTest.class, MeshShaderTest.class, MeshWithCustomAttributesTest.class, MipMapTest.class, ModelTest.class, ModelCacheTest.class, ModelInstancedRenderingTest.class, MoveSpriteExample.class, MultipleRenderTargetTest.class, MultitouchTest.class, MusicTest.class, NetAPITest.class, NinePatchTest.class, NoncontinuousRenderingTest.class, NonPowerOfTwoTest.class, OctreeTest.class, OnscreenKeyboardTest.class, OrientedBoundingBoxTest.class, PathTest.class, ParallaxTest.class, ParticleControllerInfluencerSingleTest.class, ParticleControllerTest.class, ParticleEmitterTest.class, ParticleEmittersTest.class, ParticleEmitterChangeSpriteTest.class, PixelBufferObjectTest.class, PixelsPerInchTest.class, PixmapBlendingTest.class, PixmapPackerTest.class, PixmapPackerIOTest.class, PixmapTest.class, PolarAccelerationTest.class, PolygonRegionTest.class, PolygonSpriteTest.class, PreferencesTest.class, ProjectTest.class, ProjectiveTextureTest.class, ReflectionTest.class, ReflectionCorrectnessTest.class, RotationTest.class, RunnablePostTest.class, Scene2dTest.class, ScrollPane2Test.class, ScrollPaneScrollBarsTest.class, ScrollPaneTest.class, ScrollPaneTextAreaTest.class, ScrollPaneWithDynamicScrolling.class, SelectTest.class, SensorTest.class, ShaderCollectionTest.class, ShaderMultitextureTest.class, ShaderTest.class, ShadowMappingTest.class, ShapeRendererTest.class, ShapeRendererAlphaTest.class, SimpleAnimationTest.class, SimpleDecalTest.class, SimpleStageCullingTest.class, SimpleVertexShader.class, SkeletonTest.class, SoftKeyboardTest.class, SortedSpriteTest.class, SoundTest.class, SpriteBatchRotationTest.class, SpriteBatchShaderTest.class, SpriteBatchTest.class, SpriteCacheOffsetTest.class, SpriteCacheTest.class, StageDebugTest.class, StagePerformanceTest.class, StageTest.class, SuperKoalio.class, SystemCursorTest.class, TableLayoutTest.class, TableTest.class, TangentialAccelerationTest.class, TextAreaTest.class, TextAreaTest2.class, TextAreaTest3.class, TextButtonTest.class, TextInputDialogTest.class, TextureAtlasTest.class, TextureArrayTest.class, TextureDataTest.class, TextureDownloadTest.class, TextureFormatTest.class, TextureRegion3DTest.class, TideMapAssetManagerTest.class, TideMapDirectLoaderTest.class, TileTest.class, TiledMapAnimationLoadingTest.class, TiledMapAssetManagerTest.class, TiledMapGroupLayerTest.class, TiledMapAtlasAssetManagerTest.class, TiledMapDirectLoaderTest.class, TiledMapModifiedExternalTilesetTest.class, TiledMapObjectLoadingTest.class, TiledMapBench.class, TiledMapLayerOffsetTest.class, TimerTest.class, TimeUtilsTest.class, TouchpadTest.class, TreeTest.class, UISimpleTest.class, UITest.class, UniformBufferObjectsTest.class, UtfFontTest.class, VBOWithVAOPerformanceTest.class, Vector2dTest.class, VertexArrayTest.class, VertexBufferObjectShaderTest.class, VibratorTest.class, ViewportTest1.class, ViewportTest2.class, ViewportTest3.class, YDownTest.class, FreeTypeFontLoaderTest.class, FreeTypeDisposeTest.class, FreeTypeMetricsTest.class, FreeTypeIncrementalTest.class, FreeTypePackTest.class, FreeTypeAtlasTest.class, FreeTypeTest.class, InternationalFontsTest.class, PngTest.class, JsonTest.class, QuadTreeFloatTest.class, QuadTreeFloatNearestTest.class // @on // SoundTouchTest.class, Mpg123Test.class, WavTest.class, FreeTypeTest.class, // VorbisTest.class )); static final ObjectMap<String, String> obfuscatedToOriginal = new ObjectMap(); static final ObjectMap<String, String> originalToObfuscated = new ObjectMap(); static { InputStream mappingInput = GdxTests.class.getResourceAsStream("/mapping.txt"); if (mappingInput != null) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(mappingInput), 512); while (true) { String line = reader.readLine(); if (line == null) break; if (line.startsWith(" ")) continue; String[] split = line.replace(":", "").split(" -> "); String original = split[0]; if (original.indexOf('.') != -1) original = original.substring(original.lastIndexOf('.') + 1); originalToObfuscated.put(original, split[1]); obfuscatedToOriginal.put(split[1], original); } reader.close(); } catch (Exception ex) { System.out.println("GdxTests: Error reading mapping file: mapping.txt"); ex.printStackTrace(); } finally { StreamUtils.closeQuietly(reader); } } } public static List<String> getNames () { List<String> names = new ArrayList<String>(tests.size()); for (Class clazz : tests) names.add(obfuscatedToOriginal.get(clazz.getSimpleName(), clazz.getSimpleName())); Collections.sort(names); return names; } public static Class<? extends GdxTest> forName (String name) { name = originalToObfuscated.get(name, name); for (Class clazz : tests) if (clazz.getSimpleName().equals(name)) return clazz; return null; } public static GdxTest newTest (String testName) { testName = originalToObfuscated.get(testName, testName); try { return forName(testName).newInstance(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ /* * Copyright 2010 Mario Zechner ([email protected]), Nathan Sweet ([email protected]) * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package com.badlogic.gdx.tests.utils; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.badlogic.gdx.tests.*; import com.badlogic.gdx.tests.bench.TiledMapBench; import com.badlogic.gdx.tests.conformance.AudioSoundAndMusicIsolationTest; import com.badlogic.gdx.tests.conformance.DisplayModeTest; import com.badlogic.gdx.tests.examples.MoveSpriteExample; import com.badlogic.gdx.tests.extensions.FreeTypeAtlasTest; import com.badlogic.gdx.tests.extensions.FreeTypeDisposeTest; import com.badlogic.gdx.tests.extensions.FreeTypeFontLoaderTest; import com.badlogic.gdx.tests.extensions.FreeTypeIncrementalTest; import com.badlogic.gdx.tests.extensions.FreeTypeMetricsTest; import com.badlogic.gdx.tests.extensions.FreeTypePackTest; import com.badlogic.gdx.tests.extensions.FreeTypeTest; import com.badlogic.gdx.tests.extensions.InternationalFontsTest; import com.badlogic.gdx.tests.gles3.NonPowerOfTwoTest; import com.badlogic.gdx.tests.gles3.UniformBufferObjectsTest; import com.badlogic.gdx.tests.math.CollisionPlaygroundTest; import com.badlogic.gdx.tests.math.OctreeTest; import com.badlogic.gdx.tests.g3d.Animation3DTest; import com.badlogic.gdx.tests.g3d.AnisotropyTest; import com.badlogic.gdx.tests.g3d.Basic3DSceneTest; import com.badlogic.gdx.tests.g3d.Basic3DTest; import com.badlogic.gdx.tests.g3d.Benchmark3DTest; import com.badlogic.gdx.tests.g3d.FogTest; import com.badlogic.gdx.tests.g3d.FrameBufferCubemapTest; import com.badlogic.gdx.tests.g3d.HeightMapTest; import com.badlogic.gdx.tests.g3d.LightsTest; import com.badlogic.gdx.tests.g3d.MaterialEmissiveTest; import com.badlogic.gdx.tests.g3d.MaterialTest; import com.badlogic.gdx.tests.g3d.MeshBuilderTest; import com.badlogic.gdx.tests.g3d.ModelCacheTest; import com.badlogic.gdx.tests.g3d.ModelTest; import com.badlogic.gdx.tests.g3d.MultipleRenderTargetTest; import com.badlogic.gdx.tests.g3d.ParticleControllerInfluencerSingleTest; import com.badlogic.gdx.tests.g3d.ParticleControllerTest; import com.badlogic.gdx.tests.g3d.PolarAccelerationTest; import com.badlogic.gdx.tests.g3d.ShaderCollectionTest; import com.badlogic.gdx.tests.g3d.ShaderTest; import com.badlogic.gdx.tests.g3d.ShadowMappingTest; import com.badlogic.gdx.tests.g3d.SkeletonTest; import com.badlogic.gdx.tests.g3d.TangentialAccelerationTest; import com.badlogic.gdx.tests.g3d.TextureArrayTest; import com.badlogic.gdx.tests.g3d.TextureRegion3DTest; import com.badlogic.gdx.tests.g3d.utils.DefaultTextureBinderTest; import com.badlogic.gdx.tests.gles2.HelloTriangle; import com.badlogic.gdx.tests.gles2.SimpleVertexShader; import com.badlogic.gdx.tests.gles2.VertexArrayTest; import com.badlogic.gdx.tests.gles3.GL30Texture3DTest; import com.badlogic.gdx.tests.gles3.InstancedRenderingTest; import com.badlogic.gdx.tests.gles3.ModelInstancedRenderingTest; import com.badlogic.gdx.tests.gles3.PixelBufferObjectTest; import com.badlogic.gdx.tests.gles31.GL31FrameBufferMultisampleTest; import com.badlogic.gdx.tests.gles31.GL31IndirectDrawingIndexedTest; import com.badlogic.gdx.tests.gles31.GL31IndirectDrawingNonIndexedTest; import com.badlogic.gdx.tests.gles31.GL31ProgramIntrospectionTest; import com.badlogic.gdx.tests.gles32.GL32AdvancedBlendingTest; import com.badlogic.gdx.tests.gles32.GL32DebugControlTest; import com.badlogic.gdx.tests.gles32.GL32MultipleRenderTargetsBlendingTest; import com.badlogic.gdx.tests.gles32.GL32OffsetElementsTest; import com.badlogic.gdx.tests.math.collision.OrientedBoundingBoxTest; import com.badlogic.gdx.tests.net.NetAPITest; import com.badlogic.gdx.tests.superkoalio.SuperKoalio; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.StreamUtils; /** List of GdxTest classes. To be used by the test launchers. If you write your own test, add it in here! * * @author [email protected] */ public class GdxTests { public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( // @off IssueTest.class, AccelerometerTest.class, ActionSequenceTest.class, ActionTest.class, Affine2Test.class, AlphaTest.class, Animation3DTest.class, AnimationTest.class, AnisotropyTest.class, AnnotationTest.class, AssetManagerTest.class, AtlasIssueTest.class, AudioChangeDeviceTest.class, AudioDeviceTest.class, AudioRecorderTest.class, AudioSoundAndMusicIsolationTest.class, Basic3DSceneTest.class, Basic3DTest.class, Benchmark3DTest.class, BigMeshTest.class, BitmapFontAlignmentTest.class, BitmapFontDistanceFieldTest.class, BitmapFontFlipTest.class, BitmapFontMetricsTest.class, BitmapFontTest.class, BitmapFontAtlasRegionTest.class, BlitTest.class, Box2DTest.class, Box2DTestCollection.class, Bresenham2Test.class, BufferUtilsTest.class, BulletTestCollection.class, ClipboardTest.class, CollectionsTest.class, CollisionPlaygroundTest.class, ColorTest.class, ContainerTest.class, CoordinatesTest.class, CpuSpriteBatchTest.class, CullTest.class, CursorTest.class, DecalTest.class, DefaultTextureBinderTest.class, DelaunayTriangulatorTest.class, DeltaTimeTest.class, DirtyRenderingTest.class, DisplayModeTest.class, DownloadTest.class, DragAndDropTest.class, ETC1Test.class, // EarClippingTriangulatorTest.class, EdgeDetectionTest.class, ExitTest.class, ExternalMusicTest.class, FilesTest.class, FilterPerformanceTest.class, FloatTextureTest.class, FogTest.class, FrameBufferCubemapTest.class, FrameBufferTest.class, FramebufferToTextureTest.class, FullscreenTest.class, Gdx2DTest.class, GestureDetectorTest.class, GL30Texture3DTest.class, GLES30Test.class, GL31IndirectDrawingIndexedTest.class, GL31IndirectDrawingNonIndexedTest.class, GL31FrameBufferMultisampleTest.class, GL31ProgramIntrospectionTest.class, GL32AdvancedBlendingTest.class, GL32DebugControlTest.class, GL32MultipleRenderTargetsBlendingTest.class, GL32OffsetElementsTest.class, GLProfilerErrorTest.class, GroupCullingTest.class, GroupFadeTest.class, GroupTest.class, HeightMapTest.class, HelloTriangle.class, HexagonalTiledMapTest.class, I18NMessageTest.class, I18NSimpleMessageTest.class, ImageScaleTest.class, ImageTest.class, ImmediateModeRendererTest.class, IndexBufferObjectShaderTest.class, InputTest.class, InstancedRenderingTest.class, IntegerBitmapFontTest.class, InterpolationTest.class, IntersectorOverlapConvexPolygonsTest.class, InverseKinematicsTest.class, IsometricTileTest.class, KinematicBodyTest.class, KTXTest.class, LabelScaleTest.class, LabelTest.class, LifeCycleTest.class, LightsTest.class, MaterialTest.class, MaterialEmissiveTest.class, MatrixJNITest.class, MeshBuilderTest.class, MeshShaderTest.class, MeshWithCustomAttributesTest.class, MipMapTest.class, ModelTest.class, ModelCacheTest.class, ModelInstancedRenderingTest.class, MoveSpriteExample.class, MultipleRenderTargetTest.class, MultitouchTest.class, MusicTest.class, NetAPITest.class, NinePatchTest.class, NoncontinuousRenderingTest.class, NonPowerOfTwoTest.class, OctreeTest.class, OnscreenKeyboardTest.class, OrientedBoundingBoxTest.class, PathTest.class, ParallaxTest.class, ParticleControllerInfluencerSingleTest.class, ParticleControllerTest.class, ParticleEmitterTest.class, ParticleEmittersTest.class, ParticleEmitterChangeSpriteTest.class, PixelBufferObjectTest.class, PixelsPerInchTest.class, PixmapBlendingTest.class, PixmapPackerTest.class, PixmapPackerIOTest.class, PixmapTest.class, PolarAccelerationTest.class, PolygonRegionTest.class, PolygonSpriteTest.class, PreferencesTest.class, ProjectTest.class, ProjectiveTextureTest.class, ReflectionTest.class, ReflectionCorrectnessTest.class, RotationTest.class, RunnablePostTest.class, Scene2dTest.class, ScrollPane2Test.class, ScrollPaneScrollBarsTest.class, ScrollPaneTest.class, ScrollPaneTextAreaTest.class, ScrollPaneWithDynamicScrolling.class, SelectTest.class, SensorTest.class, ShaderCollectionTest.class, ShaderMultitextureTest.class, ShaderTest.class, ShadowMappingTest.class, ShapeRendererTest.class, ShapeRendererAlphaTest.class, SimpleAnimationTest.class, SimpleDecalTest.class, SimpleStageCullingTest.class, SimpleVertexShader.class, SkeletonTest.class, SoftKeyboardTest.class, SortedSpriteTest.class, SoundTest.class, SpriteBatchRotationTest.class, SpriteBatchShaderTest.class, SpriteBatchTest.class, SpriteCacheOffsetTest.class, SpriteCacheTest.class, StageDebugTest.class, StagePerformanceTest.class, StageTest.class, SuperKoalio.class, SystemCursorTest.class, TableLayoutTest.class, TableTest.class, TangentialAccelerationTest.class, TextAreaTest.class, TextAreaTest2.class, TextAreaTest3.class, TextButtonTest.class, TextInputDialogTest.class, TextureAtlasTest.class, TextureArrayTest.class, TextureDataTest.class, TextureDownloadTest.class, TextureFormatTest.class, TextureRegion3DTest.class, TideMapAssetManagerTest.class, TideMapDirectLoaderTest.class, TileTest.class, TiledMapAnimationLoadingTest.class, TiledMapAssetManagerTest.class, TiledMapGroupLayerTest.class, TiledMapAtlasAssetManagerTest.class, TiledMapDirectLoaderTest.class, TiledMapModifiedExternalTilesetTest.class, TiledMapObjectLoadingTest.class, TiledMapObjectPropertyTest.class, TiledMapBench.class, TiledMapLayerOffsetTest.class, TimerTest.class, TimeUtilsTest.class, TouchpadTest.class, TreeTest.class, UISimpleTest.class, UITest.class, UniformBufferObjectsTest.class, UtfFontTest.class, VBOWithVAOPerformanceTest.class, Vector2dTest.class, VertexArrayTest.class, VertexBufferObjectShaderTest.class, VibratorTest.class, ViewportTest1.class, ViewportTest2.class, ViewportTest3.class, YDownTest.class, FreeTypeFontLoaderTest.class, FreeTypeDisposeTest.class, FreeTypeMetricsTest.class, FreeTypeIncrementalTest.class, FreeTypePackTest.class, FreeTypeAtlasTest.class, FreeTypeTest.class, InternationalFontsTest.class, PngTest.class, JsonTest.class, QuadTreeFloatTest.class, QuadTreeFloatNearestTest.class // @on // SoundTouchTest.class, Mpg123Test.class, WavTest.class, FreeTypeTest.class, // VorbisTest.class )); static final ObjectMap<String, String> obfuscatedToOriginal = new ObjectMap(); static final ObjectMap<String, String> originalToObfuscated = new ObjectMap(); static { InputStream mappingInput = GdxTests.class.getResourceAsStream("/mapping.txt"); if (mappingInput != null) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(mappingInput), 512); while (true) { String line = reader.readLine(); if (line == null) break; if (line.startsWith(" ")) continue; String[] split = line.replace(":", "").split(" -> "); String original = split[0]; if (original.indexOf('.') != -1) original = original.substring(original.lastIndexOf('.') + 1); originalToObfuscated.put(original, split[1]); obfuscatedToOriginal.put(split[1], original); } reader.close(); } catch (Exception ex) { System.out.println("GdxTests: Error reading mapping file: mapping.txt"); ex.printStackTrace(); } finally { StreamUtils.closeQuietly(reader); } } } public static List<String> getNames () { List<String> names = new ArrayList<String>(tests.size()); for (Class clazz : tests) names.add(obfuscatedToOriginal.get(clazz.getSimpleName(), clazz.getSimpleName())); Collections.sort(names); return names; } public static Class<? extends GdxTest> forName (String name) { name = originalToObfuscated.get(name, name); for (Class clazz : tests) if (clazz.getSimpleName().equals(name)) return clazz; return null; } public static GdxTest newTest (String testName) { testName = originalToObfuscated.get(testName, testName); try { return forName(testName).newInstance(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; } }
1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/ShadowMappingTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.g3d; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g3d.Environment; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.ModelInstance; import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; import com.badlogic.gdx.graphics.g3d.utils.CameraInputController; import com.badlogic.gdx.graphics.g3d.utils.DepthShaderProvider; import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder; import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; public class ShadowMappingTest extends GdxTest { PerspectiveCamera cam; CameraInputController camController; ModelBatch modelBatch; Model model; ModelInstance instance; Environment environment; DirectionalShadowLight shadowLight; ModelBatch shadowBatch; @Override public void create () { modelBatch = new ModelBatch(); environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f)); environment .add((shadowLight = new DirectionalShadowLight(1024, 1024, 30f, 30f, 1f, 100f)).set(0.8f, 0.8f, 0.8f, -1f, -.8f, -.2f)); environment.shadowMap = shadowLight; cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(0f, 7f, 10f); cam.lookAt(0, 0, 0); cam.near = 1f; cam.far = 50f; cam.update(); ModelBuilder modelBuilder = new ModelBuilder(); modelBuilder.begin(); MeshPartBuilder mpb = modelBuilder.part("parts", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal | Usage.ColorUnpacked, new Material(ColorAttribute.createDiffuse(Color.WHITE))); mpb.setColor(1f, 1f, 1f, 1f); mpb.box(0, -1.5f, 0, 10, 1, 10); mpb.setColor(1f, 0f, 1f, 1f); mpb.sphere(2f, 2f, 2f, 10, 10); model = modelBuilder.end(); instance = new ModelInstance(model); shadowBatch = new ModelBatch(new DepthShaderProvider()); Gdx.input.setInputProcessor(camController = new CameraInputController(cam)); } @Override public void render () { camController.update(); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); shadowLight.begin(Vector3.Zero, cam.direction); shadowBatch.begin(shadowLight.getCamera()); shadowBatch.render(instance); shadowBatch.end(); shadowLight.end(); modelBatch.begin(cam); modelBatch.render(instance, environment); modelBatch.end(); } @Override public void dispose () { modelBatch.dispose(); model.dispose(); } public boolean needsGL20 () { return true; } public void resume () { } public void resize (int width, int height) { } public void pause () { } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.g3d; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g3d.Environment; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.ModelInstance; import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; import com.badlogic.gdx.graphics.g3d.utils.CameraInputController; import com.badlogic.gdx.graphics.g3d.utils.DepthShaderProvider; import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder; import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; public class ShadowMappingTest extends GdxTest { PerspectiveCamera cam; CameraInputController camController; ModelBatch modelBatch; Model model; ModelInstance instance; Environment environment; DirectionalShadowLight shadowLight; ModelBatch shadowBatch; @Override public void create () { modelBatch = new ModelBatch(); environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f)); environment .add((shadowLight = new DirectionalShadowLight(1024, 1024, 30f, 30f, 1f, 100f)).set(0.8f, 0.8f, 0.8f, -1f, -.8f, -.2f)); environment.shadowMap = shadowLight; cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(0f, 7f, 10f); cam.lookAt(0, 0, 0); cam.near = 1f; cam.far = 50f; cam.update(); ModelBuilder modelBuilder = new ModelBuilder(); modelBuilder.begin(); MeshPartBuilder mpb = modelBuilder.part("parts", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal | Usage.ColorUnpacked, new Material(ColorAttribute.createDiffuse(Color.WHITE))); mpb.setColor(1f, 1f, 1f, 1f); mpb.box(0, -1.5f, 0, 10, 1, 10); mpb.setColor(1f, 0f, 1f, 1f); mpb.sphere(2f, 2f, 2f, 10, 10); model = modelBuilder.end(); instance = new ModelInstance(model); shadowBatch = new ModelBatch(new DepthShaderProvider()); Gdx.input.setInputProcessor(camController = new CameraInputController(cam)); } @Override public void render () { camController.update(); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); shadowLight.begin(Vector3.Zero, cam.direction); shadowBatch.begin(shadowLight.getCamera()); shadowBatch.render(instance); shadowBatch.end(); shadowLight.end(); modelBatch.begin(cam); modelBatch.render(instance, environment); modelBatch.end(); } @Override public void dispose () { modelBatch.dispose(); model.dispose(); } public boolean needsGL20 () { return true; } public void resume () { } public void resize (int width, int height) { } public void pause () { } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/com/badlogic/gdx/utils/reflect/Constructor.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils.reflect; import com.badlogic.gwtref.client.Parameter; /** Provides information about, and access to, a single constructor for a Class. * @author nexsoftware */ public final class Constructor { private final com.badlogic.gwtref.client.Constructor constructor; Constructor (com.badlogic.gwtref.client.Constructor constructor) { this.constructor = constructor; } /** Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor. */ public Class[] getParameterTypes () { Parameter[] parameters = constructor.getParameters(); Class[] parameterTypes = new Class[parameters.length]; for (int i = 0, j = parameters.length; i < j; i++) { parameterTypes[i] = parameters[i].getClazz(); } return parameterTypes; } /** Returns the Class object representing the class or interface that declares the constructor. */ public Class getDeclaringClass () { return constructor.getEnclosingType(); } public boolean isAccessible () { return constructor.isPublic(); } public void setAccessible (boolean accessible) { // NOOP in GWT } /** Uses the constructor to create and initialize a new instance of the constructor's declaring class, with the supplied * initialization parameters. */ public Object newInstance (Object... args) throws ReflectionException { try { return constructor.newInstance(args); } catch (IllegalArgumentException e) { throw new ReflectionException("Illegal argument(s) supplied to constructor for class: " + getDeclaringClass().getName(), e); } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils.reflect; import com.badlogic.gwtref.client.Parameter; /** Provides information about, and access to, a single constructor for a Class. * @author nexsoftware */ public final class Constructor { private final com.badlogic.gwtref.client.Constructor constructor; Constructor (com.badlogic.gwtref.client.Constructor constructor) { this.constructor = constructor; } /** Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor. */ public Class[] getParameterTypes () { Parameter[] parameters = constructor.getParameters(); Class[] parameterTypes = new Class[parameters.length]; for (int i = 0, j = parameters.length; i < j; i++) { parameterTypes[i] = parameters[i].getClazz(); } return parameterTypes; } /** Returns the Class object representing the class or interface that declares the constructor. */ public Class getDeclaringClass () { return constructor.getEnclosingType(); } public boolean isAccessible () { return constructor.isPublic(); } public void setAccessible (boolean accessible) { // NOOP in GWT } /** Uses the constructor to create and initialize a new instance of the constructor's declaring class, with the supplied * initialization parameters. */ public Object newInstance (Object... args) throws ReflectionException { try { return constructor.newInstance(args); } catch (IllegalArgumentException e) { throw new ReflectionException("Illegal argument(s) supplied to constructor for class: " + getDeclaringClass().getName(), e); } } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-box2d/gdx-box2d-gwt/src/com/badlogic/gdx/physics/box2d/gwt/emu/org/jbox2d/particle/ParticleColor.java
package org.jbox2d.particle; import org.jbox2d.common.Color3f; /** Small color object for each particle * * @author dmurph */ public class ParticleColor { public byte r, g, b, a; public ParticleColor () { r = (byte)127; g = (byte)127; b = (byte)127; a = (byte)50; } public ParticleColor (byte r, byte g, byte b, byte a) { set(r, g, b, a); } public ParticleColor (Color3f color) { set(color); } public void set (Color3f color) { r = (byte)(255 * color.x); g = (byte)(255 * color.y); b = (byte)(255 * color.z); a = (byte)255; } public void set (ParticleColor color) { r = color.r; g = color.g; b = color.b; a = color.a; } public boolean isZero () { return r == 0 && g == 0 && b == 0 && a == 0; } public void set (byte r, byte g, byte b, byte a) { this.r = r; this.g = g; this.b = b; this.a = a; } }
package org.jbox2d.particle; import org.jbox2d.common.Color3f; /** Small color object for each particle * * @author dmurph */ public class ParticleColor { public byte r, g, b, a; public ParticleColor () { r = (byte)127; g = (byte)127; b = (byte)127; a = (byte)50; } public ParticleColor (byte r, byte g, byte b, byte a) { set(r, g, b, a); } public ParticleColor (Color3f color) { set(color); } public void set (Color3f color) { r = (byte)(255 * color.x); g = (byte)(255 * color.y); b = (byte)(255 * color.z); a = (byte)255; } public void set (ParticleColor color) { r = color.r; g = color.g; b = color.b; a = color.a; } public boolean isZero () { return r == 0 && g == 0 && b == 0 && a == 0; } public void set (byte r, byte g, byte b, byte a) { this.r = r; this.g = g; this.b = b; this.a = a; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/MultitouchTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Peripheral; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.TimeUtils; import com.badlogic.gdx.utils.viewport.ScreenViewport; public class MultitouchTest extends GdxTest { ShapeRenderer renderer; ScreenViewport viewport; OrthographicCamera camera; long startTime = TimeUtils.nanoTime(); Color[] colors = {Color.RED, Color.BLUE, Color.GREEN, Color.WHITE, Color.PINK, Color.ORANGE, Color.YELLOW, Color.MAGENTA, Color.CYAN, Color.LIGHT_GRAY, Color.GRAY, Color.DARK_GRAY}; Vector2 tp = new Vector2(); @Override public void render () { Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); camera.update(); renderer.setProjectionMatrix(camera.combined); renderer.begin(ShapeType.Filled); int size = Math.max(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) / 10; for (int i = 0; i < 10; i++) { if (!Gdx.input.isTouched(i)) continue; viewport.unproject(tp.set(Gdx.input.getX(i), Gdx.input.getY(i))); Color color = colors[i % colors.length]; renderer.setColor(color); float sSize = size * Gdx.input.getPressure(i); renderer.triangle(tp.x, tp.y + sSize, tp.x + sSize, tp.y - sSize, tp.x - sSize, tp.y - sSize); } renderer.end(); } @Override public void create () { Gdx.app.log("Multitouch", "multitouch supported: " + Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen)); renderer = new ShapeRenderer(); camera = new OrthographicCamera(); viewport = new ScreenViewport(camera); Gdx.input.setInputProcessor(this); } @Override public void resize (int width, int height) { viewport.update(width, height); } @Override public void dispose () { renderer.dispose(); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Peripheral; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.TimeUtils; import com.badlogic.gdx.utils.viewport.ScreenViewport; public class MultitouchTest extends GdxTest { ShapeRenderer renderer; ScreenViewport viewport; OrthographicCamera camera; long startTime = TimeUtils.nanoTime(); Color[] colors = {Color.RED, Color.BLUE, Color.GREEN, Color.WHITE, Color.PINK, Color.ORANGE, Color.YELLOW, Color.MAGENTA, Color.CYAN, Color.LIGHT_GRAY, Color.GRAY, Color.DARK_GRAY}; Vector2 tp = new Vector2(); @Override public void render () { Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); camera.update(); renderer.setProjectionMatrix(camera.combined); renderer.begin(ShapeType.Filled); int size = Math.max(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) / 10; for (int i = 0; i < 10; i++) { if (!Gdx.input.isTouched(i)) continue; viewport.unproject(tp.set(Gdx.input.getX(i), Gdx.input.getY(i))); Color color = colors[i % colors.length]; renderer.setColor(color); float sSize = size * Gdx.input.getPressure(i); renderer.triangle(tp.x, tp.y + sSize, tp.x + sSize, tp.y - sSize, tp.x - sSize, tp.y - sSize); } renderer.end(); } @Override public void create () { Gdx.app.log("Multitouch", "multitouch supported: " + Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen)); renderer = new ShapeRenderer(); camera = new OrthographicCamera(); viewport = new ScreenViewport(camera); Gdx.input.setInputProcessor(this); } @Override public void resize (int width, int height) { viewport.update(width, height); } @Override public void dispose () { renderer.dispose(); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/utils/async/AsyncExecutor.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils.async; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; /** Allows asnynchronous execution of {@link AsyncTask} instances on a separate thread. Needs to be disposed via a call to * {@link #dispose()} when no longer used, in which case the executor waits for running tasks to finish. Scheduled but not yet * running tasks will not be executed. * @author badlogic */ public class AsyncExecutor implements Disposable { private final ExecutorService executor; /** Creates a new AsynchExecutor with the name "AsynchExecutor-Thread". */ public AsyncExecutor (int maxConcurrent) { this(maxConcurrent, "AsynchExecutor-Thread"); } /** Creates a new AsynchExecutor that allows maxConcurrent {@link Runnable} instances to run in parallel. * @param maxConcurrent * @param name The name of the threads. */ public AsyncExecutor (int maxConcurrent, final String name) { executor = Executors.newFixedThreadPool(maxConcurrent, new ThreadFactory() { @Override public Thread newThread (Runnable r) { Thread thread = new Thread(r, name); thread.setDaemon(true); return thread; } }); } /** Submits a {@link Runnable} to be executed asynchronously. If maxConcurrent runnables are already running, the runnable will * be queued. * @param task the task to execute asynchronously */ public <T> AsyncResult<T> submit (final AsyncTask<T> task) { if (executor.isShutdown()) { throw new GdxRuntimeException("Cannot run tasks on an executor that has been shutdown (disposed)"); } return new AsyncResult(executor.submit(new Callable<T>() { @Override public T call () throws Exception { return task.call(); } })); } /** Waits for running {@link AsyncTask} instances to finish, then destroys any resources like threads. Can not be used after * this method is called. */ @Override public void dispose () { executor.shutdown(); try { executor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new GdxRuntimeException("Couldn't shutdown loading thread", e); } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.utils.async; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; /** Allows asnynchronous execution of {@link AsyncTask} instances on a separate thread. Needs to be disposed via a call to * {@link #dispose()} when no longer used, in which case the executor waits for running tasks to finish. Scheduled but not yet * running tasks will not be executed. * @author badlogic */ public class AsyncExecutor implements Disposable { private final ExecutorService executor; /** Creates a new AsynchExecutor with the name "AsynchExecutor-Thread". */ public AsyncExecutor (int maxConcurrent) { this(maxConcurrent, "AsynchExecutor-Thread"); } /** Creates a new AsynchExecutor that allows maxConcurrent {@link Runnable} instances to run in parallel. * @param maxConcurrent * @param name The name of the threads. */ public AsyncExecutor (int maxConcurrent, final String name) { executor = Executors.newFixedThreadPool(maxConcurrent, new ThreadFactory() { @Override public Thread newThread (Runnable r) { Thread thread = new Thread(r, name); thread.setDaemon(true); return thread; } }); } /** Submits a {@link Runnable} to be executed asynchronously. If maxConcurrent runnables are already running, the runnable will * be queued. * @param task the task to execute asynchronously */ public <T> AsyncResult<T> submit (final AsyncTask<T> task) { if (executor.isShutdown()) { throw new GdxRuntimeException("Cannot run tasks on an executor that has been shutdown (disposed)"); } return new AsyncResult(executor.submit(new Callable<T>() { @Override public T call () throws Exception { return task.call(); } })); } /** Waits for running {@link AsyncTask} instances to finish, then destroys any resources like threads. Can not be used after * this method is called. */ @Override public void dispose () { executor.shutdown(); try { executor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new GdxRuntimeException("Couldn't shutdown loading thread", e); } } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/shadows/system/realistic/MainShaderProvider.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.g3d.shadows.system.realistic; import com.badlogic.gdx.graphics.g3d.Renderable; import com.badlogic.gdx.graphics.g3d.Shader; import com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider; import com.badlogic.gdx.utils.GdxRuntimeException; /** @author realitix */ public class MainShaderProvider extends BaseShaderProvider { public final MainShader.Config config; public MainShaderProvider (final MainShader.Config config) { if (config == null) throw new GdxRuntimeException("MainShaderProvider needs config"); this.config = config; } @Override protected Shader createShader (final Renderable renderable) { return new MainShader(renderable, config); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.g3d.shadows.system.realistic; import com.badlogic.gdx.graphics.g3d.Renderable; import com.badlogic.gdx.graphics.g3d.Shader; import com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider; import com.badlogic.gdx.utils.GdxRuntimeException; /** @author realitix */ public class MainShaderProvider extends BaseShaderProvider { public final MainShader.Config config; public MainShaderProvider (final MainShader.Config config) { if (config == null) throw new GdxRuntimeException("MainShaderProvider needs config"); this.config = config; } @Override protected Shader createShader (final Renderable renderable) { return new MainShader(renderable, config); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/linearmath/com/badlogic/gdx/physics/bullet/linearmath/SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.linearmath; public class SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t { private transient long swigCPtr; protected SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t (long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t () { swigCPtr = 0; } protected static long getCPtr (SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.linearmath; public class SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t { private transient long swigCPtr; protected SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t (long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t () { swigCPtr = 0; } protected static long getCPtr (SWIGTYPE_p_btAlignedObjectArrayT_btConvexHullComputer__Edge_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-tools/src/com/badlogic/gdx/tools/flame/DynamicsInfluencerPanel.java
package com.badlogic.gdx.tools.flame; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableModel; import com.badlogic.gdx.graphics.g3d.particles.ParticleController; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.BrownianAcceleration; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.CentripetalAcceleration; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.FaceDirection; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.PolarAcceleration; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.Rotational3D; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.TangentialAcceleration; import com.badlogic.gdx.tools.flame.FlameMain.ControllerType; import com.badlogic.gdx.utils.Array; /** @author Inferno */ public class DynamicsInfluencerPanel extends InfluencerPanel<DynamicsInfluencer> { private static final String VEL_TYPE_ROTATIONAL_2D = "Angular Velocity 2D", VEL_TYPE_ROTATIONAL_3D = "Angular Velocity 3D", VEL_TYPE_CENTRIPETAL = "Centripetal", VEL_TYPE_TANGENTIAL = "Tangential", VEL_TYPE_POLAR = "Polar", VEL_TYPE_BROWNIAN = "Brownian", VEL_TYPE_FACE = "Face"; protected class VelocityWrapper { public DynamicsModifier velocityValue; public boolean isActive; public VelocityWrapper (DynamicsModifier value, boolean isActive) { this.velocityValue = value; this.isActive = isActive; } } JComboBox velocityBox; JTable velocityTable; DefaultTableModel velocityTableModel; JPanel selectedVelocityPanel; AngularVelocityPanel angularVelocityPanel; StrengthVelocityPanel strengthVelocityPanel; ParticleValuePanel emptyPanel; Array<VelocityWrapper> velocities; public DynamicsInfluencerPanel (FlameMain editor, DynamicsInfluencer influencer) { super(editor, influencer, "Dynamics Influencer", "Defines how the particles dynamics (acceleration, angular velocity)."); velocities = new Array<VelocityWrapper>(); setValue(value); set(influencer); } private void set (DynamicsInfluencer influencer) { // Clear for (int i = velocityTableModel.getRowCount() - 1; i >= 0; i--) { velocityTableModel.removeRow(i); } velocities.clear(); // Add for (int i = 0, c = influencer.velocities.size; i < c; ++i) { velocities.add(new VelocityWrapper((DynamicsModifier)influencer.velocities.items[i], true)); velocityTableModel.addRow(new Object[] {"Velocity " + i, true}); } DefaultComboBoxModel model = (DefaultComboBoxModel)velocityBox.getModel(); model.removeAllElements(); for (Object velocityObject : getAvailableVelocities(editor.getControllerType())) { model.addElement(velocityObject); } } private Object[] getAvailableVelocities (ControllerType type) { if (type == ControllerType.Billboard || type == ControllerType.PointSprite) { return new String[] {VEL_TYPE_ROTATIONAL_2D, VEL_TYPE_CENTRIPETAL, VEL_TYPE_TANGENTIAL, VEL_TYPE_POLAR, VEL_TYPE_BROWNIAN}; } else if (type == ControllerType.ModelInstance || type == ControllerType.ParticleController) { return new String[] {VEL_TYPE_ROTATIONAL_3D, VEL_TYPE_CENTRIPETAL, VEL_TYPE_TANGENTIAL, VEL_TYPE_POLAR, VEL_TYPE_BROWNIAN, VEL_TYPE_FACE}; } return null; } protected void initializeComponents () { super.initializeComponents(); JPanel velocitiesPanel = new JPanel(); velocitiesPanel.setLayout(new GridBagLayout()); { JPanel sideButtons = new JPanel(new GridBagLayout()); velocitiesPanel.add(sideButtons, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); { sideButtons.add(velocityBox = new JComboBox(new DefaultComboBoxModel()), new GridBagConstraints(0, -1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 6, 0), 0, 0)); } { JButton newButton = new JButton("New"); sideButtons.add(newButton, new GridBagConstraints(0, -1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 6, 0), 0, 0)); newButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { createVelocity(velocityBox.getSelectedItem()); } }); } { JButton deleteButton = new JButton("Delete"); sideButtons.add(deleteButton, new GridBagConstraints(0, -1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 6, 0), 0, 0)); deleteButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { deleteVelocity(); } }); } } JScrollPane scroll = new JScrollPane(); velocitiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); velocityTable = new JTable() { public Class getColumnClass (int column) { return column == 1 ? Boolean.class : super.getColumnClass(column); } @Override public Dimension getPreferredScrollableViewportSize () { Dimension dim = super.getPreferredScrollableViewportSize(); dim.height = getPreferredSize().height; return dim; } }; velocityTable.getTableHeader().setReorderingAllowed(false); velocityTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scroll.setViewportView(velocityTable); velocityTableModel = new DefaultTableModel(new String[0][0], new String[] {"Velocity", "Active"}); velocityTable.setModel(velocityTableModel); velocityTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged (ListSelectionEvent event) { if (event.getValueIsAdjusting()) return; velocitySelected(); } }); velocityTableModel.addTableModelListener(new TableModelListener() { public void tableChanged (TableModelEvent event) { if (event.getColumn() != 1) return; velocityChecked(event.getFirstRow(), (Boolean)velocityTable.getValueAt(event.getFirstRow(), 1)); } }); // Velocity values emptyPanel = new ParticleValuePanel(editor, "", "", true, false); strengthVelocityPanel = new StrengthVelocityPanel(editor, null, "Life", "", ""); angularVelocityPanel = new AngularVelocityPanel(editor, null, "Life", "", ""); strengthVelocityPanel.setVisible(false); angularVelocityPanel.setVisible(false); emptyPanel.setVisible(false); strengthVelocityPanel.setIsAlwayShown(true); angularVelocityPanel.setIsAlwayShown(true); emptyPanel.setIsAlwayShown(true); emptyPanel.setValue(null); // Assemble int i = 0; addContent(i++, 0, velocitiesPanel); addContent(i++, 0, strengthVelocityPanel); addContent(i++, 0, angularVelocityPanel); addContent(i++, 0, emptyPanel); } protected void velocityChecked (int index, boolean isChecked) { ParticleController controller = editor.getEmitter(); DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class); influencer.velocities.clear(); velocities.get(index).isActive = isChecked; for (VelocityWrapper wrapper : velocities) { if (wrapper.isActive) influencer.velocities.add(wrapper.velocityValue); } // Restart the effect and reinit the controller editor.restart(); } protected void velocitySelected () { // Show the velocity value panel int index = velocityTable.getSelectedRow(); if (index == -1) return; DynamicsModifier velocityValue = velocities.get(index).velocityValue; EditorPanel velocityPanel = getVelocityPanel(velocityValue); // Show the selected velocity if (selectedVelocityPanel != null && selectedVelocityPanel != velocityPanel) selectedVelocityPanel.setVisible(false); velocityPanel.setVisible(true); velocityPanel.showContent(true); selectedVelocityPanel = velocityPanel; } private EditorPanel getVelocityPanel (DynamicsModifier velocityValue) { EditorPanel panel = null; // Billboards if (velocityValue instanceof DynamicsModifier.Rotational2D) { strengthVelocityPanel.setValue((DynamicsModifier.Strength)velocityValue); strengthVelocityPanel.setName("Angular Velocity"); strengthVelocityPanel.setDescription("The angular speed around the billboard facing direction, in degrees/sec ."); panel = strengthVelocityPanel; } else if (velocityValue instanceof CentripetalAcceleration) { strengthVelocityPanel.setValue((DynamicsModifier.CentripetalAcceleration)velocityValue); strengthVelocityPanel.setName("Centripetal Acceleration"); strengthVelocityPanel.setDescription( "A directional acceleration, the direction is towards the origin (global), or towards the emitter position (local), in world units/sec2 ."); panel = strengthVelocityPanel; } else if (velocityValue instanceof TangentialAcceleration) { angularVelocityPanel.setValue((DynamicsModifier.Angular)velocityValue); angularVelocityPanel.setName("Tangetial Velocity"); angularVelocityPanel.setDescription( "A directional acceleration (axis and magnitude), the final direction is the cross product between particle position and the axis, in world units/sec2 ."); panel = angularVelocityPanel; } else if (velocityValue instanceof PolarAcceleration) { angularVelocityPanel.setValue((DynamicsModifier.Angular)velocityValue); angularVelocityPanel.setName("Polar Velocity"); angularVelocityPanel.setDescription("A directional acceleration (axis and magnitude), in world units/sec2 ."); panel = angularVelocityPanel; } else if (velocityValue instanceof BrownianAcceleration) { strengthVelocityPanel.setValue((DynamicsModifier.Strength)velocityValue); strengthVelocityPanel.setName("Brownian Velocity"); strengthVelocityPanel .setDescription("A directional acceleration which has random direction at each update, in world units/sec2."); panel = strengthVelocityPanel; } else if (velocityValue instanceof Rotational3D) { angularVelocityPanel.setValue((DynamicsModifier.Angular)velocityValue); angularVelocityPanel.setName("Angular Velocity"); angularVelocityPanel.setDescription("An angular velocity (axis and magnitude), in degree/sec2."); panel = angularVelocityPanel; } else if (velocityValue instanceof FaceDirection) { emptyPanel.setName("Face"); emptyPanel.setDescription( "Rotates the model to face its current velocity (Do not add any other angular velocity when using this)."); panel = emptyPanel; } return panel; } private DynamicsModifier createVelocityValue (Object selectedItem) { DynamicsModifier velocityValue = null; if (selectedItem == VEL_TYPE_ROTATIONAL_2D) velocityValue = new DynamicsModifier.Rotational2D(); else if (selectedItem == VEL_TYPE_ROTATIONAL_3D) velocityValue = new DynamicsModifier.Rotational3D(); else if (selectedItem == VEL_TYPE_CENTRIPETAL) velocityValue = new DynamicsModifier.CentripetalAcceleration(); else if (selectedItem == VEL_TYPE_TANGENTIAL) velocityValue = new DynamicsModifier.TangentialAcceleration(); else if (selectedItem == VEL_TYPE_POLAR) velocityValue = new DynamicsModifier.PolarAcceleration(); else if (selectedItem == VEL_TYPE_BROWNIAN) velocityValue = new DynamicsModifier.BrownianAcceleration(); else if (selectedItem == VEL_TYPE_FACE) velocityValue = new DynamicsModifier.FaceDirection(); return velocityValue; } protected void deleteVelocity () { int row = velocityTable.getSelectedRow(); if (row == -1) return; // Remove the velocity from the table ParticleController controller = editor.getEmitter(); DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class); influencer.velocities.removeValue(velocities.removeIndex(row).velocityValue, true); velocityTableModel.removeRow(row); // Restart the effect and reinit the controller editor.restart(); selectedVelocityPanel.setVisible(false); selectedVelocityPanel = null; } protected void createVelocity (Object selectedItem) { // Add the velocity to the table and to the influencer ParticleController controller = editor.getEmitter(); DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class); VelocityWrapper wrapper = new VelocityWrapper(createVelocityValue(selectedItem), true); velocities.add(wrapper); influencer.velocities.add(wrapper.velocityValue); int index = velocities.size - 1; velocityTableModel.addRow(new Object[] {"Velocity " + index, true}); // Reinit editor.restart(); // Select new velocity velocityTable.getSelectionModel().setSelectionInterval(index, index); revalidate(); repaint(); } }
package com.badlogic.gdx.tools.flame; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableModel; import com.badlogic.gdx.graphics.g3d.particles.ParticleController; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.BrownianAcceleration; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.CentripetalAcceleration; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.FaceDirection; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.PolarAcceleration; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.Rotational3D; import com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier.TangentialAcceleration; import com.badlogic.gdx.tools.flame.FlameMain.ControllerType; import com.badlogic.gdx.utils.Array; /** @author Inferno */ public class DynamicsInfluencerPanel extends InfluencerPanel<DynamicsInfluencer> { private static final String VEL_TYPE_ROTATIONAL_2D = "Angular Velocity 2D", VEL_TYPE_ROTATIONAL_3D = "Angular Velocity 3D", VEL_TYPE_CENTRIPETAL = "Centripetal", VEL_TYPE_TANGENTIAL = "Tangential", VEL_TYPE_POLAR = "Polar", VEL_TYPE_BROWNIAN = "Brownian", VEL_TYPE_FACE = "Face"; protected class VelocityWrapper { public DynamicsModifier velocityValue; public boolean isActive; public VelocityWrapper (DynamicsModifier value, boolean isActive) { this.velocityValue = value; this.isActive = isActive; } } JComboBox velocityBox; JTable velocityTable; DefaultTableModel velocityTableModel; JPanel selectedVelocityPanel; AngularVelocityPanel angularVelocityPanel; StrengthVelocityPanel strengthVelocityPanel; ParticleValuePanel emptyPanel; Array<VelocityWrapper> velocities; public DynamicsInfluencerPanel (FlameMain editor, DynamicsInfluencer influencer) { super(editor, influencer, "Dynamics Influencer", "Defines how the particles dynamics (acceleration, angular velocity)."); velocities = new Array<VelocityWrapper>(); setValue(value); set(influencer); } private void set (DynamicsInfluencer influencer) { // Clear for (int i = velocityTableModel.getRowCount() - 1; i >= 0; i--) { velocityTableModel.removeRow(i); } velocities.clear(); // Add for (int i = 0, c = influencer.velocities.size; i < c; ++i) { velocities.add(new VelocityWrapper((DynamicsModifier)influencer.velocities.items[i], true)); velocityTableModel.addRow(new Object[] {"Velocity " + i, true}); } DefaultComboBoxModel model = (DefaultComboBoxModel)velocityBox.getModel(); model.removeAllElements(); for (Object velocityObject : getAvailableVelocities(editor.getControllerType())) { model.addElement(velocityObject); } } private Object[] getAvailableVelocities (ControllerType type) { if (type == ControllerType.Billboard || type == ControllerType.PointSprite) { return new String[] {VEL_TYPE_ROTATIONAL_2D, VEL_TYPE_CENTRIPETAL, VEL_TYPE_TANGENTIAL, VEL_TYPE_POLAR, VEL_TYPE_BROWNIAN}; } else if (type == ControllerType.ModelInstance || type == ControllerType.ParticleController) { return new String[] {VEL_TYPE_ROTATIONAL_3D, VEL_TYPE_CENTRIPETAL, VEL_TYPE_TANGENTIAL, VEL_TYPE_POLAR, VEL_TYPE_BROWNIAN, VEL_TYPE_FACE}; } return null; } protected void initializeComponents () { super.initializeComponents(); JPanel velocitiesPanel = new JPanel(); velocitiesPanel.setLayout(new GridBagLayout()); { JPanel sideButtons = new JPanel(new GridBagLayout()); velocitiesPanel.add(sideButtons, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); { sideButtons.add(velocityBox = new JComboBox(new DefaultComboBoxModel()), new GridBagConstraints(0, -1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 6, 0), 0, 0)); } { JButton newButton = new JButton("New"); sideButtons.add(newButton, new GridBagConstraints(0, -1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 6, 0), 0, 0)); newButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { createVelocity(velocityBox.getSelectedItem()); } }); } { JButton deleteButton = new JButton("Delete"); sideButtons.add(deleteButton, new GridBagConstraints(0, -1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 6, 0), 0, 0)); deleteButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { deleteVelocity(); } }); } } JScrollPane scroll = new JScrollPane(); velocitiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); velocityTable = new JTable() { public Class getColumnClass (int column) { return column == 1 ? Boolean.class : super.getColumnClass(column); } @Override public Dimension getPreferredScrollableViewportSize () { Dimension dim = super.getPreferredScrollableViewportSize(); dim.height = getPreferredSize().height; return dim; } }; velocityTable.getTableHeader().setReorderingAllowed(false); velocityTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scroll.setViewportView(velocityTable); velocityTableModel = new DefaultTableModel(new String[0][0], new String[] {"Velocity", "Active"}); velocityTable.setModel(velocityTableModel); velocityTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged (ListSelectionEvent event) { if (event.getValueIsAdjusting()) return; velocitySelected(); } }); velocityTableModel.addTableModelListener(new TableModelListener() { public void tableChanged (TableModelEvent event) { if (event.getColumn() != 1) return; velocityChecked(event.getFirstRow(), (Boolean)velocityTable.getValueAt(event.getFirstRow(), 1)); } }); // Velocity values emptyPanel = new ParticleValuePanel(editor, "", "", true, false); strengthVelocityPanel = new StrengthVelocityPanel(editor, null, "Life", "", ""); angularVelocityPanel = new AngularVelocityPanel(editor, null, "Life", "", ""); strengthVelocityPanel.setVisible(false); angularVelocityPanel.setVisible(false); emptyPanel.setVisible(false); strengthVelocityPanel.setIsAlwayShown(true); angularVelocityPanel.setIsAlwayShown(true); emptyPanel.setIsAlwayShown(true); emptyPanel.setValue(null); // Assemble int i = 0; addContent(i++, 0, velocitiesPanel); addContent(i++, 0, strengthVelocityPanel); addContent(i++, 0, angularVelocityPanel); addContent(i++, 0, emptyPanel); } protected void velocityChecked (int index, boolean isChecked) { ParticleController controller = editor.getEmitter(); DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class); influencer.velocities.clear(); velocities.get(index).isActive = isChecked; for (VelocityWrapper wrapper : velocities) { if (wrapper.isActive) influencer.velocities.add(wrapper.velocityValue); } // Restart the effect and reinit the controller editor.restart(); } protected void velocitySelected () { // Show the velocity value panel int index = velocityTable.getSelectedRow(); if (index == -1) return; DynamicsModifier velocityValue = velocities.get(index).velocityValue; EditorPanel velocityPanel = getVelocityPanel(velocityValue); // Show the selected velocity if (selectedVelocityPanel != null && selectedVelocityPanel != velocityPanel) selectedVelocityPanel.setVisible(false); velocityPanel.setVisible(true); velocityPanel.showContent(true); selectedVelocityPanel = velocityPanel; } private EditorPanel getVelocityPanel (DynamicsModifier velocityValue) { EditorPanel panel = null; // Billboards if (velocityValue instanceof DynamicsModifier.Rotational2D) { strengthVelocityPanel.setValue((DynamicsModifier.Strength)velocityValue); strengthVelocityPanel.setName("Angular Velocity"); strengthVelocityPanel.setDescription("The angular speed around the billboard facing direction, in degrees/sec ."); panel = strengthVelocityPanel; } else if (velocityValue instanceof CentripetalAcceleration) { strengthVelocityPanel.setValue((DynamicsModifier.CentripetalAcceleration)velocityValue); strengthVelocityPanel.setName("Centripetal Acceleration"); strengthVelocityPanel.setDescription( "A directional acceleration, the direction is towards the origin (global), or towards the emitter position (local), in world units/sec2 ."); panel = strengthVelocityPanel; } else if (velocityValue instanceof TangentialAcceleration) { angularVelocityPanel.setValue((DynamicsModifier.Angular)velocityValue); angularVelocityPanel.setName("Tangetial Velocity"); angularVelocityPanel.setDescription( "A directional acceleration (axis and magnitude), the final direction is the cross product between particle position and the axis, in world units/sec2 ."); panel = angularVelocityPanel; } else if (velocityValue instanceof PolarAcceleration) { angularVelocityPanel.setValue((DynamicsModifier.Angular)velocityValue); angularVelocityPanel.setName("Polar Velocity"); angularVelocityPanel.setDescription("A directional acceleration (axis and magnitude), in world units/sec2 ."); panel = angularVelocityPanel; } else if (velocityValue instanceof BrownianAcceleration) { strengthVelocityPanel.setValue((DynamicsModifier.Strength)velocityValue); strengthVelocityPanel.setName("Brownian Velocity"); strengthVelocityPanel .setDescription("A directional acceleration which has random direction at each update, in world units/sec2."); panel = strengthVelocityPanel; } else if (velocityValue instanceof Rotational3D) { angularVelocityPanel.setValue((DynamicsModifier.Angular)velocityValue); angularVelocityPanel.setName("Angular Velocity"); angularVelocityPanel.setDescription("An angular velocity (axis and magnitude), in degree/sec2."); panel = angularVelocityPanel; } else if (velocityValue instanceof FaceDirection) { emptyPanel.setName("Face"); emptyPanel.setDescription( "Rotates the model to face its current velocity (Do not add any other angular velocity when using this)."); panel = emptyPanel; } return panel; } private DynamicsModifier createVelocityValue (Object selectedItem) { DynamicsModifier velocityValue = null; if (selectedItem == VEL_TYPE_ROTATIONAL_2D) velocityValue = new DynamicsModifier.Rotational2D(); else if (selectedItem == VEL_TYPE_ROTATIONAL_3D) velocityValue = new DynamicsModifier.Rotational3D(); else if (selectedItem == VEL_TYPE_CENTRIPETAL) velocityValue = new DynamicsModifier.CentripetalAcceleration(); else if (selectedItem == VEL_TYPE_TANGENTIAL) velocityValue = new DynamicsModifier.TangentialAcceleration(); else if (selectedItem == VEL_TYPE_POLAR) velocityValue = new DynamicsModifier.PolarAcceleration(); else if (selectedItem == VEL_TYPE_BROWNIAN) velocityValue = new DynamicsModifier.BrownianAcceleration(); else if (selectedItem == VEL_TYPE_FACE) velocityValue = new DynamicsModifier.FaceDirection(); return velocityValue; } protected void deleteVelocity () { int row = velocityTable.getSelectedRow(); if (row == -1) return; // Remove the velocity from the table ParticleController controller = editor.getEmitter(); DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class); influencer.velocities.removeValue(velocities.removeIndex(row).velocityValue, true); velocityTableModel.removeRow(row); // Restart the effect and reinit the controller editor.restart(); selectedVelocityPanel.setVisible(false); selectedVelocityPanel = null; } protected void createVelocity (Object selectedItem) { // Add the velocity to the table and to the influencer ParticleController controller = editor.getEmitter(); DynamicsInfluencer influencer = (DynamicsInfluencer)controller.findInfluencer(DynamicsInfluencer.class); VelocityWrapper wrapper = new VelocityWrapper(createVelocityValue(selectedItem), true); velocities.add(wrapper); influencer.velocities.add(wrapper.velocityValue); int index = velocities.size - 1; velocityTableModel.addRow(new Object[] {"Velocity " + index, true}); // Reinit editor.restart(); // Select new velocity velocityTable.getSelectionModel().setSelectionInterval(index, index); revalidate(); repaint(); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/assets/loaders/CubemapLoader.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.assets.loaders; import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.assets.AssetLoaderParameters; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Cubemap; import com.badlogic.gdx.graphics.CubemapData; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.Texture.TextureWrap; import com.badlogic.gdx.graphics.TextureData; import com.badlogic.gdx.graphics.glutils.KTXTextureData; import com.badlogic.gdx.utils.Array; /** {@link AssetLoader} for {@link Cubemap} instances. The pixel data is loaded asynchronously. The texture is then created on the * rendering thread, synchronously. Passing a {@link CubemapParameter} to * {@link AssetManager#load(String, Class, AssetLoaderParameters)} allows one to specify parameters as can be passed to the * various Cubemap constructors, e.g. filtering and so on. * @author mzechner, Vincent Bousquet */ public class CubemapLoader extends AsynchronousAssetLoader<Cubemap, CubemapLoader.CubemapParameter> { static public class CubemapLoaderInfo { String filename; CubemapData data; Cubemap cubemap; }; CubemapLoaderInfo info = new CubemapLoaderInfo(); public CubemapLoader (FileHandleResolver resolver) { super(resolver); } @Override public void loadAsync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { info.filename = fileName; if (parameter == null || parameter.cubemapData == null) { Format format = null; boolean genMipMaps = false; info.cubemap = null; if (parameter != null) { format = parameter.format; info.cubemap = parameter.cubemap; } if (fileName.contains(".ktx") || fileName.contains(".zktx")) { info.data = new KTXTextureData(file, genMipMaps); } } else { info.data = parameter.cubemapData; info.cubemap = parameter.cubemap; } if (!info.data.isPrepared()) info.data.prepare(); } @Override public Cubemap loadSync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { if (info == null) return null; Cubemap cubemap = info.cubemap; if (cubemap != null) { cubemap.load(info.data); } else { cubemap = new Cubemap(info.data); } if (parameter != null) { cubemap.setFilter(parameter.minFilter, parameter.magFilter); cubemap.setWrap(parameter.wrapU, parameter.wrapV); } return cubemap; } @Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, CubemapParameter parameter) { return null; } static public class CubemapParameter extends AssetLoaderParameters<Cubemap> { /** the format of the final Texture. Uses the source images format if null **/ public Format format = null; /** The texture to put the {@link TextureData} in, optional. **/ public Cubemap cubemap = null; /** CubemapData for textures created on the fly, optional. When set, all format and genMipMaps are ignored */ public CubemapData cubemapData = null; public TextureFilter minFilter = TextureFilter.Nearest; public TextureFilter magFilter = TextureFilter.Nearest; public TextureWrap wrapU = TextureWrap.ClampToEdge; public TextureWrap wrapV = TextureWrap.ClampToEdge; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.assets.loaders; import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.assets.AssetLoaderParameters; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Cubemap; import com.badlogic.gdx.graphics.CubemapData; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.Texture.TextureWrap; import com.badlogic.gdx.graphics.TextureData; import com.badlogic.gdx.graphics.glutils.KTXTextureData; import com.badlogic.gdx.utils.Array; /** {@link AssetLoader} for {@link Cubemap} instances. The pixel data is loaded asynchronously. The texture is then created on the * rendering thread, synchronously. Passing a {@link CubemapParameter} to * {@link AssetManager#load(String, Class, AssetLoaderParameters)} allows one to specify parameters as can be passed to the * various Cubemap constructors, e.g. filtering and so on. * @author mzechner, Vincent Bousquet */ public class CubemapLoader extends AsynchronousAssetLoader<Cubemap, CubemapLoader.CubemapParameter> { static public class CubemapLoaderInfo { String filename; CubemapData data; Cubemap cubemap; }; CubemapLoaderInfo info = new CubemapLoaderInfo(); public CubemapLoader (FileHandleResolver resolver) { super(resolver); } @Override public void loadAsync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { info.filename = fileName; if (parameter == null || parameter.cubemapData == null) { Format format = null; boolean genMipMaps = false; info.cubemap = null; if (parameter != null) { format = parameter.format; info.cubemap = parameter.cubemap; } if (fileName.contains(".ktx") || fileName.contains(".zktx")) { info.data = new KTXTextureData(file, genMipMaps); } } else { info.data = parameter.cubemapData; info.cubemap = parameter.cubemap; } if (!info.data.isPrepared()) info.data.prepare(); } @Override public Cubemap loadSync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { if (info == null) return null; Cubemap cubemap = info.cubemap; if (cubemap != null) { cubemap.load(info.data); } else { cubemap = new Cubemap(info.data); } if (parameter != null) { cubemap.setFilter(parameter.minFilter, parameter.magFilter); cubemap.setWrap(parameter.wrapU, parameter.wrapV); } return cubemap; } @Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, CubemapParameter parameter) { return null; } static public class CubemapParameter extends AssetLoaderParameters<Cubemap> { /** the format of the final Texture. Uses the source images format if null **/ public Format format = null; /** The texture to put the {@link TextureData} in, optional. **/ public Cubemap cubemap = null; /** CubemapData for textures created on the fly, optional. When set, all format and genMipMaps are ignored */ public CubemapData cubemapData = null; public TextureFilter minFilter = TextureFilter.Nearest; public TextureFilter magFilter = TextureFilter.Nearest; public TextureWrap wrapU = TextureWrap.ClampToEdge; public TextureWrap wrapV = TextureWrap.ClampToEdge; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/dynamics/com/badlogic/gdx/physics/bullet/dynamics/btDantzigSolver.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.dynamics; import com.badlogic.gdx.physics.bullet.linearmath.*; import com.badlogic.gdx.physics.bullet.collision.*; public class btDantzigSolver extends btMLCPSolverInterface { private long swigCPtr; protected btDantzigSolver (final String className, long cPtr, boolean cMemoryOwn) { super(className, DynamicsJNI.btDantzigSolver_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btDantzigSolver, normally you should not need this constructor it's intended for low-level usage. */ public btDantzigSolver (long cPtr, boolean cMemoryOwn) { this("btDantzigSolver", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(DynamicsJNI.btDantzigSolver_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (btDantzigSolver obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; DynamicsJNI.delete_btDantzigSolver(swigCPtr); } swigCPtr = 0; } super.delete(); } public btDantzigSolver () { this(DynamicsJNI.new_btDantzigSolver(), true); } public boolean solveMLCP (SWIGTYPE_p_btMatrixXT_float_t A, SWIGTYPE_p_btVectorXT_float_t b, SWIGTYPE_p_btVectorXT_float_t x, SWIGTYPE_p_btVectorXT_float_t lo, SWIGTYPE_p_btVectorXT_float_t hi, SWIGTYPE_p_btAlignedObjectArrayT_int_t limitDependency, int numIterations, boolean useSparsity) { return DynamicsJNI.btDantzigSolver_solveMLCP__SWIG_0(swigCPtr, this, SWIGTYPE_p_btMatrixXT_float_t.getCPtr(A), SWIGTYPE_p_btVectorXT_float_t.getCPtr(b), SWIGTYPE_p_btVectorXT_float_t.getCPtr(x), SWIGTYPE_p_btVectorXT_float_t.getCPtr(lo), SWIGTYPE_p_btVectorXT_float_t.getCPtr(hi), SWIGTYPE_p_btAlignedObjectArrayT_int_t.getCPtr(limitDependency), numIterations, useSparsity); } public boolean solveMLCP (SWIGTYPE_p_btMatrixXT_float_t A, SWIGTYPE_p_btVectorXT_float_t b, SWIGTYPE_p_btVectorXT_float_t x, SWIGTYPE_p_btVectorXT_float_t lo, SWIGTYPE_p_btVectorXT_float_t hi, SWIGTYPE_p_btAlignedObjectArrayT_int_t limitDependency, int numIterations) { return DynamicsJNI.btDantzigSolver_solveMLCP__SWIG_1(swigCPtr, this, SWIGTYPE_p_btMatrixXT_float_t.getCPtr(A), SWIGTYPE_p_btVectorXT_float_t.getCPtr(b), SWIGTYPE_p_btVectorXT_float_t.getCPtr(x), SWIGTYPE_p_btVectorXT_float_t.getCPtr(lo), SWIGTYPE_p_btVectorXT_float_t.getCPtr(hi), SWIGTYPE_p_btAlignedObjectArrayT_int_t.getCPtr(limitDependency), numIterations); } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.dynamics; import com.badlogic.gdx.physics.bullet.linearmath.*; import com.badlogic.gdx.physics.bullet.collision.*; public class btDantzigSolver extends btMLCPSolverInterface { private long swigCPtr; protected btDantzigSolver (final String className, long cPtr, boolean cMemoryOwn) { super(className, DynamicsJNI.btDantzigSolver_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btDantzigSolver, normally you should not need this constructor it's intended for low-level usage. */ public btDantzigSolver (long cPtr, boolean cMemoryOwn) { this("btDantzigSolver", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(DynamicsJNI.btDantzigSolver_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (btDantzigSolver obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; DynamicsJNI.delete_btDantzigSolver(swigCPtr); } swigCPtr = 0; } super.delete(); } public btDantzigSolver () { this(DynamicsJNI.new_btDantzigSolver(), true); } public boolean solveMLCP (SWIGTYPE_p_btMatrixXT_float_t A, SWIGTYPE_p_btVectorXT_float_t b, SWIGTYPE_p_btVectorXT_float_t x, SWIGTYPE_p_btVectorXT_float_t lo, SWIGTYPE_p_btVectorXT_float_t hi, SWIGTYPE_p_btAlignedObjectArrayT_int_t limitDependency, int numIterations, boolean useSparsity) { return DynamicsJNI.btDantzigSolver_solveMLCP__SWIG_0(swigCPtr, this, SWIGTYPE_p_btMatrixXT_float_t.getCPtr(A), SWIGTYPE_p_btVectorXT_float_t.getCPtr(b), SWIGTYPE_p_btVectorXT_float_t.getCPtr(x), SWIGTYPE_p_btVectorXT_float_t.getCPtr(lo), SWIGTYPE_p_btVectorXT_float_t.getCPtr(hi), SWIGTYPE_p_btAlignedObjectArrayT_int_t.getCPtr(limitDependency), numIterations, useSparsity); } public boolean solveMLCP (SWIGTYPE_p_btMatrixXT_float_t A, SWIGTYPE_p_btVectorXT_float_t b, SWIGTYPE_p_btVectorXT_float_t x, SWIGTYPE_p_btVectorXT_float_t lo, SWIGTYPE_p_btVectorXT_float_t hi, SWIGTYPE_p_btAlignedObjectArrayT_int_t limitDependency, int numIterations) { return DynamicsJNI.btDantzigSolver_solveMLCP__SWIG_1(swigCPtr, this, SWIGTYPE_p_btMatrixXT_float_t.getCPtr(A), SWIGTYPE_p_btVectorXT_float_t.getCPtr(b), SWIGTYPE_p_btVectorXT_float_t.getCPtr(x), SWIGTYPE_p_btVectorXT_float_t.getCPtr(lo), SWIGTYPE_p_btVectorXT_float_t.getCPtr(hi), SWIGTYPE_p_btAlignedObjectArrayT_int_t.getCPtr(limitDependency), numIterations); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/graphics/g3d/particles/values/CylinderSpawnShapeValue.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.particles.values; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector3; /** Encapsulate the formulas to spawn a particle on a cylinder shape. * @author Inferno */ public final class CylinderSpawnShapeValue extends PrimitiveSpawnShapeValue { public CylinderSpawnShapeValue (CylinderSpawnShapeValue cylinderSpawnShapeValue) { super(cylinderSpawnShapeValue); load(cylinderSpawnShapeValue); } public CylinderSpawnShapeValue () { } @Override public void spawnAux (Vector3 vector, float percent) { // Generate the point on the surface of the sphere float width = spawnWidth + (spawnWidthDiff * spawnWidthValue.getScale(percent)); float height = spawnHeight + (spawnHeightDiff * spawnHeightValue.getScale(percent)); float depth = spawnDepth + (spawnDepthDiff * spawnDepthValue.getScale(percent)); float radiusX, radiusZ; float hf = height / 2; float ty = MathUtils.random(height) - hf; // Where generate the point, on edges or inside ? if (edges) { radiusX = width / 2; radiusZ = depth / 2; } else { radiusX = MathUtils.random(width) / 2; radiusZ = MathUtils.random(depth) / 2; } float spawnTheta = 0; // Generate theta boolean isRadiusXZero = radiusX == 0, isRadiusZZero = radiusZ == 0; if (!isRadiusXZero && !isRadiusZZero) spawnTheta = MathUtils.random(360f); else { if (isRadiusXZero) spawnTheta = MathUtils.random(1) == 0 ? -90 : 90; else if (isRadiusZZero) spawnTheta = MathUtils.random(1) == 0 ? 0 : 180; } vector.set(radiusX * MathUtils.cosDeg(spawnTheta), ty, radiusZ * MathUtils.sinDeg(spawnTheta)); } @Override public SpawnShapeValue copy () { return new CylinderSpawnShapeValue(this); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.particles.values; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector3; /** Encapsulate the formulas to spawn a particle on a cylinder shape. * @author Inferno */ public final class CylinderSpawnShapeValue extends PrimitiveSpawnShapeValue { public CylinderSpawnShapeValue (CylinderSpawnShapeValue cylinderSpawnShapeValue) { super(cylinderSpawnShapeValue); load(cylinderSpawnShapeValue); } public CylinderSpawnShapeValue () { } @Override public void spawnAux (Vector3 vector, float percent) { // Generate the point on the surface of the sphere float width = spawnWidth + (spawnWidthDiff * spawnWidthValue.getScale(percent)); float height = spawnHeight + (spawnHeightDiff * spawnHeightValue.getScale(percent)); float depth = spawnDepth + (spawnDepthDiff * spawnDepthValue.getScale(percent)); float radiusX, radiusZ; float hf = height / 2; float ty = MathUtils.random(height) - hf; // Where generate the point, on edges or inside ? if (edges) { radiusX = width / 2; radiusZ = depth / 2; } else { radiusX = MathUtils.random(width) / 2; radiusZ = MathUtils.random(depth) / 2; } float spawnTheta = 0; // Generate theta boolean isRadiusXZero = radiusX == 0, isRadiusZZero = radiusZ == 0; if (!isRadiusXZero && !isRadiusZZero) spawnTheta = MathUtils.random(360f); else { if (isRadiusXZero) spawnTheta = MathUtils.random(1) == 0 ? -90 : 90; else if (isRadiusZZero) spawnTheta = MathUtils.random(1) == 0 ? 0 : 180; } vector.set(radiusX * MathUtils.cosDeg(spawnTheta), ty, radiusZ * MathUtils.sinDeg(spawnTheta)); } @Override public SpawnShapeValue copy () { return new CylinderSpawnShapeValue(this); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/assets/loaders/TextureAtlasLoader.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.assets.loaders; import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.assets.AssetLoaderParameters; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData; import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData.Page; import com.badlogic.gdx.utils.Array; /** {@link AssetLoader} to load {@link TextureAtlas} instances. Passing a {@link TextureAtlasParameter} to * {@link AssetManager#load(String, Class, AssetLoaderParameters)} allows to specify whether the atlas regions should be flipped * on the y-axis or not. * @author mzechner */ public class TextureAtlasLoader extends SynchronousAssetLoader<TextureAtlas, TextureAtlasLoader.TextureAtlasParameter> { public TextureAtlasLoader (FileHandleResolver resolver) { super(resolver); } TextureAtlasData data; @Override public TextureAtlas load (AssetManager assetManager, String fileName, FileHandle file, TextureAtlasParameter parameter) { for (Page page : data.getPages()) { Texture texture = assetManager.get(page.textureFile.path().replaceAll("\\\\", "/"), Texture.class); page.texture = texture; } TextureAtlas atlas = new TextureAtlas(data); data = null; return atlas; } @Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle atlasFile, TextureAtlasParameter parameter) { FileHandle imgDir = atlasFile.parent(); if (parameter != null) data = new TextureAtlasData(atlasFile, imgDir, parameter.flip); else { data = new TextureAtlasData(atlasFile, imgDir, false); } Array<AssetDescriptor> dependencies = new Array(); for (Page page : data.getPages()) { TextureParameter params = new TextureParameter(); params.format = page.format; params.genMipMaps = page.useMipMaps; params.minFilter = page.minFilter; params.magFilter = page.magFilter; dependencies.add(new AssetDescriptor(page.textureFile, Texture.class, params)); } return dependencies; } static public class TextureAtlasParameter extends AssetLoaderParameters<TextureAtlas> { /** whether to flip the texture atlas vertically **/ public boolean flip = false; public TextureAtlasParameter () { } public TextureAtlasParameter (boolean flip) { this.flip = flip; } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.assets.loaders; import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.assets.AssetLoaderParameters; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData; import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData.Page; import com.badlogic.gdx.utils.Array; /** {@link AssetLoader} to load {@link TextureAtlas} instances. Passing a {@link TextureAtlasParameter} to * {@link AssetManager#load(String, Class, AssetLoaderParameters)} allows to specify whether the atlas regions should be flipped * on the y-axis or not. * @author mzechner */ public class TextureAtlasLoader extends SynchronousAssetLoader<TextureAtlas, TextureAtlasLoader.TextureAtlasParameter> { public TextureAtlasLoader (FileHandleResolver resolver) { super(resolver); } TextureAtlasData data; @Override public TextureAtlas load (AssetManager assetManager, String fileName, FileHandle file, TextureAtlasParameter parameter) { for (Page page : data.getPages()) { Texture texture = assetManager.get(page.textureFile.path().replaceAll("\\\\", "/"), Texture.class); page.texture = texture; } TextureAtlas atlas = new TextureAtlas(data); data = null; return atlas; } @Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle atlasFile, TextureAtlasParameter parameter) { FileHandle imgDir = atlasFile.parent(); if (parameter != null) data = new TextureAtlasData(atlasFile, imgDir, parameter.flip); else { data = new TextureAtlasData(atlasFile, imgDir, false); } Array<AssetDescriptor> dependencies = new Array(); for (Page page : data.getPages()) { TextureParameter params = new TextureParameter(); params.format = page.format; params.genMipMaps = page.useMipMaps; params.minFilter = page.minFilter; params.magFilter = page.magFilter; dependencies.add(new AssetDescriptor(page.textureFile, Texture.class, params)); } return dependencies; } static public class TextureAtlasParameter extends AssetLoaderParameters<TextureAtlas> { /** whether to flip the texture atlas vertically **/ public boolean flip = false; public TextureAtlasParameter () { } public TextureAtlasParameter (boolean flip) { this.flip = flip; } } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/graphics/g3d/utils/ShapeCache.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.utils; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.Renderable; import com.badlogic.gdx.graphics.g3d.RenderableProvider; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.Pool; /** A relatively lightweight class which can be used to render basic shapes which don't need a node structure and alike. Can be * used for batching both static and dynamic shapes which share the same {@link Material} and transformation {@link Matrix4} * within the world. Use {@link ModelBatch} to render the `ShapeCache`. Must be disposed when no longer needed to release native * resources. * <p> * How to use it : * </p> * * <pre> * // Create cache * ShapeCache cache = new ShapeCache(); * // Build the cache, for dynamic shapes, this would be in the render method. * MeshPartBuilder builder = cache.begin(); * FrustumShapeBuilder.build(builder, camera); * BoxShapeBuilder.build(builder, box); * cache.end() * // Render * modelBatch.render(cache); * // After using it * cache.dispose(); * </pre> * * @author realitix */ public class ShapeCache implements Disposable, RenderableProvider { /** Builder used to update the mesh */ private final MeshBuilder builder; /** Mesh being rendered */ private final Mesh mesh; private boolean building; private final String id = "id"; private final Renderable renderable = new Renderable(); /** Create a ShapeCache with default values */ public ShapeCache () { this(5000, 5000, new VertexAttributes(new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute(Usage.ColorPacked, 4, "a_color")), GL20.GL_LINES); } /** Create a ShapeCache with parameters * @param maxVertices max vertices in mesh * @param maxIndices max indices in mesh * @param attributes vertex attributes * @param primitiveType */ public ShapeCache (int maxVertices, int maxIndices, VertexAttributes attributes, int primitiveType) { // Init mesh mesh = new Mesh(false, maxVertices, maxIndices, attributes); // Init builder builder = new MeshBuilder(); // Init renderable renderable.meshPart.mesh = mesh; renderable.meshPart.primitiveType = primitiveType; renderable.material = new Material(); } /** Initialize ShapeCache for mesh generation with GL_LINES primitive type */ public MeshPartBuilder begin () { return begin(GL20.GL_LINES); } /** Initialize ShapeCache for mesh generation * @param primitiveType OpenGL primitive type */ public MeshPartBuilder begin (int primitiveType) { if (building) throw new GdxRuntimeException("Call end() after calling begin()"); building = true; builder.begin(mesh.getVertexAttributes()); builder.part(id, primitiveType, renderable.meshPart); return builder; } /** Generate mesh and renderable */ public void end () { if (!building) throw new GdxRuntimeException("Call begin() prior to calling end()"); building = false; builder.end(mesh); } @Override public void getRenderables (Array<Renderable> renderables, Pool<Renderable> pool) { renderables.add(renderable); } /** Allows to customize the material. * @return material */ public Material getMaterial () { return renderable.material; } /** Allows to customize the world transform matrix. * @return world transform */ public Matrix4 getWorldTransform () { return renderable.worldTransform; } @Override public void dispose () { mesh.dispose(); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.utils; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes; import com.badlogic.gdx.graphics.VertexAttributes.Usage; import com.badlogic.gdx.graphics.g3d.Material; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.Renderable; import com.badlogic.gdx.graphics.g3d.RenderableProvider; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.Pool; /** A relatively lightweight class which can be used to render basic shapes which don't need a node structure and alike. Can be * used for batching both static and dynamic shapes which share the same {@link Material} and transformation {@link Matrix4} * within the world. Use {@link ModelBatch} to render the `ShapeCache`. Must be disposed when no longer needed to release native * resources. * <p> * How to use it : * </p> * * <pre> * // Create cache * ShapeCache cache = new ShapeCache(); * // Build the cache, for dynamic shapes, this would be in the render method. * MeshPartBuilder builder = cache.begin(); * FrustumShapeBuilder.build(builder, camera); * BoxShapeBuilder.build(builder, box); * cache.end() * // Render * modelBatch.render(cache); * // After using it * cache.dispose(); * </pre> * * @author realitix */ public class ShapeCache implements Disposable, RenderableProvider { /** Builder used to update the mesh */ private final MeshBuilder builder; /** Mesh being rendered */ private final Mesh mesh; private boolean building; private final String id = "id"; private final Renderable renderable = new Renderable(); /** Create a ShapeCache with default values */ public ShapeCache () { this(5000, 5000, new VertexAttributes(new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute(Usage.ColorPacked, 4, "a_color")), GL20.GL_LINES); } /** Create a ShapeCache with parameters * @param maxVertices max vertices in mesh * @param maxIndices max indices in mesh * @param attributes vertex attributes * @param primitiveType */ public ShapeCache (int maxVertices, int maxIndices, VertexAttributes attributes, int primitiveType) { // Init mesh mesh = new Mesh(false, maxVertices, maxIndices, attributes); // Init builder builder = new MeshBuilder(); // Init renderable renderable.meshPart.mesh = mesh; renderable.meshPart.primitiveType = primitiveType; renderable.material = new Material(); } /** Initialize ShapeCache for mesh generation with GL_LINES primitive type */ public MeshPartBuilder begin () { return begin(GL20.GL_LINES); } /** Initialize ShapeCache for mesh generation * @param primitiveType OpenGL primitive type */ public MeshPartBuilder begin (int primitiveType) { if (building) throw new GdxRuntimeException("Call end() after calling begin()"); building = true; builder.begin(mesh.getVertexAttributes()); builder.part(id, primitiveType, renderable.meshPart); return builder; } /** Generate mesh and renderable */ public void end () { if (!building) throw new GdxRuntimeException("Call begin() prior to calling end()"); building = false; builder.end(mesh); } @Override public void getRenderables (Array<Renderable> renderables, Pool<Renderable> pool) { renderables.add(renderable); } /** Allows to customize the material. * @return material */ public Material getMaterial () { return renderable.material; } /** Allows to customize the world transform matrix. * @return world transform */ public Matrix4 getWorldTransform () { return renderable.worldTransform; } @Override public void dispose () { mesh.dispose(); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/scenes/scene2d/actions/LayoutAction.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.scenes.scene2d.actions; import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.utils.Layout; import com.badlogic.gdx.utils.GdxRuntimeException; /** Sets an actor's {@link Layout#setLayoutEnabled(boolean) layout} to enabled or disabled. The actor must implements * {@link Layout}. * @author Nathan Sweet */ public class LayoutAction extends Action { private boolean enabled; public void setTarget (Actor actor) { if (actor != null && !(actor instanceof Layout)) throw new GdxRuntimeException("Actor must implement layout: " + actor); super.setTarget(actor); } public boolean act (float delta) { ((Layout)target).setLayoutEnabled(enabled); return true; } public boolean isEnabled () { return enabled; } public void setLayoutEnabled (boolean enabled) { this.enabled = enabled; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.scenes.scene2d.actions; import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.utils.Layout; import com.badlogic.gdx.utils.GdxRuntimeException; /** Sets an actor's {@link Layout#setLayoutEnabled(boolean) layout} to enabled or disabled. The actor must implements * {@link Layout}. * @author Nathan Sweet */ public class LayoutAction extends Action { private boolean enabled; public void setTarget (Actor actor) { if (actor != null && !(actor instanceof Layout)) throw new GdxRuntimeException("Actor must implement layout: " + actor); super.setTarget(actor); } public boolean act (float delta) { ((Layout)target).setLayoutEnabled(enabled); return true; } public boolean isEnabled () { return enabled; } public void setLayoutEnabled (boolean enabled) { this.enabled = enabled; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ParticleEffectActor.java
package com.badlogic.gdx.scenes.scene2d.ui; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.ParticleEffect; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.utils.Disposable; /** ParticleEffectActor holds an {@link ParticleEffect} to use in Scene2d applications. The particle effect is positioned at 0, 0 * in the ParticleEffectActor. Its bounding box is not limited to the size of this actor. */ public class ParticleEffectActor extends Actor implements Disposable { private final ParticleEffect particleEffect; protected float lastDelta; protected boolean isRunning; protected boolean ownsEffect; private boolean resetOnStart; private boolean autoRemove; public ParticleEffectActor (ParticleEffect particleEffect, boolean resetOnStart) { super(); this.particleEffect = particleEffect; this.resetOnStart = resetOnStart; } public ParticleEffectActor (FileHandle particleFile, TextureAtlas atlas) { super(); particleEffect = new ParticleEffect(); particleEffect.load(particleFile, atlas); ownsEffect = true; } public ParticleEffectActor (FileHandle particleFile, FileHandle imagesDir) { super(); particleEffect = new ParticleEffect(); particleEffect.load(particleFile, imagesDir); ownsEffect = true; } @Override public void draw (Batch batch, float parentAlpha) { particleEffect.setPosition(getX(), getY()); if (lastDelta > 0) { particleEffect.update(lastDelta); lastDelta = 0; } if (isRunning) { particleEffect.draw(batch); isRunning = !particleEffect.isComplete(); } } @Override public void act (float delta) { super.act(delta); // don't do particleEffect.update() here - the correct position is set just while we // are in draw() method. We save the delta here to update in draw() lastDelta += delta; if (autoRemove && particleEffect.isComplete()) { remove(); } } public void start () { isRunning = true; if (resetOnStart) { particleEffect.reset(false); } particleEffect.start(); } public boolean isResetOnStart () { return resetOnStart; } public ParticleEffectActor setResetOnStart (boolean resetOnStart) { this.resetOnStart = resetOnStart; return this; } public boolean isAutoRemove () { return autoRemove; } public ParticleEffectActor setAutoRemove (boolean autoRemove) { this.autoRemove = autoRemove; return this; } public boolean isRunning () { return isRunning; } public ParticleEffect getEffect () { return this.particleEffect; } @Override protected void scaleChanged () { super.scaleChanged(); particleEffect.scaleEffect(getScaleX(), getScaleY(), getScaleY()); } public void cancel () { isRunning = true; } public void allowCompletion () { particleEffect.allowCompletion(); } @Override public void dispose () { if (ownsEffect) { particleEffect.dispose(); } } }
package com.badlogic.gdx.scenes.scene2d.ui; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.ParticleEffect; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.utils.Disposable; /** ParticleEffectActor holds an {@link ParticleEffect} to use in Scene2d applications. The particle effect is positioned at 0, 0 * in the ParticleEffectActor. Its bounding box is not limited to the size of this actor. */ public class ParticleEffectActor extends Actor implements Disposable { private final ParticleEffect particleEffect; protected float lastDelta; protected boolean isRunning; protected boolean ownsEffect; private boolean resetOnStart; private boolean autoRemove; public ParticleEffectActor (ParticleEffect particleEffect, boolean resetOnStart) { super(); this.particleEffect = particleEffect; this.resetOnStart = resetOnStart; } public ParticleEffectActor (FileHandle particleFile, TextureAtlas atlas) { super(); particleEffect = new ParticleEffect(); particleEffect.load(particleFile, atlas); ownsEffect = true; } public ParticleEffectActor (FileHandle particleFile, FileHandle imagesDir) { super(); particleEffect = new ParticleEffect(); particleEffect.load(particleFile, imagesDir); ownsEffect = true; } @Override public void draw (Batch batch, float parentAlpha) { particleEffect.setPosition(getX(), getY()); if (lastDelta > 0) { particleEffect.update(lastDelta); lastDelta = 0; } if (isRunning) { particleEffect.draw(batch); isRunning = !particleEffect.isComplete(); } } @Override public void act (float delta) { super.act(delta); // don't do particleEffect.update() here - the correct position is set just while we // are in draw() method. We save the delta here to update in draw() lastDelta += delta; if (autoRemove && particleEffect.isComplete()) { remove(); } } public void start () { isRunning = true; if (resetOnStart) { particleEffect.reset(false); } particleEffect.start(); } public boolean isResetOnStart () { return resetOnStart; } public ParticleEffectActor setResetOnStart (boolean resetOnStart) { this.resetOnStart = resetOnStart; return this; } public boolean isAutoRemove () { return autoRemove; } public ParticleEffectActor setAutoRemove (boolean autoRemove) { this.autoRemove = autoRemove; return this; } public boolean isRunning () { return isRunning; } public ParticleEffect getEffect () { return this.particleEffect; } @Override protected void scaleChanged () { super.scaleChanged(); particleEffect.scaleEffect(getScaleX(), getScaleY(), getScaleY()); } public void cancel () { isRunning = true; } public void allowCompletion () { particleEffect.allowCompletion(); } @Override public void dispose () { if (ownsEffect) { particleEffect.dispose(); } } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGLES20.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.iosrobovm; import java.nio.*; import com.badlogic.gdx.graphics.GL20; import org.robovm.apple.foundation.NSProcessInfo; public class IOSGLES20 implements GL20 { final boolean shouldConvert16bit = IOSApplication.IS_METALANGLE && NSProcessInfo.getSharedProcessInfo().getEnvironment().containsKey("SIMULATOR_DEVICE_NAME"); public IOSGLES20 () { init(); } /** last viewport set, needed because GLKView resets the viewport on each call to render... amazing **/ public static int x, y, width, height; private static native void init (); public native void glActiveTexture (int texture); public native void glAttachShader (int program, int shader); public native void glBindAttribLocation (int program, int index, String name); public native void glBindBuffer (int target, int buffer); public native void glBindFramebuffer (int target, int framebuffer); public native void glBindRenderbuffer (int target, int renderbuffer); public native void glBindTexture (int target, int texture); public native void glBlendColor (float red, float green, float blue, float alpha); public native void glBlendEquation (int mode); public native void glBlendEquationSeparate (int modeRGB, int modeAlpha); public native void glBlendFunc (int sfactor, int dfactor); public native void glBlendFuncSeparate (int srcRGB, int dstRGB, int srcAlpha, int dstAlpha); public native void glBufferData (int target, int size, Buffer data, int usage); public native void glBufferSubData (int target, int offset, int size, Buffer data); public native int glCheckFramebufferStatus (int target); public native void glClear (int mask); public native void glClearColor (float red, float green, float blue, float alpha); public native void glClearDepthf (float depth); public native void glClearStencil (int s); public native void glColorMask (boolean red, boolean green, boolean blue, boolean alpha); public native void glCompileShader (int shader); public native void glCompressedTexImage2D (int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data); public native void glCompressedTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data); public native void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border); public native void glCopyTexSubImage2D (int target, int level, int xoffset, int yoffset, int x, int y, int width, int height); public native int glCreateProgram (); public native int glCreateShader (int type); public native void glCullFace (int mode); public native void glDeleteBuffers (int n, IntBuffer buffers); public native void glDeleteBuffer (int buffer); public native void glDeleteFramebuffers (int n, IntBuffer framebuffers); public native void glDeleteFramebuffer (int framebuffer); public native void glDeleteProgram (int program); public native void glDeleteRenderbuffers (int n, IntBuffer renderbuffers); public native void glDeleteRenderbuffer (int renderbuffer); public native void glDeleteShader (int shader); public native void glDeleteTextures (int n, IntBuffer textures); public native void glDeleteTexture (int texture); public native void glDepthFunc (int func); public native void glDepthMask (boolean flag); public native void glDepthRangef (float zNear, float zFar); public native void glDetachShader (int program, int shader); public native void glDisable (int cap); public native void glDisableVertexAttribArray (int index); public native void glDrawArrays (int mode, int first, int count); public native void glDrawElements (int mode, int count, int type, Buffer indices); public native void glDrawElements (int mode, int count, int type, int indices); public native void glEnable (int cap); public native void glEnableVertexAttribArray (int index); public native void glFinish (); public native void glFlush (); public native void glFramebufferRenderbuffer (int target, int attachment, int renderbuffertarget, int renderbuffer); public native void glFramebufferTexture2D (int target, int attachment, int textarget, int texture, int level); public native void glFrontFace (int mode); public native void glGenBuffers (int n, IntBuffer buffers); public native int glGenBuffer (); public native void glGenerateMipmap (int target); public native void glGenFramebuffers (int n, IntBuffer framebuffers); public native int glGenFramebuffer (); public native void glGenRenderbuffers (int n, IntBuffer renderbuffers); public native int glGenRenderbuffer (); public native void glGenTextures (int n, IntBuffer textures); public native int glGenTexture (); public native String glGetActiveAttrib (int program, int index, IntBuffer size, IntBuffer type); public native String glGetActiveUniform (int program, int index, IntBuffer size, IntBuffer type); public native void glGetAttachedShaders (int program, int maxcount, Buffer count, IntBuffer shaders); public native int glGetAttribLocation (int program, String name); public native void glGetBooleanv (int pname, Buffer params); public native void glGetBufferParameteriv (int target, int pname, IntBuffer params); public native int glGetError (); public native void glGetFloatv (int pname, FloatBuffer params); public native void glGetFramebufferAttachmentParameteriv (int target, int attachment, int pname, IntBuffer params); public native void glGetIntegerv (int pname, IntBuffer params); public native void glGetProgramiv (int program, int pname, IntBuffer params); public native String glGetProgramInfoLog (int program); public native void glGetRenderbufferParameteriv (int target, int pname, IntBuffer params); public native void glGetShaderiv (int shader, int pname, IntBuffer params); public native String glGetShaderInfoLog (int shader); public native void glGetShaderPrecisionFormat (int shadertype, int precisiontype, IntBuffer range, IntBuffer precision); public native void glGetShaderSource (int shader, int bufsize, Buffer length, String source); public native String glGetString (int name); public native void glGetTexParameterfv (int target, int pname, FloatBuffer params); public native void glGetTexParameteriv (int target, int pname, IntBuffer params); public native void glGetUniformfv (int program, int location, FloatBuffer params); public native void glGetUniformiv (int program, int location, IntBuffer params); public native int glGetUniformLocation (int program, String name); public native void glGetVertexAttribfv (int index, int pname, FloatBuffer params); public native void glGetVertexAttribiv (int index, int pname, IntBuffer params); public native void glGetVertexAttribPointerv (int index, int pname, Buffer pointer); public native void glHint (int target, int mode); public native boolean glIsBuffer (int buffer); public native boolean glIsEnabled (int cap); public native boolean glIsFramebuffer (int framebuffer); public native boolean glIsProgram (int program); public native boolean glIsRenderbuffer (int renderbuffer); public native boolean glIsShader (int shader); public native boolean glIsTexture (int texture); public native void glLineWidth (float width); public native void glLinkProgram (int program); public native void glPixelStorei (int pname, int param); public native void glPolygonOffset (float factor, float units); public native void glReadPixels (int x, int y, int width, int height, int format, int type, Buffer pixels); public native void glReleaseShaderCompiler (); public native void glRenderbufferStorage (int target, int internalformat, int width, int height); public native void glSampleCoverage (float value, boolean invert); public native void glScissor (int x, int y, int width, int height); public native void glShaderBinary (int n, IntBuffer shaders, int binaryformat, Buffer binary, int length); public native void glShaderSource (int shader, String string); public native void glStencilFunc (int func, int ref, int mask); public native void glStencilFuncSeparate (int face, int func, int ref, int mask); public native void glStencilMask (int mask); public native void glStencilMaskSeparate (int face, int mask); public native void glStencilOp (int fail, int zfail, int zpass); public native void glStencilOpSeparate (int face, int fail, int zfail, int zpass); static Buffer convert16bitBufferToRGBA8888 (Buffer buffer, int type) { // TODO: 20.10.22 Can it be a different buffer type? ByteBuffer byteBuffer = (ByteBuffer)buffer; byteBuffer.order(ByteOrder.LITTLE_ENDIAN); ByteBuffer converted = ByteBuffer.allocateDirect(byteBuffer.limit() * 2); while (buffer.remaining() != 0) { short color = byteBuffer.getShort(); int rgba8888; if (type == GL_UNSIGNED_SHORT_4_4_4_4) { byte r = (byte)((color >> 12) & 0x0F); byte g = (byte)((color >> 8) & 0x0F); byte b = (byte)((color >> 4) & 0x0F); byte a = (byte)((color) & 0x0F); rgba8888 = (r << 4 | r) << 24 | (g << 4 | g) << 16 | (b << 4 | b) << 8 | (a << 4 | a); } else if (type == GL_UNSIGNED_SHORT_5_6_5) { byte r = (byte)((color >> 11) & 0x1F); byte g = (byte)((color >> 5) & 0x3F); byte b = (byte)((color) & 0x1F); rgba8888 = (r << 3 | r >> 2) << 24 | (g << 2 | g >> 4) << 16 | (b << 3 | b >> 2) << 8 | 0xFF; } else { byte r = (byte)((color >> 11) & 0x1F); byte g = (byte)((color >> 6) & 0x1F); byte b = (byte)((color >> 5) & 0x1F); byte a = (byte)((color) & 0x1); rgba8888 = (r << 3 | r >> 2) << 24 | (g << 3 | g >> 2) << 16 | (b << 3 | b >> 2) << 8 | a * 255; } converted.putInt(rgba8888); } converted.position(0); return converted; } public void glTexImage2D (int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels) { if (!shouldConvert16bit) { glTexImage2DJNI(target, level, internalformat, width, height, border, format, type, pixels); return; } if (type != GL_UNSIGNED_SHORT_5_6_5 && type != GL_UNSIGNED_SHORT_5_5_5_1 && type != GL_UNSIGNED_SHORT_4_4_4_4) { glTexImage2DJNI(target, level, internalformat, width, height, border, format, type, pixels); return; } Buffer converted = convert16bitBufferToRGBA8888(pixels, type); glTexImage2DJNI(target, level, GL_RGBA, width, height, border, GL_RGBA, GL_UNSIGNED_BYTE, converted); } public native void glTexImage2DJNI (int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels); public native void glTexParameterf (int target, int pname, float param); public native void glTexParameterfv (int target, int pname, FloatBuffer params); public native void glTexParameteri (int target, int pname, int param); public native void glTexParameteriv (int target, int pname, IntBuffer params); public void glTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels) { if (!shouldConvert16bit) { glTexSubImage2DJNI(target, level, xoffset, yoffset, width, height, format, type, pixels); return; } if (type != GL_UNSIGNED_SHORT_5_6_5 && type != GL_UNSIGNED_SHORT_5_5_5_1 && type != GL_UNSIGNED_SHORT_4_4_4_4) { glTexSubImage2DJNI(target, level, xoffset, yoffset, width, height, format, type, pixels); return; } Buffer converted = convert16bitBufferToRGBA8888(pixels, type); glTexSubImage2DJNI(target, level, xoffset, yoffset, width, height, GL_RGBA, GL_UNSIGNED_BYTE, converted); } public native void glTexSubImage2DJNI (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels); public native void glUniform1f (int location, float x); public native void glUniform1fv (int location, int count, FloatBuffer v); public native void glUniform1fv (int location, int count, float[] v, int offset); public native void glUniform1i (int location, int x); public native void glUniform1iv (int location, int count, IntBuffer v); public native void glUniform1iv (int location, int count, int[] v, int offset); public native void glUniform2f (int location, float x, float y); public native void glUniform2fv (int location, int count, FloatBuffer v); public native void glUniform2fv (int location, int count, float[] v, int offset); public native void glUniform2i (int location, int x, int y); public native void glUniform2iv (int location, int count, IntBuffer v); public native void glUniform2iv (int location, int count, int[] v, int offset); public native void glUniform3f (int location, float x, float y, float z); public native void glUniform3fv (int location, int count, FloatBuffer v); public native void glUniform3fv (int location, int count, float[] v, int offset); public native void glUniform3i (int location, int x, int y, int z); public native void glUniform3iv (int location, int count, IntBuffer v); public native void glUniform3iv (int location, int count, int[] v, int offset); public native void glUniform4f (int location, float x, float y, float z, float w); public native void glUniform4fv (int location, int count, FloatBuffer v); public native void glUniform4fv (int location, int count, float[] v, int offset); public native void glUniform4i (int location, int x, int y, int z, int w); public native void glUniform4iv (int location, int count, IntBuffer v); public native void glUniform4iv (int location, int count, int[] v, int offset); public native void glUniformMatrix2fv (int location, int count, boolean transpose, FloatBuffer value); public native void glUniformMatrix2fv (int location, int count, boolean transpose, float[] value, int offset); public native void glUniformMatrix3fv (int location, int count, boolean transpose, FloatBuffer value); public native void glUniformMatrix3fv (int location, int count, boolean transpose, float[] value, int offset); public native void glUniformMatrix4fv (int location, int count, boolean transpose, FloatBuffer value); public native void glUniformMatrix4fv (int location, int count, boolean transpose, float[] value, int offset); public native void glUseProgram (int program); public native void glValidateProgram (int program); public native void glVertexAttrib1f (int indx, float x); public native void glVertexAttrib1fv (int indx, FloatBuffer values); public native void glVertexAttrib2f (int indx, float x, float y); public native void glVertexAttrib2fv (int indx, FloatBuffer values); public native void glVertexAttrib3f (int indx, float x, float y, float z); public native void glVertexAttrib3fv (int indx, FloatBuffer values); public native void glVertexAttrib4f (int indx, float x, float y, float z, float w); public native void glVertexAttrib4fv (int indx, FloatBuffer values); public native void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, Buffer ptr); public native void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, int ptr); public void glViewport (int x, int y, int width, int height) { IOSGLES20.x = x; IOSGLES20.y = y; IOSGLES20.width = width; IOSGLES20.height = height; glViewportJni(x, y, width, height); } public native void glViewportJni (int x, int y, int width, int height); }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.iosrobovm; import java.nio.*; import com.badlogic.gdx.graphics.GL20; import org.robovm.apple.foundation.NSProcessInfo; public class IOSGLES20 implements GL20 { final boolean shouldConvert16bit = IOSApplication.IS_METALANGLE && NSProcessInfo.getSharedProcessInfo().getEnvironment().containsKey("SIMULATOR_DEVICE_NAME"); public IOSGLES20 () { init(); } /** last viewport set, needed because GLKView resets the viewport on each call to render... amazing **/ public static int x, y, width, height; private static native void init (); public native void glActiveTexture (int texture); public native void glAttachShader (int program, int shader); public native void glBindAttribLocation (int program, int index, String name); public native void glBindBuffer (int target, int buffer); public native void glBindFramebuffer (int target, int framebuffer); public native void glBindRenderbuffer (int target, int renderbuffer); public native void glBindTexture (int target, int texture); public native void glBlendColor (float red, float green, float blue, float alpha); public native void glBlendEquation (int mode); public native void glBlendEquationSeparate (int modeRGB, int modeAlpha); public native void glBlendFunc (int sfactor, int dfactor); public native void glBlendFuncSeparate (int srcRGB, int dstRGB, int srcAlpha, int dstAlpha); public native void glBufferData (int target, int size, Buffer data, int usage); public native void glBufferSubData (int target, int offset, int size, Buffer data); public native int glCheckFramebufferStatus (int target); public native void glClear (int mask); public native void glClearColor (float red, float green, float blue, float alpha); public native void glClearDepthf (float depth); public native void glClearStencil (int s); public native void glColorMask (boolean red, boolean green, boolean blue, boolean alpha); public native void glCompileShader (int shader); public native void glCompressedTexImage2D (int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data); public native void glCompressedTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data); public native void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border); public native void glCopyTexSubImage2D (int target, int level, int xoffset, int yoffset, int x, int y, int width, int height); public native int glCreateProgram (); public native int glCreateShader (int type); public native void glCullFace (int mode); public native void glDeleteBuffers (int n, IntBuffer buffers); public native void glDeleteBuffer (int buffer); public native void glDeleteFramebuffers (int n, IntBuffer framebuffers); public native void glDeleteFramebuffer (int framebuffer); public native void glDeleteProgram (int program); public native void glDeleteRenderbuffers (int n, IntBuffer renderbuffers); public native void glDeleteRenderbuffer (int renderbuffer); public native void glDeleteShader (int shader); public native void glDeleteTextures (int n, IntBuffer textures); public native void glDeleteTexture (int texture); public native void glDepthFunc (int func); public native void glDepthMask (boolean flag); public native void glDepthRangef (float zNear, float zFar); public native void glDetachShader (int program, int shader); public native void glDisable (int cap); public native void glDisableVertexAttribArray (int index); public native void glDrawArrays (int mode, int first, int count); public native void glDrawElements (int mode, int count, int type, Buffer indices); public native void glDrawElements (int mode, int count, int type, int indices); public native void glEnable (int cap); public native void glEnableVertexAttribArray (int index); public native void glFinish (); public native void glFlush (); public native void glFramebufferRenderbuffer (int target, int attachment, int renderbuffertarget, int renderbuffer); public native void glFramebufferTexture2D (int target, int attachment, int textarget, int texture, int level); public native void glFrontFace (int mode); public native void glGenBuffers (int n, IntBuffer buffers); public native int glGenBuffer (); public native void glGenerateMipmap (int target); public native void glGenFramebuffers (int n, IntBuffer framebuffers); public native int glGenFramebuffer (); public native void glGenRenderbuffers (int n, IntBuffer renderbuffers); public native int glGenRenderbuffer (); public native void glGenTextures (int n, IntBuffer textures); public native int glGenTexture (); public native String glGetActiveAttrib (int program, int index, IntBuffer size, IntBuffer type); public native String glGetActiveUniform (int program, int index, IntBuffer size, IntBuffer type); public native void glGetAttachedShaders (int program, int maxcount, Buffer count, IntBuffer shaders); public native int glGetAttribLocation (int program, String name); public native void glGetBooleanv (int pname, Buffer params); public native void glGetBufferParameteriv (int target, int pname, IntBuffer params); public native int glGetError (); public native void glGetFloatv (int pname, FloatBuffer params); public native void glGetFramebufferAttachmentParameteriv (int target, int attachment, int pname, IntBuffer params); public native void glGetIntegerv (int pname, IntBuffer params); public native void glGetProgramiv (int program, int pname, IntBuffer params); public native String glGetProgramInfoLog (int program); public native void glGetRenderbufferParameteriv (int target, int pname, IntBuffer params); public native void glGetShaderiv (int shader, int pname, IntBuffer params); public native String glGetShaderInfoLog (int shader); public native void glGetShaderPrecisionFormat (int shadertype, int precisiontype, IntBuffer range, IntBuffer precision); public native void glGetShaderSource (int shader, int bufsize, Buffer length, String source); public native String glGetString (int name); public native void glGetTexParameterfv (int target, int pname, FloatBuffer params); public native void glGetTexParameteriv (int target, int pname, IntBuffer params); public native void glGetUniformfv (int program, int location, FloatBuffer params); public native void glGetUniformiv (int program, int location, IntBuffer params); public native int glGetUniformLocation (int program, String name); public native void glGetVertexAttribfv (int index, int pname, FloatBuffer params); public native void glGetVertexAttribiv (int index, int pname, IntBuffer params); public native void glGetVertexAttribPointerv (int index, int pname, Buffer pointer); public native void glHint (int target, int mode); public native boolean glIsBuffer (int buffer); public native boolean glIsEnabled (int cap); public native boolean glIsFramebuffer (int framebuffer); public native boolean glIsProgram (int program); public native boolean glIsRenderbuffer (int renderbuffer); public native boolean glIsShader (int shader); public native boolean glIsTexture (int texture); public native void glLineWidth (float width); public native void glLinkProgram (int program); public native void glPixelStorei (int pname, int param); public native void glPolygonOffset (float factor, float units); public native void glReadPixels (int x, int y, int width, int height, int format, int type, Buffer pixels); public native void glReleaseShaderCompiler (); public native void glRenderbufferStorage (int target, int internalformat, int width, int height); public native void glSampleCoverage (float value, boolean invert); public native void glScissor (int x, int y, int width, int height); public native void glShaderBinary (int n, IntBuffer shaders, int binaryformat, Buffer binary, int length); public native void glShaderSource (int shader, String string); public native void glStencilFunc (int func, int ref, int mask); public native void glStencilFuncSeparate (int face, int func, int ref, int mask); public native void glStencilMask (int mask); public native void glStencilMaskSeparate (int face, int mask); public native void glStencilOp (int fail, int zfail, int zpass); public native void glStencilOpSeparate (int face, int fail, int zfail, int zpass); static Buffer convert16bitBufferToRGBA8888 (Buffer buffer, int type) { // TODO: 20.10.22 Can it be a different buffer type? ByteBuffer byteBuffer = (ByteBuffer)buffer; byteBuffer.order(ByteOrder.LITTLE_ENDIAN); ByteBuffer converted = ByteBuffer.allocateDirect(byteBuffer.limit() * 2); while (buffer.remaining() != 0) { short color = byteBuffer.getShort(); int rgba8888; if (type == GL_UNSIGNED_SHORT_4_4_4_4) { byte r = (byte)((color >> 12) & 0x0F); byte g = (byte)((color >> 8) & 0x0F); byte b = (byte)((color >> 4) & 0x0F); byte a = (byte)((color) & 0x0F); rgba8888 = (r << 4 | r) << 24 | (g << 4 | g) << 16 | (b << 4 | b) << 8 | (a << 4 | a); } else if (type == GL_UNSIGNED_SHORT_5_6_5) { byte r = (byte)((color >> 11) & 0x1F); byte g = (byte)((color >> 5) & 0x3F); byte b = (byte)((color) & 0x1F); rgba8888 = (r << 3 | r >> 2) << 24 | (g << 2 | g >> 4) << 16 | (b << 3 | b >> 2) << 8 | 0xFF; } else { byte r = (byte)((color >> 11) & 0x1F); byte g = (byte)((color >> 6) & 0x1F); byte b = (byte)((color >> 5) & 0x1F); byte a = (byte)((color) & 0x1); rgba8888 = (r << 3 | r >> 2) << 24 | (g << 3 | g >> 2) << 16 | (b << 3 | b >> 2) << 8 | a * 255; } converted.putInt(rgba8888); } converted.position(0); return converted; } public void glTexImage2D (int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels) { if (!shouldConvert16bit) { glTexImage2DJNI(target, level, internalformat, width, height, border, format, type, pixels); return; } if (type != GL_UNSIGNED_SHORT_5_6_5 && type != GL_UNSIGNED_SHORT_5_5_5_1 && type != GL_UNSIGNED_SHORT_4_4_4_4) { glTexImage2DJNI(target, level, internalformat, width, height, border, format, type, pixels); return; } Buffer converted = convert16bitBufferToRGBA8888(pixels, type); glTexImage2DJNI(target, level, GL_RGBA, width, height, border, GL_RGBA, GL_UNSIGNED_BYTE, converted); } public native void glTexImage2DJNI (int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels); public native void glTexParameterf (int target, int pname, float param); public native void glTexParameterfv (int target, int pname, FloatBuffer params); public native void glTexParameteri (int target, int pname, int param); public native void glTexParameteriv (int target, int pname, IntBuffer params); public void glTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels) { if (!shouldConvert16bit) { glTexSubImage2DJNI(target, level, xoffset, yoffset, width, height, format, type, pixels); return; } if (type != GL_UNSIGNED_SHORT_5_6_5 && type != GL_UNSIGNED_SHORT_5_5_5_1 && type != GL_UNSIGNED_SHORT_4_4_4_4) { glTexSubImage2DJNI(target, level, xoffset, yoffset, width, height, format, type, pixels); return; } Buffer converted = convert16bitBufferToRGBA8888(pixels, type); glTexSubImage2DJNI(target, level, xoffset, yoffset, width, height, GL_RGBA, GL_UNSIGNED_BYTE, converted); } public native void glTexSubImage2DJNI (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels); public native void glUniform1f (int location, float x); public native void glUniform1fv (int location, int count, FloatBuffer v); public native void glUniform1fv (int location, int count, float[] v, int offset); public native void glUniform1i (int location, int x); public native void glUniform1iv (int location, int count, IntBuffer v); public native void glUniform1iv (int location, int count, int[] v, int offset); public native void glUniform2f (int location, float x, float y); public native void glUniform2fv (int location, int count, FloatBuffer v); public native void glUniform2fv (int location, int count, float[] v, int offset); public native void glUniform2i (int location, int x, int y); public native void glUniform2iv (int location, int count, IntBuffer v); public native void glUniform2iv (int location, int count, int[] v, int offset); public native void glUniform3f (int location, float x, float y, float z); public native void glUniform3fv (int location, int count, FloatBuffer v); public native void glUniform3fv (int location, int count, float[] v, int offset); public native void glUniform3i (int location, int x, int y, int z); public native void glUniform3iv (int location, int count, IntBuffer v); public native void glUniform3iv (int location, int count, int[] v, int offset); public native void glUniform4f (int location, float x, float y, float z, float w); public native void glUniform4fv (int location, int count, FloatBuffer v); public native void glUniform4fv (int location, int count, float[] v, int offset); public native void glUniform4i (int location, int x, int y, int z, int w); public native void glUniform4iv (int location, int count, IntBuffer v); public native void glUniform4iv (int location, int count, int[] v, int offset); public native void glUniformMatrix2fv (int location, int count, boolean transpose, FloatBuffer value); public native void glUniformMatrix2fv (int location, int count, boolean transpose, float[] value, int offset); public native void glUniformMatrix3fv (int location, int count, boolean transpose, FloatBuffer value); public native void glUniformMatrix3fv (int location, int count, boolean transpose, float[] value, int offset); public native void glUniformMatrix4fv (int location, int count, boolean transpose, FloatBuffer value); public native void glUniformMatrix4fv (int location, int count, boolean transpose, float[] value, int offset); public native void glUseProgram (int program); public native void glValidateProgram (int program); public native void glVertexAttrib1f (int indx, float x); public native void glVertexAttrib1fv (int indx, FloatBuffer values); public native void glVertexAttrib2f (int indx, float x, float y); public native void glVertexAttrib2fv (int indx, FloatBuffer values); public native void glVertexAttrib3f (int indx, float x, float y, float z); public native void glVertexAttrib3fv (int indx, FloatBuffer values); public native void glVertexAttrib4f (int indx, float x, float y, float z, float w); public native void glVertexAttrib4fv (int indx, FloatBuffer values); public native void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, Buffer ptr); public native void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, int ptr); public void glViewport (int x, int y, int width, int height) { IOSGLES20.x = x; IOSGLES20.y = y; IOSGLES20.width = width; IOSGLES20.height = height; glViewportJni(x, y, width, height); } public native void glViewportJni (int x, int y, int width, int height); }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-box2d/gdx-box2d-gwt/src/com/badlogic/gdx/physics/box2d/gwt/emu/com/badlogic/gdx/physics/box2d/DestructionListener.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.physics.box2d; public interface DestructionListener { }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.physics.box2d; public interface DestructionListener { }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-setup/src/com/badlogic/gdx/setup/Project.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.setup; import java.util.ArrayList; import java.util.List; /** Describes all the files required to generate a new project for an Application. Files are found on the classpath of the * gdx-setup project, see package com.badlogic.gdx.setup.resources. * @author badlogic */ public class Project { /** list of files, relative to project directory **/ public List<ProjectFile> files = new ArrayList<ProjectFile>(); }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.setup; import java.util.ArrayList; import java.util.List; /** Describes all the files required to generate a new project for an Application. Files are found on the classpath of the * gdx-setup project, see package com.badlogic.gdx.setup.resources. * @author badlogic */ public class Project { /** list of files, relative to project directory **/ public List<ProjectFile> files = new ArrayList<ProjectFile>(); }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/graphics/g3d/particles/batches/ParticleBatch.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.particles.batches; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.g3d.RenderableProvider; import com.badlogic.gdx.graphics.g3d.particles.ResourceData; import com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerRenderData; /** Common interface to all the batches that render particles. * @author Inferno */ public interface ParticleBatch<T extends ParticleControllerRenderData> extends RenderableProvider, ResourceData.Configurable { /** Must be called once before any drawing operation */ public void begin (); public void draw (T controller); /** Must be called after all the drawing operations */ public void end (); public void save (AssetManager manager, ResourceData assetDependencyData); public void load (AssetManager manager, ResourceData assetDependencyData); }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g3d.particles.batches; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.g3d.RenderableProvider; import com.badlogic.gdx.graphics.g3d.particles.ResourceData; import com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerRenderData; /** Common interface to all the batches that render particles. * @author Inferno */ public interface ParticleBatch<T extends ParticleControllerRenderData> extends RenderableProvider, ResourceData.Configurable { /** Must be called once before any drawing operation */ public void begin (); public void draw (T controller); /** Must be called after all the drawing operations */ public void end (); public void save (AssetManager manager, ResourceData assetDependencyData); public void load (AssetManager manager, ResourceData assetDependencyData); }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/linearmath/com/badlogic/gdx/physics/bullet/linearmath/btIntSortPredicate.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.linearmath; import com.badlogic.gdx.physics.bullet.BulletBase; public class btIntSortPredicate extends BulletBase { private long swigCPtr; protected btIntSortPredicate (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btIntSortPredicate, normally you should not need this constructor it's intended for low-level usage. */ public btIntSortPredicate (long cPtr, boolean cMemoryOwn) { this("btIntSortPredicate", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (btIntSortPredicate obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; LinearMathJNI.delete_btIntSortPredicate(swigCPtr); } swigCPtr = 0; } super.delete(); } public boolean operatorFunctionCall (int a, int b) { return LinearMathJNI.btIntSortPredicate_operatorFunctionCall(swigCPtr, this, a, b); } public btIntSortPredicate () { this(LinearMathJNI.new_btIntSortPredicate(), true); } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.linearmath; import com.badlogic.gdx.physics.bullet.BulletBase; public class btIntSortPredicate extends BulletBase { private long swigCPtr; protected btIntSortPredicate (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btIntSortPredicate, normally you should not need this constructor it's intended for low-level usage. */ public btIntSortPredicate (long cPtr, boolean cMemoryOwn) { this("btIntSortPredicate", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (btIntSortPredicate obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; LinearMathJNI.delete_btIntSortPredicate(swigCPtr); } swigCPtr = 0; } super.delete(); } public boolean operatorFunctionCall (int a, int b) { return LinearMathJNI.btIntSortPredicate_operatorFunctionCall(swigCPtr, this, a, b); } public btIntSortPredicate () { this(LinearMathJNI.new_btIntSortPredicate(), true); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/objectal/ALBuffer.java
/******************************************************************************* * Copyright 2013 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.iosrobovm.objectal; import org.robovm.apple.foundation.NSObject; import org.robovm.objc.ObjCRuntime; import org.robovm.objc.annotation.NativeClass; import org.robovm.rt.bro.annotation.Library; /** @author Niklas Therning */ @Library(Library.INTERNAL) @NativeClass public class ALBuffer extends NSObject { static { ObjCRuntime.bind(ALBuffer.class); } }
/******************************************************************************* * Copyright 2013 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.iosrobovm.objectal; import org.robovm.apple.foundation.NSObject; import org.robovm.objc.ObjCRuntime; import org.robovm.objc.annotation.NativeClass; import org.robovm.rt.bro.annotation.Library; /** @author Niklas Therning */ @Library(Library.INTERNAL) @NativeClass public class ALBuffer extends NSObject { static { ObjCRuntime.bind(ALBuffer.class); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/collision/com/badlogic/gdx/physics/bullet/collision/GdxCollisionObjectBridge.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.BulletBase; import com.badlogic.gdx.physics.bullet.linearmath.*; public class GdxCollisionObjectBridge extends BulletBase { private long swigCPtr; protected GdxCollisionObjectBridge (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new GdxCollisionObjectBridge, normally you should not need this constructor it's intended for low-level * usage. */ public GdxCollisionObjectBridge (long cPtr, boolean cMemoryOwn) { this("GdxCollisionObjectBridge", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (GdxCollisionObjectBridge obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_GdxCollisionObjectBridge(swigCPtr); } swigCPtr = 0; } super.delete(); } public void setUserValue (int value) { CollisionJNI.GdxCollisionObjectBridge_userValue_set(swigCPtr, this, value); } public int getUserValue () { return CollisionJNI.GdxCollisionObjectBridge_userValue_get(swigCPtr, this); } public void setContactCallbackFlag (int value) { CollisionJNI.GdxCollisionObjectBridge_contactCallbackFlag_set(swigCPtr, this, value); } public int getContactCallbackFlag () { return CollisionJNI.GdxCollisionObjectBridge_contactCallbackFlag_get(swigCPtr, this); } public void setContactCallbackFilter (int value) { CollisionJNI.GdxCollisionObjectBridge_contactCallbackFilter_set(swigCPtr, this, value); } public int getContactCallbackFilter () { return CollisionJNI.GdxCollisionObjectBridge_contactCallbackFilter_get(swigCPtr, this); } public GdxCollisionObjectBridge () { this(CollisionJNI.new_GdxCollisionObjectBridge(), true); } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.BulletBase; import com.badlogic.gdx.physics.bullet.linearmath.*; public class GdxCollisionObjectBridge extends BulletBase { private long swigCPtr; protected GdxCollisionObjectBridge (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new GdxCollisionObjectBridge, normally you should not need this constructor it's intended for low-level * usage. */ public GdxCollisionObjectBridge (long cPtr, boolean cMemoryOwn) { this("GdxCollisionObjectBridge", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (GdxCollisionObjectBridge obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_GdxCollisionObjectBridge(swigCPtr); } swigCPtr = 0; } super.delete(); } public void setUserValue (int value) { CollisionJNI.GdxCollisionObjectBridge_userValue_set(swigCPtr, this, value); } public int getUserValue () { return CollisionJNI.GdxCollisionObjectBridge_userValue_get(swigCPtr, this); } public void setContactCallbackFlag (int value) { CollisionJNI.GdxCollisionObjectBridge_contactCallbackFlag_set(swigCPtr, this, value); } public int getContactCallbackFlag () { return CollisionJNI.GdxCollisionObjectBridge_contactCallbackFlag_get(swigCPtr, this); } public void setContactCallbackFilter (int value) { CollisionJNI.GdxCollisionObjectBridge_contactCallbackFilter_set(swigCPtr, this, value); } public int getContactCallbackFilter () { return CollisionJNI.GdxCollisionObjectBridge_contactCallbackFilter_get(swigCPtr, this); } public GdxCollisionObjectBridge () { this(CollisionJNI.new_GdxCollisionObjectBridge(), true); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/collision/com/badlogic/gdx/physics/bullet/collision/btBvhSubtreeInfoData.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.BulletBase; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btBvhSubtreeInfoData extends BulletBase { private long swigCPtr; protected btBvhSubtreeInfoData (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btBvhSubtreeInfoData, normally you should not need this constructor it's intended for low-level usage. */ public btBvhSubtreeInfoData (long cPtr, boolean cMemoryOwn) { this("btBvhSubtreeInfoData", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (btBvhSubtreeInfoData obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btBvhSubtreeInfoData(swigCPtr); } swigCPtr = 0; } super.delete(); } public void setRootNodeIndex (int value) { CollisionJNI.btBvhSubtreeInfoData_rootNodeIndex_set(swigCPtr, this, value); } public int getRootNodeIndex () { return CollisionJNI.btBvhSubtreeInfoData_rootNodeIndex_get(swigCPtr, this); } public void setSubtreeSize (int value) { CollisionJNI.btBvhSubtreeInfoData_subtreeSize_set(swigCPtr, this, value); } public int getSubtreeSize () { return CollisionJNI.btBvhSubtreeInfoData_subtreeSize_get(swigCPtr, this); } public void setQuantizedAabbMin (int[] value) { CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMin_set(swigCPtr, this, value); } public int[] getQuantizedAabbMin () { return CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMin_get(swigCPtr, this); } public void setQuantizedAabbMax (int[] value) { CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMax_set(swigCPtr, this, value); } public int[] getQuantizedAabbMax () { return CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMax_get(swigCPtr, this); } public btBvhSubtreeInfoData () { this(CollisionJNI.new_btBvhSubtreeInfoData(), true); } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.BulletBase; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btBvhSubtreeInfoData extends BulletBase { private long swigCPtr; protected btBvhSubtreeInfoData (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btBvhSubtreeInfoData, normally you should not need this constructor it's intended for low-level usage. */ public btBvhSubtreeInfoData (long cPtr, boolean cMemoryOwn) { this("btBvhSubtreeInfoData", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (btBvhSubtreeInfoData obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btBvhSubtreeInfoData(swigCPtr); } swigCPtr = 0; } super.delete(); } public void setRootNodeIndex (int value) { CollisionJNI.btBvhSubtreeInfoData_rootNodeIndex_set(swigCPtr, this, value); } public int getRootNodeIndex () { return CollisionJNI.btBvhSubtreeInfoData_rootNodeIndex_get(swigCPtr, this); } public void setSubtreeSize (int value) { CollisionJNI.btBvhSubtreeInfoData_subtreeSize_set(swigCPtr, this, value); } public int getSubtreeSize () { return CollisionJNI.btBvhSubtreeInfoData_subtreeSize_get(swigCPtr, this); } public void setQuantizedAabbMin (int[] value) { CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMin_set(swigCPtr, this, value); } public int[] getQuantizedAabbMin () { return CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMin_get(swigCPtr, this); } public void setQuantizedAabbMax (int[] value) { CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMax_set(swigCPtr, this, value); } public int[] getQuantizedAabbMax () { return CollisionJNI.btBvhSubtreeInfoData_quantizedAabbMax_get(swigCPtr, this); } public btBvhSubtreeInfoData () { this(CollisionJNI.new_btBvhSubtreeInfoData(), true); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/RayCastTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.collision.Ray; import com.badlogic.gdx.physics.bullet.collision.btCollisionObject; import com.badlogic.gdx.physics.bullet.collision.ClosestRayResultCallback; import com.badlogic.gdx.physics.bullet.dynamics.btRigidBody; /** @author xoppa */ public class RayCastTest extends BaseBulletTest { final int BOXCOUNT_X = 5; final int BOXCOUNT_Y = 5; final int BOXCOUNT_Z = 1; final float BOXOFFSET_X = 0f; final float BOXOFFSET_Y = 0.5f; final float BOXOFFSET_Z = 2.5f; ClosestRayResultCallback rayTestCB; Vector3 rayFrom = new Vector3(); Vector3 rayTo = new Vector3(); @Override public void create () { super.create(); instructions = "Tap a box to ray cast\nLong press to toggle debug mode\nSwipe for next test\nCtrl+drag to rotate\nScroll to zoom"; // Create the entities world.add("ground", -7f, 0f, -7f).setColor(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { for (int z = 0; z < BOXCOUNT_Z; z++) { world.add("box", BOXOFFSET_X + x, BOXOFFSET_Y + y, BOXOFFSET_Z + z).setColor(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 1f); } } } rayTestCB = new ClosestRayResultCallback(Vector3.Zero, Vector3.Z); } @Override public void dispose () { if (rayTestCB != null) rayTestCB.dispose(); rayTestCB = null; super.dispose(); } @Override public boolean tap (float x, float y, int count, int button) { Ray ray = camera.getPickRay(x, y); rayFrom.set(ray.origin); rayTo.set(ray.direction).scl(50f).add(rayFrom); // 50 meters max from the origin // Because we reuse the ClosestRayResultCallback, we need reset it's values rayTestCB.setCollisionObject(null); rayTestCB.setClosestHitFraction(1f); rayTestCB.setRayFromWorld(rayFrom); rayTestCB.setRayToWorld(rayTo); world.collisionWorld.rayTest(rayFrom, rayTo, rayTestCB); if (rayTestCB.hasHit()) { final btCollisionObject obj = rayTestCB.getCollisionObject(); if (!obj.isStaticOrKinematicObject()) { final btRigidBody body = (btRigidBody)(obj); body.activate(); body.applyCentralImpulse(tmpV2.set(ray.direction).scl(20f)); } } return true; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.collision.Ray; import com.badlogic.gdx.physics.bullet.collision.btCollisionObject; import com.badlogic.gdx.physics.bullet.collision.ClosestRayResultCallback; import com.badlogic.gdx.physics.bullet.dynamics.btRigidBody; /** @author xoppa */ public class RayCastTest extends BaseBulletTest { final int BOXCOUNT_X = 5; final int BOXCOUNT_Y = 5; final int BOXCOUNT_Z = 1; final float BOXOFFSET_X = 0f; final float BOXOFFSET_Y = 0.5f; final float BOXOFFSET_Z = 2.5f; ClosestRayResultCallback rayTestCB; Vector3 rayFrom = new Vector3(); Vector3 rayTo = new Vector3(); @Override public void create () { super.create(); instructions = "Tap a box to ray cast\nLong press to toggle debug mode\nSwipe for next test\nCtrl+drag to rotate\nScroll to zoom"; // Create the entities world.add("ground", -7f, 0f, -7f).setColor(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { for (int z = 0; z < BOXCOUNT_Z; z++) { world.add("box", BOXOFFSET_X + x, BOXOFFSET_Y + y, BOXOFFSET_Z + z).setColor(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.random(), 1f); } } } rayTestCB = new ClosestRayResultCallback(Vector3.Zero, Vector3.Z); } @Override public void dispose () { if (rayTestCB != null) rayTestCB.dispose(); rayTestCB = null; super.dispose(); } @Override public boolean tap (float x, float y, int count, int button) { Ray ray = camera.getPickRay(x, y); rayFrom.set(ray.origin); rayTo.set(ray.direction).scl(50f).add(rayFrom); // 50 meters max from the origin // Because we reuse the ClosestRayResultCallback, we need reset it's values rayTestCB.setCollisionObject(null); rayTestCB.setClosestHitFraction(1f); rayTestCB.setRayFromWorld(rayFrom); rayTestCB.setRayToWorld(rayTo); world.collisionWorld.rayTest(rayFrom, rayTo, rayTestCB); if (rayTestCB.hasHit()) { final btCollisionObject obj = rayTestCB.getCollisionObject(); if (!obj.isStaticOrKinematicObject()) { final btRigidBody body = (btRigidBody)(obj); body.activate(); body.applyCentralImpulse(tmpV2.set(ray.direction).scl(20f)); } } return true; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests-android/assets/data/badlogic-with-whitespace.png
PNG  IHDR,,y}u pHYs   iTXtXML:com.adobe.xmp<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c145 79.163499, 2018/08/13-16:40:22 "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmpMM:DocumentID="adobe:docid:photoshop:41d28914-ecb8-9d41-918b-dd869d42dae0" xmpMM:InstanceID="xmp.iid:48d00922-457e-b943-bb22-0eb93c0676db" xmpMM:OriginalDocumentID="361A9F60E10ECB56239CB1628A696231" dc:format="image/png" photoshop:ColorMode="3" photoshop:ICCProfile="sRGB IEC61966-2.1" xmp:CreateDate="2018-11-07T14:43:51+04:00" xmp:ModifyDate="2018-11-08T12:15:32+04:00" xmp:MetadataDate="2018-11-08T12:15:32+04:00" tiff:ImageWidth="256" tiff:ImageLength="256" tiff:PhotometricInterpretation="2" tiff:SamplesPerPixel="3" tiff:XResolution="72/1" tiff:YResolution="72/1" tiff:ResolutionUnit="2" exif:ExifVersion="0221" exif:ColorSpace="65535" exif:PixelXDimension="256" exif:PixelYDimension="256"> <xmpMM:History> <rdf:Seq> <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:b3e6d3f0-e037-e04b-976e-babd16e6f265" stEvt:when="2018-11-07T14:44:44+04:00" stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/"/> <rdf:li stEvt:action="converted" stEvt:parameters="from image/jpeg to image/png"/> <rdf:li stEvt:action="derived" stEvt:parameters="converted from image/jpeg to image/png"/> <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:b1a4318e-996c-194f-bc0e-5e779c7831b4" stEvt:when="2018-11-07T14:44:44+04:00" stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/"/> <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:48d00922-457e-b943-bb22-0eb93c0676db" stEvt:when="2018-11-08T12:15:32+04:00" stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/"/> </rdf:Seq> </xmpMM:History> <xmpMM:DerivedFrom stRef:instanceID="xmp.iid:b3e6d3f0-e037-e04b-976e-babd16e6f265" stRef:documentID="361A9F60E10ECB56239CB1628A696231" stRef:originalDocumentID="361A9F60E10ECB56239CB1628A696231"/> <photoshop:TextLayers> <rdf:Bag> <rdf:li photoshop:LayerName="Whitespace" photoshop:LayerText="Whitespace"/> </rdf:Bag> </photoshop:TextLayers> <tiff:BitsPerSample> <rdf:Seq> <rdf:li>8</rdf:li> <rdf:li>8</rdf:li> <rdf:li>8</rdf:li> </rdf:Seq> </tiff:BitsPerSample> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="r"?>KkTIDATxw?3s[)EPcM$"cQ#"`bID1]57tRv{g3wn]M}yv̼yE8G|@o7#p G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[G8G[*D(a躎a(\.\. B( rqUU9\Mp\䶭)\Mph$t:y"a7NyZY}B0 @*;Sn!\.Ll^q^M5_Uog%+Y(ͪ`,p)}Jjb׫i*[p2T՜f,P7uݞWneW5W烝WW>w+Y,ٟƾoo/e!Lb t:M*"HXCpݨR)R)srA:&L:z &I{5M-Vo:Fud^gvM&B/fr|x<\.P1sYevzx^ 7nEQpM&2q5\4IgU͞Fz4&$gXaxm,L"Io+@uYn:tt֚6;9in% ^/>ۍϒ波(n0! ri۞D커d2[ ɓ'H'iFƍmnz !<y2UUU!8pM$~t:gaʉ2dz 6 p `ʔ)TVV~z0yzΨQv{n8>7o2 +Gg&/8ؼy~JJJ+dԨQ|g{5F,T͡PC9ch6mٌi((Y9H涹˯GΜFqL!rd|F,$3ۼ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ӄo, <ږMgv>@E˻dgNDs^/:_m\9EZ/ ƍDgbƥDQd bl\YDsuFfq7wDZQgG:!hj5s=uj>_3: ;</Z˗]Cyh=w.Xtl?E ּ'W|1py#;б U4u)${We6g5q՛XZF)~V{ @מO< a&:僛i\^ !i,d :S  ҍhuQįxA'x:| vw^OAY kK,Yt:~zZ'y\A:XbVk_ 7##zk֬ڵkYkb͚5ĬYdVl~ qi?uΑ$%NqJ^VYYY={6^|EEO͆2p:<Z(++pi\u6?6nذøį9.?|˖-(Xlz!Fwy+Vf Htߑz-^|E̞=nذ+V@lll|Ek,--W111l\Ǐ (D! nz?d( *(\3XQB (D! DVk+ Q5Q(DᚁBp@T`E! Qf *(\3XQB (D! DVk+ Q5Q(DᚁBp@T`E! Qf *(\3XQB (D! DVk  $IENDB`
PNG  IHDR,,y}u pHYs   iTXtXML:com.adobe.xmp<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c145 79.163499, 2018/08/13-16:40:22 "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmpMM:DocumentID="adobe:docid:photoshop:41d28914-ecb8-9d41-918b-dd869d42dae0" xmpMM:InstanceID="xmp.iid:48d00922-457e-b943-bb22-0eb93c0676db" xmpMM:OriginalDocumentID="361A9F60E10ECB56239CB1628A696231" dc:format="image/png" photoshop:ColorMode="3" photoshop:ICCProfile="sRGB IEC61966-2.1" xmp:CreateDate="2018-11-07T14:43:51+04:00" xmp:ModifyDate="2018-11-08T12:15:32+04:00" xmp:MetadataDate="2018-11-08T12:15:32+04:00" tiff:ImageWidth="256" tiff:ImageLength="256" tiff:PhotometricInterpretation="2" tiff:SamplesPerPixel="3" tiff:XResolution="72/1" tiff:YResolution="72/1" tiff:ResolutionUnit="2" exif:ExifVersion="0221" exif:ColorSpace="65535" exif:PixelXDimension="256" exif:PixelYDimension="256"> <xmpMM:History> <rdf:Seq> <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:b3e6d3f0-e037-e04b-976e-babd16e6f265" stEvt:when="2018-11-07T14:44:44+04:00" stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/"/> <rdf:li stEvt:action="converted" stEvt:parameters="from image/jpeg to image/png"/> <rdf:li stEvt:action="derived" stEvt:parameters="converted from image/jpeg to image/png"/> <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:b1a4318e-996c-194f-bc0e-5e779c7831b4" stEvt:when="2018-11-07T14:44:44+04:00" stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/"/> <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:48d00922-457e-b943-bb22-0eb93c0676db" stEvt:when="2018-11-08T12:15:32+04:00" stEvt:softwareAgent="Adobe Photoshop CC 2019 (Windows)" stEvt:changed="/"/> </rdf:Seq> </xmpMM:History> <xmpMM:DerivedFrom stRef:instanceID="xmp.iid:b3e6d3f0-e037-e04b-976e-babd16e6f265" stRef:documentID="361A9F60E10ECB56239CB1628A696231" stRef:originalDocumentID="361A9F60E10ECB56239CB1628A696231"/> <photoshop:TextLayers> <rdf:Bag> <rdf:li photoshop:LayerName="Whitespace" photoshop:LayerText="Whitespace"/> </rdf:Bag> </photoshop:TextLayers> <tiff:BitsPerSample> <rdf:Seq> <rdf:li>8</rdf:li> <rdf:li>8</rdf:li> <rdf:li>8</rdf:li>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6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/collision/com/badlogic/gdx/physics/bullet/collision/btEmptyAlgorithm.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btEmptyAlgorithm extends btCollisionAlgorithm { private long swigCPtr; protected btEmptyAlgorithm (final String className, long cPtr, boolean cMemoryOwn) { super(className, CollisionJNI.btEmptyAlgorithm_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btEmptyAlgorithm, normally you should not need this constructor it's intended for low-level usage. */ public btEmptyAlgorithm (long cPtr, boolean cMemoryOwn) { this("btEmptyAlgorithm", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(CollisionJNI.btEmptyAlgorithm_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (btEmptyAlgorithm obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btEmptyAlgorithm(swigCPtr); } swigCPtr = 0; } super.delete(); } public btEmptyAlgorithm (btCollisionAlgorithmConstructionInfo ci) { this(CollisionJNI.new_btEmptyAlgorithm(btCollisionAlgorithmConstructionInfo.getCPtr(ci), ci), true); } static public class CreateFunc extends btCollisionAlgorithmCreateFunc { private long swigCPtr; protected CreateFunc (final String className, long cPtr, boolean cMemoryOwn) { super(className, CollisionJNI.btEmptyAlgorithm_CreateFunc_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new CreateFunc, normally you should not need this constructor it's intended for low-level usage. */ public CreateFunc (long cPtr, boolean cMemoryOwn) { this("CreateFunc", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(CollisionJNI.btEmptyAlgorithm_CreateFunc_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (CreateFunc obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btEmptyAlgorithm_CreateFunc(swigCPtr); } swigCPtr = 0; } super.delete(); } public CreateFunc () { this(CollisionJNI.new_btEmptyAlgorithm_CreateFunc(), true); } } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btEmptyAlgorithm extends btCollisionAlgorithm { private long swigCPtr; protected btEmptyAlgorithm (final String className, long cPtr, boolean cMemoryOwn) { super(className, CollisionJNI.btEmptyAlgorithm_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btEmptyAlgorithm, normally you should not need this constructor it's intended for low-level usage. */ public btEmptyAlgorithm (long cPtr, boolean cMemoryOwn) { this("btEmptyAlgorithm", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(CollisionJNI.btEmptyAlgorithm_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (btEmptyAlgorithm obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btEmptyAlgorithm(swigCPtr); } swigCPtr = 0; } super.delete(); } public btEmptyAlgorithm (btCollisionAlgorithmConstructionInfo ci) { this(CollisionJNI.new_btEmptyAlgorithm(btCollisionAlgorithmConstructionInfo.getCPtr(ci), ci), true); } static public class CreateFunc extends btCollisionAlgorithmCreateFunc { private long swigCPtr; protected CreateFunc (final String className, long cPtr, boolean cMemoryOwn) { super(className, CollisionJNI.btEmptyAlgorithm_CreateFunc_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new CreateFunc, normally you should not need this constructor it's intended for low-level usage. */ public CreateFunc (long cPtr, boolean cMemoryOwn) { this("CreateFunc", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(CollisionJNI.btEmptyAlgorithm_CreateFunc_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (CreateFunc obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btEmptyAlgorithm_CreateFunc(swigCPtr); } swigCPtr = 0; } super.delete(); } public CreateFunc () { this(CollisionJNI.new_btEmptyAlgorithm_CreateFunc(), true); } } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-freetype/src/com/badlogic/gdx/graphics/g2d/freetype/FreeTypeFontGenerator.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g2d.freetype; import java.nio.ByteBuffer; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Pixmap.Blending; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData; import com.badlogic.gdx.graphics.g2d.BitmapFont.Glyph; import com.badlogic.gdx.graphics.g2d.GlyphLayout.GlyphRun; import com.badlogic.gdx.graphics.g2d.PixmapPacker; import com.badlogic.gdx.graphics.g2d.PixmapPacker.GuillotineStrategy; import com.badlogic.gdx.graphics.g2d.PixmapPacker.PackStrategy; import com.badlogic.gdx.graphics.g2d.PixmapPacker.SkylineStrategy; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Bitmap; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Face; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphMetrics; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Library; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.SizeMetrics; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Stroker; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.Null; /** Generates {@link BitmapFont} and {@link BitmapFontData} instances from TrueType, OTF, and other FreeType supported fonts. * </p> * * Usage example: * * <pre> * FreeTypeFontGenerator gen = new FreeTypeFontGenerator(Gdx.files.internal(&quot;myfont.ttf&quot;)); * BitmapFont font = gen.generateFont(16); * gen.dispose(); // Don't dispose if doing incremental glyph generation. * </pre> * * The generator has to be disposed once it is no longer used. The returned {@link BitmapFont} instances are managed by the user * and have to be disposed as usual. * * @author mzechner * @author Nathan Sweet * @author Rob Rendell */ public class FreeTypeFontGenerator implements Disposable { static public final String DEFAULT_CHARS = "\u0000ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!`?'.,;:()[]{}<>|/@\\^$€-%+=#_&~*\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F\u00A0\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A8\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF"; /** A hint to scale the texture as needed, without capping it at any maximum size */ static public final int NO_MAXIMUM = -1; /** The maximum texture size allowed by generateData, when storing in a texture atlas. Multiple texture pages will be created * if necessary. Default is 1024. * @see #setMaxTextureSize(int) */ static private int maxTextureSize = 1024; final Library library; final Face face; final String name; boolean bitmapped = false; private int pixelWidth, pixelHeight; /** {@link #FreeTypeFontGenerator(FileHandle, int)} */ public FreeTypeFontGenerator (FileHandle fontFile) { this(fontFile, 0); } /** Creates a new generator from the given font file. Uses {@link FileHandle#length()} to determine the file size. If the file * length could not be determined (it was 0), an extra copy of the font bytes is performed. Throws a * {@link GdxRuntimeException} if loading did not succeed. */ public FreeTypeFontGenerator (FileHandle fontFile, int faceIndex) { name = fontFile.nameWithoutExtension(); library = FreeType.initFreeType(); face = library.newFace(fontFile, faceIndex); if (checkForBitmapFont()) return; setPixelSizes(0, 15); } private int getLoadingFlags (FreeTypeFontParameter parameter) { int loadingFlags = FreeType.FT_LOAD_DEFAULT; switch (parameter.hinting) { case None: loadingFlags |= FreeType.FT_LOAD_NO_HINTING; break; case Slight: loadingFlags |= FreeType.FT_LOAD_TARGET_LIGHT; break; case Medium: loadingFlags |= FreeType.FT_LOAD_TARGET_NORMAL; break; case Full: loadingFlags |= FreeType.FT_LOAD_TARGET_MONO; break; case AutoSlight: loadingFlags |= FreeType.FT_LOAD_FORCE_AUTOHINT | FreeType.FT_LOAD_TARGET_LIGHT; break; case AutoMedium: loadingFlags |= FreeType.FT_LOAD_FORCE_AUTOHINT | FreeType.FT_LOAD_TARGET_NORMAL; break; case AutoFull: loadingFlags |= FreeType.FT_LOAD_FORCE_AUTOHINT | FreeType.FT_LOAD_TARGET_MONO; break; } return loadingFlags; } private boolean loadChar (int c) { return loadChar(c, FreeType.FT_LOAD_DEFAULT | FreeType.FT_LOAD_FORCE_AUTOHINT); } private boolean loadChar (int c, int flags) { return face.loadChar(c, flags); } private boolean checkForBitmapFont () { int faceFlags = face.getFaceFlags(); if (((faceFlags & FreeType.FT_FACE_FLAG_FIXED_SIZES) == FreeType.FT_FACE_FLAG_FIXED_SIZES) && ((faceFlags & FreeType.FT_FACE_FLAG_HORIZONTAL) == FreeType.FT_FACE_FLAG_HORIZONTAL)) { if (loadChar(32)) { GlyphSlot slot = face.getGlyph(); if (slot.getFormat() == 1651078259) { bitmapped = true; } } } return bitmapped; } public BitmapFont generateFont (FreeTypeFontParameter parameter) { return generateFont(parameter, new FreeTypeBitmapFontData()); } /** Generates a new {@link BitmapFont}. The size is expressed in pixels. Throws a GdxRuntimeException if the font could not be * generated. Using big sizes might cause such an exception. * @param parameter configures how the font is generated */ public BitmapFont generateFont (FreeTypeFontParameter parameter, FreeTypeBitmapFontData data) { boolean updateTextureRegions = data.regions == null && parameter.packer != null; if (updateTextureRegions) data.regions = new Array(); generateData(parameter, data); if (updateTextureRegions) parameter.packer.updateTextureRegions(data.regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); if (data.regions.isEmpty()) throw new GdxRuntimeException("Unable to create a font with no texture regions."); BitmapFont font = newBitmapFont(data, data.regions, true); font.setOwnsTexture(parameter.packer == null); return font; } /** Called by generateFont to create a new {@link BitmapFont} instance. This allows injecting a customized {@link BitmapFont}, * eg for a RTL font. * @see BitmapFont#BitmapFont(BitmapFontData, Array, boolean) */ protected BitmapFont newBitmapFont (BitmapFontData data, Array<TextureRegion> pageRegions, boolean integer) { return new BitmapFont(data, pageRegions, integer); } /** Uses ascender and descender of font to calculate real height that makes all glyphs to fit in given pixel size. Source: * http://nothings.org/stb/stb_truetype.h / stbtt_ScaleForPixelHeight */ public int scaleForPixelHeight (int height) { setPixelSizes(0, height); SizeMetrics fontMetrics = face.getSize().getMetrics(); int ascent = FreeType.toInt(fontMetrics.getAscender()); int descent = FreeType.toInt(fontMetrics.getDescender()); return height * height / (ascent - descent); } /** Uses max advance, ascender and descender of font to calculate real height that makes any n glyphs to fit in given pixel * width. * @param width the max width to fit (in pixels) * @param numChars max number of characters that to fill width */ public int scaleForPixelWidth (int width, int numChars) { SizeMetrics fontMetrics = face.getSize().getMetrics(); int advance = FreeType.toInt(fontMetrics.getMaxAdvance()); int ascent = FreeType.toInt(fontMetrics.getAscender()); int descent = FreeType.toInt(fontMetrics.getDescender()); int unscaledHeight = ascent - descent; int height = unscaledHeight * width / (advance * numChars); setPixelSizes(0, height); return height; } /** Uses max advance, ascender and descender of font to calculate real height that makes any n glyphs to fit in given pixel * width and height. * @param width the max width to fit (in pixels) * @param height the max height to fit (in pixels) * @param numChars max number of characters that to fill width */ public int scaleToFitSquare (int width, int height, int numChars) { return Math.min(scaleForPixelHeight(height), scaleForPixelWidth(width, numChars)); } public class GlyphAndBitmap { public Glyph glyph; public @Null Bitmap bitmap; } /** Returns null if glyph was not found in the font. If there is nothing to render, for example with various space characters, * then {@link GlyphAndBitmap#bitmap} will be null. */ public @Null GlyphAndBitmap generateGlyphAndBitmap (int c, int size, boolean flip) { setPixelSizes(0, size); SizeMetrics fontMetrics = face.getSize().getMetrics(); int baseline = FreeType.toInt(fontMetrics.getAscender()); // Check if character exists in this font. // 0 means 'undefined character code' if (face.getCharIndex(c) == 0) { return null; } // Try to load character if (!loadChar(c)) { throw new GdxRuntimeException("Unable to load character!"); } GlyphSlot slot = face.getGlyph(); // Try to render to bitmap Bitmap bitmap; if (bitmapped) { bitmap = slot.getBitmap(); } else if (!slot.renderGlyph(FreeType.FT_RENDER_MODE_NORMAL)) { bitmap = null; } else { bitmap = slot.getBitmap(); } GlyphMetrics metrics = slot.getMetrics(); Glyph glyph = new Glyph(); if (bitmap != null) { glyph.width = bitmap.getWidth(); glyph.height = bitmap.getRows(); } else { glyph.width = 0; glyph.height = 0; } glyph.xoffset = slot.getBitmapLeft(); glyph.yoffset = flip ? -slot.getBitmapTop() + baseline : -(glyph.height - slot.getBitmapTop()) - baseline; glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance()); glyph.srcX = 0; glyph.srcY = 0; glyph.id = c; GlyphAndBitmap result = new GlyphAndBitmap(); result.glyph = glyph; result.bitmap = bitmap; return result; } /** Generates a new {@link BitmapFontData} instance, expert usage only. Throws a GdxRuntimeException if something went wrong. * @param size the size in pixels */ public FreeTypeBitmapFontData generateData (int size) { FreeTypeFontParameter parameter = new FreeTypeFontParameter(); parameter.size = size; return generateData(parameter); } public FreeTypeBitmapFontData generateData (FreeTypeFontParameter parameter) { return generateData(parameter, new FreeTypeBitmapFontData()); } void setPixelSizes (int pixelWidth, int pixelHeight) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; if (!bitmapped && !face.setPixelSizes(pixelWidth, pixelHeight)) throw new GdxRuntimeException("Couldn't set size for font"); } /** Generates a new {@link BitmapFontData} instance, expert usage only. Throws a GdxRuntimeException if something went wrong. * @param parameter configures how the font is generated */ public FreeTypeBitmapFontData generateData (FreeTypeFontParameter parameter, FreeTypeBitmapFontData data) { data.name = name + "-" + parameter.size; char[] characters = parameter.characters.toCharArray(); int charactersLength = characters.length; boolean incremental = parameter.incremental; int flags = getLoadingFlags(parameter); setPixelSizes(0, parameter.size); // set general font data SizeMetrics fontMetrics = face.getSize().getMetrics(); data.flipped = parameter.flip; data.ascent = FreeType.toInt(fontMetrics.getAscender()); data.descent = FreeType.toInt(fontMetrics.getDescender()); data.lineHeight = FreeType.toInt(fontMetrics.getHeight()); float baseLine = data.ascent; // if bitmapped if (bitmapped && (data.lineHeight == 0)) { for (int c = 32; c < (32 + face.getNumGlyphs()); c++) { if (loadChar(c, flags)) { int lh = FreeType.toInt(face.getGlyph().getMetrics().getHeight()); data.lineHeight = (lh > data.lineHeight) ? lh : data.lineHeight; } } } data.lineHeight += parameter.spaceY; // determine space width if (loadChar(' ', flags) || loadChar('l', flags)) { data.spaceXadvance = FreeType.toInt(face.getGlyph().getMetrics().getHoriAdvance()); } else { data.spaceXadvance = face.getMaxAdvanceWidth(); // Possibly very wrong. } // determine x-height for (char xChar : data.xChars) { if (!loadChar(xChar, flags)) continue; data.xHeight = FreeType.toInt(face.getGlyph().getMetrics().getHeight()); break; } if (data.xHeight == 0) throw new GdxRuntimeException("No x-height character found in font"); // determine cap height for (char capChar : data.capChars) { if (!loadChar(capChar, flags)) continue; data.capHeight = FreeType.toInt(face.getGlyph().getMetrics().getHeight()) + Math.abs(parameter.shadowOffsetY); break; } if (!bitmapped && data.capHeight == 1) throw new GdxRuntimeException("No cap character found in font"); data.ascent -= data.capHeight; data.down = -data.lineHeight; if (parameter.flip) { data.ascent = -data.ascent; data.down = -data.down; } boolean ownsAtlas = false; PixmapPacker packer = parameter.packer; if (packer == null) { // Create a packer. int size; PackStrategy packStrategy; if (incremental) { size = maxTextureSize; packStrategy = new GuillotineStrategy(); } else { int maxGlyphHeight = (int)Math.ceil(data.lineHeight); size = MathUtils.nextPowerOfTwo((int)Math.sqrt(maxGlyphHeight * maxGlyphHeight * charactersLength)); if (maxTextureSize > 0) size = Math.min(size, maxTextureSize); packStrategy = new SkylineStrategy(); } ownsAtlas = true; packer = new PixmapPacker(size, size, Format.RGBA8888, 1, false, packStrategy); packer.setTransparentColor(parameter.color); packer.getTransparentColor().a = 0; if (parameter.borderWidth > 0) { packer.setTransparentColor(parameter.borderColor); packer.getTransparentColor().a = 0; } } if (incremental) data.glyphs = new Array(charactersLength + 32); Stroker stroker = null; if (parameter.borderWidth > 0) { stroker = library.createStroker(); stroker.set((int)(parameter.borderWidth * 64f), parameter.borderStraight ? FreeType.FT_STROKER_LINECAP_BUTT : FreeType.FT_STROKER_LINECAP_ROUND, parameter.borderStraight ? FreeType.FT_STROKER_LINEJOIN_MITER_FIXED : FreeType.FT_STROKER_LINEJOIN_ROUND, 0); } // Create glyphs largest height first for best packing. int[] heights = new int[charactersLength]; for (int i = 0; i < charactersLength; i++) { char c = characters[i]; int height = loadChar(c, flags) ? FreeType.toInt(face.getGlyph().getMetrics().getHeight()) : 0; heights[i] = height; if (c == '\0') { Glyph missingGlyph = createGlyph('\0', data, parameter, stroker, baseLine, packer); if (missingGlyph != null && missingGlyph.width != 0 && missingGlyph.height != 0) { data.setGlyph('\0', missingGlyph); data.missingGlyph = missingGlyph; if (incremental) data.glyphs.add(missingGlyph); } } } int heightsCount = heights.length; while (heightsCount > 0) { int best = 0, maxHeight = heights[0]; for (int i = 1; i < heightsCount; i++) { int height = heights[i]; if (height > maxHeight) { maxHeight = height; best = i; } } char c = characters[best]; if (data.getGlyph(c) == null) { Glyph glyph = createGlyph(c, data, parameter, stroker, baseLine, packer); if (glyph != null) { data.setGlyph(c, glyph); if (incremental) data.glyphs.add(glyph); } } heightsCount--; heights[best] = heights[heightsCount]; char tmpChar = characters[best]; characters[best] = characters[heightsCount]; characters[heightsCount] = tmpChar; } if (stroker != null && !incremental) stroker.dispose(); if (incremental) { data.generator = this; data.parameter = parameter; data.stroker = stroker; data.packer = packer; } // Generate kerning. parameter.kerning &= face.hasKerning(); if (parameter.kerning) { for (int i = 0; i < charactersLength; i++) { char firstChar = characters[i]; Glyph first = data.getGlyph(firstChar); if (first == null) continue; int firstIndex = face.getCharIndex(firstChar); for (int ii = i; ii < charactersLength; ii++) { char secondChar = characters[ii]; Glyph second = data.getGlyph(secondChar); if (second == null) continue; int secondIndex = face.getCharIndex(secondChar); int kerning = face.getKerning(firstIndex, secondIndex, 0); // FT_KERNING_DEFAULT (scaled then rounded). if (kerning != 0) first.setKerning(secondChar, FreeType.toInt(kerning)); kerning = face.getKerning(secondIndex, firstIndex, 0); // FT_KERNING_DEFAULT (scaled then rounded). if (kerning != 0) second.setKerning(firstChar, FreeType.toInt(kerning)); } } } // Generate texture regions. if (ownsAtlas) { data.regions = new Array(); packer.updateTextureRegions(data.regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); } // Set space glyph. Glyph spaceGlyph = data.getGlyph(' '); if (spaceGlyph == null) { spaceGlyph = new Glyph(); spaceGlyph.xadvance = (int)data.spaceXadvance + parameter.spaceX; spaceGlyph.id = (int)' '; data.setGlyph(' ', spaceGlyph); } if (spaceGlyph.width == 0) spaceGlyph.width = (int)(spaceGlyph.xadvance + data.padRight); return data; } /** @return null if glyph was not found. */ protected @Null Glyph createGlyph (char c, FreeTypeBitmapFontData data, FreeTypeFontParameter parameter, Stroker stroker, float baseLine, PixmapPacker packer) { boolean missing = face.getCharIndex(c) == 0 && c != 0; if (missing) return null; if (!loadChar(c, getLoadingFlags(parameter))) return null; GlyphSlot slot = face.getGlyph(); FreeType.Glyph mainGlyph = slot.getGlyph(); try { mainGlyph.toBitmap(parameter.mono ? FreeType.FT_RENDER_MODE_MONO : FreeType.FT_RENDER_MODE_NORMAL); } catch (GdxRuntimeException e) { mainGlyph.dispose(); Gdx.app.log("FreeTypeFontGenerator", "Couldn't render char: " + c); return null; } Bitmap mainBitmap = mainGlyph.getBitmap(); Pixmap mainPixmap = mainBitmap.getPixmap(Format.RGBA8888, parameter.color, parameter.gamma); if (mainBitmap.getWidth() != 0 && mainBitmap.getRows() != 0) { int offsetX = 0, offsetY = 0; if (parameter.borderWidth > 0) { // execute stroker; this generates a glyph "extended" along the outline int top = mainGlyph.getTop(), left = mainGlyph.getLeft(); FreeType.Glyph borderGlyph = slot.getGlyph(); borderGlyph.strokeBorder(stroker, false); borderGlyph.toBitmap(parameter.mono ? FreeType.FT_RENDER_MODE_MONO : FreeType.FT_RENDER_MODE_NORMAL); offsetX = left - borderGlyph.getLeft(); offsetY = -(top - borderGlyph.getTop()); // Render border (pixmap is bigger than main). Bitmap borderBitmap = borderGlyph.getBitmap(); Pixmap borderPixmap = borderBitmap.getPixmap(Format.RGBA8888, parameter.borderColor, parameter.borderGamma); // Draw main glyph on top of border. for (int i = 0, n = parameter.renderCount; i < n; i++) borderPixmap.drawPixmap(mainPixmap, offsetX, offsetY); mainPixmap.dispose(); mainGlyph.dispose(); mainPixmap = borderPixmap; mainGlyph = borderGlyph; } if (parameter.shadowOffsetX != 0 || parameter.shadowOffsetY != 0) { int mainW = mainPixmap.getWidth(), mainH = mainPixmap.getHeight(); int shadowOffsetX = Math.max(parameter.shadowOffsetX, 0), shadowOffsetY = Math.max(parameter.shadowOffsetY, 0); int shadowW = mainW + Math.abs(parameter.shadowOffsetX), shadowH = mainH + Math.abs(parameter.shadowOffsetY); Pixmap shadowPixmap = new Pixmap(shadowW, shadowH, mainPixmap.getFormat()); Color shadowColor = parameter.shadowColor; float a = shadowColor.a; if (a != 0) { byte r = (byte)(shadowColor.r * 255), g = (byte)(shadowColor.g * 255), b = (byte)(shadowColor.b * 255); ByteBuffer mainPixels = mainPixmap.getPixels(); ByteBuffer shadowPixels = shadowPixmap.getPixels(); for (int y = 0; y < mainH; y++) { int shadowRow = shadowW * (y + shadowOffsetY) + shadowOffsetX; for (int x = 0; x < mainW; x++) { int mainPixel = (mainW * y + x) * 4; byte mainA = mainPixels.get(mainPixel + 3); if (mainA == 0) continue; int shadowPixel = (shadowRow + x) * 4; shadowPixels.put(shadowPixel, r); shadowPixels.put(shadowPixel + 1, g); shadowPixels.put(shadowPixel + 2, b); shadowPixels.put(shadowPixel + 3, (byte)((mainA & 0xff) * a)); } } } // Draw main glyph (with any border) on top of shadow. for (int i = 0, n = parameter.renderCount; i < n; i++) shadowPixmap.drawPixmap(mainPixmap, Math.max(-parameter.shadowOffsetX, 0), Math.max(-parameter.shadowOffsetY, 0)); mainPixmap.dispose(); mainPixmap = shadowPixmap; } else if (parameter.borderWidth == 0) { // No shadow and no border, draw glyph additional times. for (int i = 0, n = parameter.renderCount - 1; i < n; i++) mainPixmap.drawPixmap(mainPixmap, 0, 0); } if (parameter.padTop > 0 || parameter.padLeft > 0 || parameter.padBottom > 0 || parameter.padRight > 0) { Pixmap padPixmap = new Pixmap(mainPixmap.getWidth() + parameter.padLeft + parameter.padRight, mainPixmap.getHeight() + parameter.padTop + parameter.padBottom, mainPixmap.getFormat()); padPixmap.setBlending(Blending.None); padPixmap.drawPixmap(mainPixmap, parameter.padLeft, parameter.padTop); mainPixmap.dispose(); mainPixmap = padPixmap; } } GlyphMetrics metrics = slot.getMetrics(); Glyph glyph = new Glyph(); glyph.id = c; glyph.width = mainPixmap.getWidth(); glyph.height = mainPixmap.getHeight(); glyph.xoffset = mainGlyph.getLeft(); if (parameter.flip) glyph.yoffset = -mainGlyph.getTop() + (int)baseLine; else glyph.yoffset = -(glyph.height - mainGlyph.getTop()) - (int)baseLine; glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance()) + (int)parameter.borderWidth + parameter.spaceX; if (bitmapped) { mainPixmap.setColor(Color.CLEAR); mainPixmap.fill(); ByteBuffer buf = mainBitmap.getBuffer(); int whiteIntBits = Color.WHITE.toIntBits(); int clearIntBits = Color.CLEAR.toIntBits(); for (int h = 0; h < glyph.height; h++) { int idx = h * mainBitmap.getPitch(); for (int w = 0; w < (glyph.width + glyph.xoffset); w++) { int bit = (buf.get(idx + (w / 8)) >>> (7 - (w % 8))) & 1; mainPixmap.drawPixel(w, h, ((bit == 1) ? whiteIntBits : clearIntBits)); } } } Rectangle rect = packer.pack(mainPixmap); glyph.page = packer.getPages().size - 1; // Glyph is always packed into the last page for now. glyph.srcX = (int)rect.x; glyph.srcY = (int)rect.y; // If a page was added, create a new texture region for the incrementally added glyph. if (parameter.incremental && data.regions != null && data.regions.size <= glyph.page) packer.updateTextureRegions(data.regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); mainPixmap.dispose(); mainGlyph.dispose(); return glyph; } /** check the font glyph exists for single UTF-32 code point */ public boolean hasGlyph (int charCode) { // 0 stand for undefined character code return face.getCharIndex(charCode) != 0; } public String toString () { return name; } /** Cleans up all resources of the generator. Call this if you no longer use the generator. */ @Override public void dispose () { face.dispose(); library.dispose(); } /** Sets the maximum size that will be used when generating texture atlases for glyphs with <tt>generateData()</tt>. The * default is 1024. By specifying {@link #NO_MAXIMUM}, the texture atlas will scale as needed. * * The power-of-two square texture size will be capped to the given <tt>texSize</tt>. It's recommended that a power-of-two * value be used here. * * Multiple pages may be used to fit all the generated glyphs. You can query the resulting number of pages by calling * <tt>bitmapFont.getRegions().length</tt> or <tt>freeTypeBitmapFontData.getTextureRegions().length</tt>. * * If PixmapPacker is specified when calling generateData, this parameter is ignored. * * @param texSize the maximum texture size for one page of glyphs */ public static void setMaxTextureSize (int texSize) { maxTextureSize = texSize; } /** Returns the maximum texture size that will be used by generateData() when creating a texture atlas for the glyphs. * @return the power-of-two max texture size */ public static int getMaxTextureSize () { return maxTextureSize; } /** {@link BitmapFontData} used for fonts generated via the {@link FreeTypeFontGenerator}. The texture storing the glyphs is * held in memory, thus the {@link #getImagePaths()} and {@link #getFontFile()} methods will return null. * @author mzechner * @author Nathan Sweet */ static public class FreeTypeBitmapFontData extends BitmapFontData implements Disposable { public Array<TextureRegion> regions; // Fields for incremental glyph generation. FreeTypeFontGenerator generator; FreeTypeFontParameter parameter; Stroker stroker; PixmapPacker packer; Array<Glyph> glyphs; private boolean dirty; @Override public Glyph getGlyph (char ch) { Glyph glyph = super.getGlyph(ch); if (glyph == null && generator != null) { generator.setPixelSizes(0, parameter.size); float baseline = ((flipped ? -ascent : ascent) + capHeight) / scaleY; glyph = generator.createGlyph(ch, this, parameter, stroker, baseline, packer); if (glyph == null) return missingGlyph; setGlyphRegion(glyph, regions.get(glyph.page)); setGlyph(ch, glyph); glyphs.add(glyph); dirty = true; Face face = generator.face; if (parameter.kerning) { int glyphIndex = face.getCharIndex(ch); for (int i = 0, n = glyphs.size; i < n; i++) { Glyph other = glyphs.get(i); int otherIndex = face.getCharIndex(other.id); int kerning = face.getKerning(glyphIndex, otherIndex, 0); if (kerning != 0) glyph.setKerning(other.id, FreeType.toInt(kerning)); kerning = face.getKerning(otherIndex, glyphIndex, 0); if (kerning != 0) other.setKerning(ch, FreeType.toInt(kerning)); } } } return glyph; } public void getGlyphs (GlyphRun run, CharSequence str, int start, int end, Glyph lastGlyph) { if (packer != null) packer.setPackToTexture(true); // All glyphs added after this are packed directly to the texture. super.getGlyphs(run, str, start, end, lastGlyph); if (dirty) { dirty = false; packer.updateTextureRegions(regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); } } @Override public void dispose () { if (stroker != null) stroker.dispose(); if (packer != null) packer.dispose(); } } /** Font smoothing algorithm. */ public static enum Hinting { /** Disable hinting. Generated glyphs will look blurry. */ None, /** Light hinting with fuzzy edges, but close to the original shape */ Slight, /** Average hinting */ Medium, /** Strong hinting with crisp edges at the expense of shape fidelity */ Full, /** Light hinting with fuzzy edges, but close to the original shape. Uses the FreeType auto-hinter. */ AutoSlight, /** Average hinting. Uses the FreeType auto-hinter. */ AutoMedium, /** Strong hinting with crisp edges at the expense of shape fidelity. Uses the FreeType auto-hinter. */ AutoFull, } /** Parameter container class that helps configure how {@link FreeTypeBitmapFontData} and {@link BitmapFont} instances are * generated. * * The packer field is for advanced usage, where it is necessary to pack multiple BitmapFonts (i.e. styles, sizes, families) * into a single Texture atlas. If no packer is specified, the generator will use its own PixmapPacker to pack the glyphs into * a power-of-two sized texture, and the resulting {@link FreeTypeBitmapFontData} will have a valid {@link TextureRegion} which * can be used to construct a new {@link BitmapFont}. * * @author siondream * @author Nathan Sweet */ public static class FreeTypeFontParameter { /** The size in pixels */ public int size = 16; /** If true, font smoothing is disabled. */ public boolean mono; /** Strength of hinting */ public Hinting hinting = Hinting.AutoMedium; /** Foreground color (required for non-black borders) */ public Color color = Color.WHITE; /** Glyph gamma. Values > 1 reduce antialiasing. */ public float gamma = 1.8f; /** Number of times to render the glyph. Useful with a shadow or border, so it doesn't show through the glyph. */ public int renderCount = 2; /** Border width in pixels, 0 to disable */ public float borderWidth = 0; /** Border color; only used if borderWidth > 0 */ public Color borderColor = Color.BLACK; /** true for straight (mitered), false for rounded borders */ public boolean borderStraight = false; /** Values < 1 increase the border size. */ public float borderGamma = 1.8f; /** Offset of text shadow on X axis in pixels, 0 to disable */ public int shadowOffsetX = 0; /** Offset of text shadow on Y axis in pixels, 0 to disable */ public int shadowOffsetY = 0; /** Shadow color; only used if shadowOffset > 0. If alpha component is 0, no shadow is drawn but characters are still offset * by shadowOffset. */ public Color shadowColor = new Color(0, 0, 0, 0.75f); /** Pixels to add to glyph spacing when text is rendered. Can be negative. */ public int spaceX, spaceY; /** Pixels to add to the glyph in the texture. Cannot be negative. */ public int padTop, padLeft, padBottom, padRight; /** The characters the font should contain. If '\0' is not included then {@link BitmapFontData#missingGlyph} is not set. */ public String characters = DEFAULT_CHARS; /** Whether the font should include kerning */ public boolean kerning = true; /** The optional PixmapPacker to use for packing multiple fonts into a single texture. * @see FreeTypeFontParameter */ public PixmapPacker packer = null; /** Whether to flip the font vertically */ public boolean flip = false; /** Whether to generate mip maps for the resulting texture */ public boolean genMipMaps = false; /** Minification filter */ public TextureFilter minFilter = TextureFilter.Nearest; /** Magnification filter */ public TextureFilter magFilter = TextureFilter.Nearest; /** When true, glyphs are rendered on the fly to the font's glyph page textures as they are needed. The * FreeTypeFontGenerator must not be disposed until the font is no longer needed. The FreeTypeBitmapFontData must be * disposed (separately from the generator) when the font is no longer needed. The FreeTypeFontParameter should not be * modified after creating a font. If a PixmapPacker is not specified, the font glyph page textures will use * {@link FreeTypeFontGenerator#getMaxTextureSize()}. */ public boolean incremental; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g2d.freetype; import java.nio.ByteBuffer; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Pixmap.Blending; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData; import com.badlogic.gdx.graphics.g2d.BitmapFont.Glyph; import com.badlogic.gdx.graphics.g2d.GlyphLayout.GlyphRun; import com.badlogic.gdx.graphics.g2d.PixmapPacker; import com.badlogic.gdx.graphics.g2d.PixmapPacker.GuillotineStrategy; import com.badlogic.gdx.graphics.g2d.PixmapPacker.PackStrategy; import com.badlogic.gdx.graphics.g2d.PixmapPacker.SkylineStrategy; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Bitmap; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Face; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphMetrics; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Library; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.SizeMetrics; import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Stroker; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.Null; /** Generates {@link BitmapFont} and {@link BitmapFontData} instances from TrueType, OTF, and other FreeType supported fonts. * </p> * * Usage example: * * <pre> * FreeTypeFontGenerator gen = new FreeTypeFontGenerator(Gdx.files.internal(&quot;myfont.ttf&quot;)); * BitmapFont font = gen.generateFont(16); * gen.dispose(); // Don't dispose if doing incremental glyph generation. * </pre> * * The generator has to be disposed once it is no longer used. The returned {@link BitmapFont} instances are managed by the user * and have to be disposed as usual. * * @author mzechner * @author Nathan Sweet * @author Rob Rendell */ public class FreeTypeFontGenerator implements Disposable { static public final String DEFAULT_CHARS = "\u0000ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!`?'.,;:()[]{}<>|/@\\^$€-%+=#_&~*\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F\u00A0\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A8\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF"; /** A hint to scale the texture as needed, without capping it at any maximum size */ static public final int NO_MAXIMUM = -1; /** The maximum texture size allowed by generateData, when storing in a texture atlas. Multiple texture pages will be created * if necessary. Default is 1024. * @see #setMaxTextureSize(int) */ static private int maxTextureSize = 1024; final Library library; final Face face; final String name; boolean bitmapped = false; private int pixelWidth, pixelHeight; /** {@link #FreeTypeFontGenerator(FileHandle, int)} */ public FreeTypeFontGenerator (FileHandle fontFile) { this(fontFile, 0); } /** Creates a new generator from the given font file. Uses {@link FileHandle#length()} to determine the file size. If the file * length could not be determined (it was 0), an extra copy of the font bytes is performed. Throws a * {@link GdxRuntimeException} if loading did not succeed. */ public FreeTypeFontGenerator (FileHandle fontFile, int faceIndex) { name = fontFile.nameWithoutExtension(); library = FreeType.initFreeType(); face = library.newFace(fontFile, faceIndex); if (checkForBitmapFont()) return; setPixelSizes(0, 15); } private int getLoadingFlags (FreeTypeFontParameter parameter) { int loadingFlags = FreeType.FT_LOAD_DEFAULT; switch (parameter.hinting) { case None: loadingFlags |= FreeType.FT_LOAD_NO_HINTING; break; case Slight: loadingFlags |= FreeType.FT_LOAD_TARGET_LIGHT; break; case Medium: loadingFlags |= FreeType.FT_LOAD_TARGET_NORMAL; break; case Full: loadingFlags |= FreeType.FT_LOAD_TARGET_MONO; break; case AutoSlight: loadingFlags |= FreeType.FT_LOAD_FORCE_AUTOHINT | FreeType.FT_LOAD_TARGET_LIGHT; break; case AutoMedium: loadingFlags |= FreeType.FT_LOAD_FORCE_AUTOHINT | FreeType.FT_LOAD_TARGET_NORMAL; break; case AutoFull: loadingFlags |= FreeType.FT_LOAD_FORCE_AUTOHINT | FreeType.FT_LOAD_TARGET_MONO; break; } return loadingFlags; } private boolean loadChar (int c) { return loadChar(c, FreeType.FT_LOAD_DEFAULT | FreeType.FT_LOAD_FORCE_AUTOHINT); } private boolean loadChar (int c, int flags) { return face.loadChar(c, flags); } private boolean checkForBitmapFont () { int faceFlags = face.getFaceFlags(); if (((faceFlags & FreeType.FT_FACE_FLAG_FIXED_SIZES) == FreeType.FT_FACE_FLAG_FIXED_SIZES) && ((faceFlags & FreeType.FT_FACE_FLAG_HORIZONTAL) == FreeType.FT_FACE_FLAG_HORIZONTAL)) { if (loadChar(32)) { GlyphSlot slot = face.getGlyph(); if (slot.getFormat() == 1651078259) { bitmapped = true; } } } return bitmapped; } public BitmapFont generateFont (FreeTypeFontParameter parameter) { return generateFont(parameter, new FreeTypeBitmapFontData()); } /** Generates a new {@link BitmapFont}. The size is expressed in pixels. Throws a GdxRuntimeException if the font could not be * generated. Using big sizes might cause such an exception. * @param parameter configures how the font is generated */ public BitmapFont generateFont (FreeTypeFontParameter parameter, FreeTypeBitmapFontData data) { boolean updateTextureRegions = data.regions == null && parameter.packer != null; if (updateTextureRegions) data.regions = new Array(); generateData(parameter, data); if (updateTextureRegions) parameter.packer.updateTextureRegions(data.regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); if (data.regions.isEmpty()) throw new GdxRuntimeException("Unable to create a font with no texture regions."); BitmapFont font = newBitmapFont(data, data.regions, true); font.setOwnsTexture(parameter.packer == null); return font; } /** Called by generateFont to create a new {@link BitmapFont} instance. This allows injecting a customized {@link BitmapFont}, * eg for a RTL font. * @see BitmapFont#BitmapFont(BitmapFontData, Array, boolean) */ protected BitmapFont newBitmapFont (BitmapFontData data, Array<TextureRegion> pageRegions, boolean integer) { return new BitmapFont(data, pageRegions, integer); } /** Uses ascender and descender of font to calculate real height that makes all glyphs to fit in given pixel size. Source: * http://nothings.org/stb/stb_truetype.h / stbtt_ScaleForPixelHeight */ public int scaleForPixelHeight (int height) { setPixelSizes(0, height); SizeMetrics fontMetrics = face.getSize().getMetrics(); int ascent = FreeType.toInt(fontMetrics.getAscender()); int descent = FreeType.toInt(fontMetrics.getDescender()); return height * height / (ascent - descent); } /** Uses max advance, ascender and descender of font to calculate real height that makes any n glyphs to fit in given pixel * width. * @param width the max width to fit (in pixels) * @param numChars max number of characters that to fill width */ public int scaleForPixelWidth (int width, int numChars) { SizeMetrics fontMetrics = face.getSize().getMetrics(); int advance = FreeType.toInt(fontMetrics.getMaxAdvance()); int ascent = FreeType.toInt(fontMetrics.getAscender()); int descent = FreeType.toInt(fontMetrics.getDescender()); int unscaledHeight = ascent - descent; int height = unscaledHeight * width / (advance * numChars); setPixelSizes(0, height); return height; } /** Uses max advance, ascender and descender of font to calculate real height that makes any n glyphs to fit in given pixel * width and height. * @param width the max width to fit (in pixels) * @param height the max height to fit (in pixels) * @param numChars max number of characters that to fill width */ public int scaleToFitSquare (int width, int height, int numChars) { return Math.min(scaleForPixelHeight(height), scaleForPixelWidth(width, numChars)); } public class GlyphAndBitmap { public Glyph glyph; public @Null Bitmap bitmap; } /** Returns null if glyph was not found in the font. If there is nothing to render, for example with various space characters, * then {@link GlyphAndBitmap#bitmap} will be null. */ public @Null GlyphAndBitmap generateGlyphAndBitmap (int c, int size, boolean flip) { setPixelSizes(0, size); SizeMetrics fontMetrics = face.getSize().getMetrics(); int baseline = FreeType.toInt(fontMetrics.getAscender()); // Check if character exists in this font. // 0 means 'undefined character code' if (face.getCharIndex(c) == 0) { return null; } // Try to load character if (!loadChar(c)) { throw new GdxRuntimeException("Unable to load character!"); } GlyphSlot slot = face.getGlyph(); // Try to render to bitmap Bitmap bitmap; if (bitmapped) { bitmap = slot.getBitmap(); } else if (!slot.renderGlyph(FreeType.FT_RENDER_MODE_NORMAL)) { bitmap = null; } else { bitmap = slot.getBitmap(); } GlyphMetrics metrics = slot.getMetrics(); Glyph glyph = new Glyph(); if (bitmap != null) { glyph.width = bitmap.getWidth(); glyph.height = bitmap.getRows(); } else { glyph.width = 0; glyph.height = 0; } glyph.xoffset = slot.getBitmapLeft(); glyph.yoffset = flip ? -slot.getBitmapTop() + baseline : -(glyph.height - slot.getBitmapTop()) - baseline; glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance()); glyph.srcX = 0; glyph.srcY = 0; glyph.id = c; GlyphAndBitmap result = new GlyphAndBitmap(); result.glyph = glyph; result.bitmap = bitmap; return result; } /** Generates a new {@link BitmapFontData} instance, expert usage only. Throws a GdxRuntimeException if something went wrong. * @param size the size in pixels */ public FreeTypeBitmapFontData generateData (int size) { FreeTypeFontParameter parameter = new FreeTypeFontParameter(); parameter.size = size; return generateData(parameter); } public FreeTypeBitmapFontData generateData (FreeTypeFontParameter parameter) { return generateData(parameter, new FreeTypeBitmapFontData()); } void setPixelSizes (int pixelWidth, int pixelHeight) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; if (!bitmapped && !face.setPixelSizes(pixelWidth, pixelHeight)) throw new GdxRuntimeException("Couldn't set size for font"); } /** Generates a new {@link BitmapFontData} instance, expert usage only. Throws a GdxRuntimeException if something went wrong. * @param parameter configures how the font is generated */ public FreeTypeBitmapFontData generateData (FreeTypeFontParameter parameter, FreeTypeBitmapFontData data) { data.name = name + "-" + parameter.size; char[] characters = parameter.characters.toCharArray(); int charactersLength = characters.length; boolean incremental = parameter.incremental; int flags = getLoadingFlags(parameter); setPixelSizes(0, parameter.size); // set general font data SizeMetrics fontMetrics = face.getSize().getMetrics(); data.flipped = parameter.flip; data.ascent = FreeType.toInt(fontMetrics.getAscender()); data.descent = FreeType.toInt(fontMetrics.getDescender()); data.lineHeight = FreeType.toInt(fontMetrics.getHeight()); float baseLine = data.ascent; // if bitmapped if (bitmapped && (data.lineHeight == 0)) { for (int c = 32; c < (32 + face.getNumGlyphs()); c++) { if (loadChar(c, flags)) { int lh = FreeType.toInt(face.getGlyph().getMetrics().getHeight()); data.lineHeight = (lh > data.lineHeight) ? lh : data.lineHeight; } } } data.lineHeight += parameter.spaceY; // determine space width if (loadChar(' ', flags) || loadChar('l', flags)) { data.spaceXadvance = FreeType.toInt(face.getGlyph().getMetrics().getHoriAdvance()); } else { data.spaceXadvance = face.getMaxAdvanceWidth(); // Possibly very wrong. } // determine x-height for (char xChar : data.xChars) { if (!loadChar(xChar, flags)) continue; data.xHeight = FreeType.toInt(face.getGlyph().getMetrics().getHeight()); break; } if (data.xHeight == 0) throw new GdxRuntimeException("No x-height character found in font"); // determine cap height for (char capChar : data.capChars) { if (!loadChar(capChar, flags)) continue; data.capHeight = FreeType.toInt(face.getGlyph().getMetrics().getHeight()) + Math.abs(parameter.shadowOffsetY); break; } if (!bitmapped && data.capHeight == 1) throw new GdxRuntimeException("No cap character found in font"); data.ascent -= data.capHeight; data.down = -data.lineHeight; if (parameter.flip) { data.ascent = -data.ascent; data.down = -data.down; } boolean ownsAtlas = false; PixmapPacker packer = parameter.packer; if (packer == null) { // Create a packer. int size; PackStrategy packStrategy; if (incremental) { size = maxTextureSize; packStrategy = new GuillotineStrategy(); } else { int maxGlyphHeight = (int)Math.ceil(data.lineHeight); size = MathUtils.nextPowerOfTwo((int)Math.sqrt(maxGlyphHeight * maxGlyphHeight * charactersLength)); if (maxTextureSize > 0) size = Math.min(size, maxTextureSize); packStrategy = new SkylineStrategy(); } ownsAtlas = true; packer = new PixmapPacker(size, size, Format.RGBA8888, 1, false, packStrategy); packer.setTransparentColor(parameter.color); packer.getTransparentColor().a = 0; if (parameter.borderWidth > 0) { packer.setTransparentColor(parameter.borderColor); packer.getTransparentColor().a = 0; } } if (incremental) data.glyphs = new Array(charactersLength + 32); Stroker stroker = null; if (parameter.borderWidth > 0) { stroker = library.createStroker(); stroker.set((int)(parameter.borderWidth * 64f), parameter.borderStraight ? FreeType.FT_STROKER_LINECAP_BUTT : FreeType.FT_STROKER_LINECAP_ROUND, parameter.borderStraight ? FreeType.FT_STROKER_LINEJOIN_MITER_FIXED : FreeType.FT_STROKER_LINEJOIN_ROUND, 0); } // Create glyphs largest height first for best packing. int[] heights = new int[charactersLength]; for (int i = 0; i < charactersLength; i++) { char c = characters[i]; int height = loadChar(c, flags) ? FreeType.toInt(face.getGlyph().getMetrics().getHeight()) : 0; heights[i] = height; if (c == '\0') { Glyph missingGlyph = createGlyph('\0', data, parameter, stroker, baseLine, packer); if (missingGlyph != null && missingGlyph.width != 0 && missingGlyph.height != 0) { data.setGlyph('\0', missingGlyph); data.missingGlyph = missingGlyph; if (incremental) data.glyphs.add(missingGlyph); } } } int heightsCount = heights.length; while (heightsCount > 0) { int best = 0, maxHeight = heights[0]; for (int i = 1; i < heightsCount; i++) { int height = heights[i]; if (height > maxHeight) { maxHeight = height; best = i; } } char c = characters[best]; if (data.getGlyph(c) == null) { Glyph glyph = createGlyph(c, data, parameter, stroker, baseLine, packer); if (glyph != null) { data.setGlyph(c, glyph); if (incremental) data.glyphs.add(glyph); } } heightsCount--; heights[best] = heights[heightsCount]; char tmpChar = characters[best]; characters[best] = characters[heightsCount]; characters[heightsCount] = tmpChar; } if (stroker != null && !incremental) stroker.dispose(); if (incremental) { data.generator = this; data.parameter = parameter; data.stroker = stroker; data.packer = packer; } // Generate kerning. parameter.kerning &= face.hasKerning(); if (parameter.kerning) { for (int i = 0; i < charactersLength; i++) { char firstChar = characters[i]; Glyph first = data.getGlyph(firstChar); if (first == null) continue; int firstIndex = face.getCharIndex(firstChar); for (int ii = i; ii < charactersLength; ii++) { char secondChar = characters[ii]; Glyph second = data.getGlyph(secondChar); if (second == null) continue; int secondIndex = face.getCharIndex(secondChar); int kerning = face.getKerning(firstIndex, secondIndex, 0); // FT_KERNING_DEFAULT (scaled then rounded). if (kerning != 0) first.setKerning(secondChar, FreeType.toInt(kerning)); kerning = face.getKerning(secondIndex, firstIndex, 0); // FT_KERNING_DEFAULT (scaled then rounded). if (kerning != 0) second.setKerning(firstChar, FreeType.toInt(kerning)); } } } // Generate texture regions. if (ownsAtlas) { data.regions = new Array(); packer.updateTextureRegions(data.regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); } // Set space glyph. Glyph spaceGlyph = data.getGlyph(' '); if (spaceGlyph == null) { spaceGlyph = new Glyph(); spaceGlyph.xadvance = (int)data.spaceXadvance + parameter.spaceX; spaceGlyph.id = (int)' '; data.setGlyph(' ', spaceGlyph); } if (spaceGlyph.width == 0) spaceGlyph.width = (int)(spaceGlyph.xadvance + data.padRight); return data; } /** @return null if glyph was not found. */ protected @Null Glyph createGlyph (char c, FreeTypeBitmapFontData data, FreeTypeFontParameter parameter, Stroker stroker, float baseLine, PixmapPacker packer) { boolean missing = face.getCharIndex(c) == 0 && c != 0; if (missing) return null; if (!loadChar(c, getLoadingFlags(parameter))) return null; GlyphSlot slot = face.getGlyph(); FreeType.Glyph mainGlyph = slot.getGlyph(); try { mainGlyph.toBitmap(parameter.mono ? FreeType.FT_RENDER_MODE_MONO : FreeType.FT_RENDER_MODE_NORMAL); } catch (GdxRuntimeException e) { mainGlyph.dispose(); Gdx.app.log("FreeTypeFontGenerator", "Couldn't render char: " + c); return null; } Bitmap mainBitmap = mainGlyph.getBitmap(); Pixmap mainPixmap = mainBitmap.getPixmap(Format.RGBA8888, parameter.color, parameter.gamma); if (mainBitmap.getWidth() != 0 && mainBitmap.getRows() != 0) { int offsetX = 0, offsetY = 0; if (parameter.borderWidth > 0) { // execute stroker; this generates a glyph "extended" along the outline int top = mainGlyph.getTop(), left = mainGlyph.getLeft(); FreeType.Glyph borderGlyph = slot.getGlyph(); borderGlyph.strokeBorder(stroker, false); borderGlyph.toBitmap(parameter.mono ? FreeType.FT_RENDER_MODE_MONO : FreeType.FT_RENDER_MODE_NORMAL); offsetX = left - borderGlyph.getLeft(); offsetY = -(top - borderGlyph.getTop()); // Render border (pixmap is bigger than main). Bitmap borderBitmap = borderGlyph.getBitmap(); Pixmap borderPixmap = borderBitmap.getPixmap(Format.RGBA8888, parameter.borderColor, parameter.borderGamma); // Draw main glyph on top of border. for (int i = 0, n = parameter.renderCount; i < n; i++) borderPixmap.drawPixmap(mainPixmap, offsetX, offsetY); mainPixmap.dispose(); mainGlyph.dispose(); mainPixmap = borderPixmap; mainGlyph = borderGlyph; } if (parameter.shadowOffsetX != 0 || parameter.shadowOffsetY != 0) { int mainW = mainPixmap.getWidth(), mainH = mainPixmap.getHeight(); int shadowOffsetX = Math.max(parameter.shadowOffsetX, 0), shadowOffsetY = Math.max(parameter.shadowOffsetY, 0); int shadowW = mainW + Math.abs(parameter.shadowOffsetX), shadowH = mainH + Math.abs(parameter.shadowOffsetY); Pixmap shadowPixmap = new Pixmap(shadowW, shadowH, mainPixmap.getFormat()); Color shadowColor = parameter.shadowColor; float a = shadowColor.a; if (a != 0) { byte r = (byte)(shadowColor.r * 255), g = (byte)(shadowColor.g * 255), b = (byte)(shadowColor.b * 255); ByteBuffer mainPixels = mainPixmap.getPixels(); ByteBuffer shadowPixels = shadowPixmap.getPixels(); for (int y = 0; y < mainH; y++) { int shadowRow = shadowW * (y + shadowOffsetY) + shadowOffsetX; for (int x = 0; x < mainW; x++) { int mainPixel = (mainW * y + x) * 4; byte mainA = mainPixels.get(mainPixel + 3); if (mainA == 0) continue; int shadowPixel = (shadowRow + x) * 4; shadowPixels.put(shadowPixel, r); shadowPixels.put(shadowPixel + 1, g); shadowPixels.put(shadowPixel + 2, b); shadowPixels.put(shadowPixel + 3, (byte)((mainA & 0xff) * a)); } } } // Draw main glyph (with any border) on top of shadow. for (int i = 0, n = parameter.renderCount; i < n; i++) shadowPixmap.drawPixmap(mainPixmap, Math.max(-parameter.shadowOffsetX, 0), Math.max(-parameter.shadowOffsetY, 0)); mainPixmap.dispose(); mainPixmap = shadowPixmap; } else if (parameter.borderWidth == 0) { // No shadow and no border, draw glyph additional times. for (int i = 0, n = parameter.renderCount - 1; i < n; i++) mainPixmap.drawPixmap(mainPixmap, 0, 0); } if (parameter.padTop > 0 || parameter.padLeft > 0 || parameter.padBottom > 0 || parameter.padRight > 0) { Pixmap padPixmap = new Pixmap(mainPixmap.getWidth() + parameter.padLeft + parameter.padRight, mainPixmap.getHeight() + parameter.padTop + parameter.padBottom, mainPixmap.getFormat()); padPixmap.setBlending(Blending.None); padPixmap.drawPixmap(mainPixmap, parameter.padLeft, parameter.padTop); mainPixmap.dispose(); mainPixmap = padPixmap; } } GlyphMetrics metrics = slot.getMetrics(); Glyph glyph = new Glyph(); glyph.id = c; glyph.width = mainPixmap.getWidth(); glyph.height = mainPixmap.getHeight(); glyph.xoffset = mainGlyph.getLeft(); if (parameter.flip) glyph.yoffset = -mainGlyph.getTop() + (int)baseLine; else glyph.yoffset = -(glyph.height - mainGlyph.getTop()) - (int)baseLine; glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance()) + (int)parameter.borderWidth + parameter.spaceX; if (bitmapped) { mainPixmap.setColor(Color.CLEAR); mainPixmap.fill(); ByteBuffer buf = mainBitmap.getBuffer(); int whiteIntBits = Color.WHITE.toIntBits(); int clearIntBits = Color.CLEAR.toIntBits(); for (int h = 0; h < glyph.height; h++) { int idx = h * mainBitmap.getPitch(); for (int w = 0; w < (glyph.width + glyph.xoffset); w++) { int bit = (buf.get(idx + (w / 8)) >>> (7 - (w % 8))) & 1; mainPixmap.drawPixel(w, h, ((bit == 1) ? whiteIntBits : clearIntBits)); } } } Rectangle rect = packer.pack(mainPixmap); glyph.page = packer.getPages().size - 1; // Glyph is always packed into the last page for now. glyph.srcX = (int)rect.x; glyph.srcY = (int)rect.y; // If a page was added, create a new texture region for the incrementally added glyph. if (parameter.incremental && data.regions != null && data.regions.size <= glyph.page) packer.updateTextureRegions(data.regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); mainPixmap.dispose(); mainGlyph.dispose(); return glyph; } /** check the font glyph exists for single UTF-32 code point */ public boolean hasGlyph (int charCode) { // 0 stand for undefined character code return face.getCharIndex(charCode) != 0; } public String toString () { return name; } /** Cleans up all resources of the generator. Call this if you no longer use the generator. */ @Override public void dispose () { face.dispose(); library.dispose(); } /** Sets the maximum size that will be used when generating texture atlases for glyphs with <tt>generateData()</tt>. The * default is 1024. By specifying {@link #NO_MAXIMUM}, the texture atlas will scale as needed. * * The power-of-two square texture size will be capped to the given <tt>texSize</tt>. It's recommended that a power-of-two * value be used here. * * Multiple pages may be used to fit all the generated glyphs. You can query the resulting number of pages by calling * <tt>bitmapFont.getRegions().length</tt> or <tt>freeTypeBitmapFontData.getTextureRegions().length</tt>. * * If PixmapPacker is specified when calling generateData, this parameter is ignored. * * @param texSize the maximum texture size for one page of glyphs */ public static void setMaxTextureSize (int texSize) { maxTextureSize = texSize; } /** Returns the maximum texture size that will be used by generateData() when creating a texture atlas for the glyphs. * @return the power-of-two max texture size */ public static int getMaxTextureSize () { return maxTextureSize; } /** {@link BitmapFontData} used for fonts generated via the {@link FreeTypeFontGenerator}. The texture storing the glyphs is * held in memory, thus the {@link #getImagePaths()} and {@link #getFontFile()} methods will return null. * @author mzechner * @author Nathan Sweet */ static public class FreeTypeBitmapFontData extends BitmapFontData implements Disposable { public Array<TextureRegion> regions; // Fields for incremental glyph generation. FreeTypeFontGenerator generator; FreeTypeFontParameter parameter; Stroker stroker; PixmapPacker packer; Array<Glyph> glyphs; private boolean dirty; @Override public Glyph getGlyph (char ch) { Glyph glyph = super.getGlyph(ch); if (glyph == null && generator != null) { generator.setPixelSizes(0, parameter.size); float baseline = ((flipped ? -ascent : ascent) + capHeight) / scaleY; glyph = generator.createGlyph(ch, this, parameter, stroker, baseline, packer); if (glyph == null) return missingGlyph; setGlyphRegion(glyph, regions.get(glyph.page)); setGlyph(ch, glyph); glyphs.add(glyph); dirty = true; Face face = generator.face; if (parameter.kerning) { int glyphIndex = face.getCharIndex(ch); for (int i = 0, n = glyphs.size; i < n; i++) { Glyph other = glyphs.get(i); int otherIndex = face.getCharIndex(other.id); int kerning = face.getKerning(glyphIndex, otherIndex, 0); if (kerning != 0) glyph.setKerning(other.id, FreeType.toInt(kerning)); kerning = face.getKerning(otherIndex, glyphIndex, 0); if (kerning != 0) other.setKerning(ch, FreeType.toInt(kerning)); } } } return glyph; } public void getGlyphs (GlyphRun run, CharSequence str, int start, int end, Glyph lastGlyph) { if (packer != null) packer.setPackToTexture(true); // All glyphs added after this are packed directly to the texture. super.getGlyphs(run, str, start, end, lastGlyph); if (dirty) { dirty = false; packer.updateTextureRegions(regions, parameter.minFilter, parameter.magFilter, parameter.genMipMaps); } } @Override public void dispose () { if (stroker != null) stroker.dispose(); if (packer != null) packer.dispose(); } } /** Font smoothing algorithm. */ public static enum Hinting { /** Disable hinting. Generated glyphs will look blurry. */ None, /** Light hinting with fuzzy edges, but close to the original shape */ Slight, /** Average hinting */ Medium, /** Strong hinting with crisp edges at the expense of shape fidelity */ Full, /** Light hinting with fuzzy edges, but close to the original shape. Uses the FreeType auto-hinter. */ AutoSlight, /** Average hinting. Uses the FreeType auto-hinter. */ AutoMedium, /** Strong hinting with crisp edges at the expense of shape fidelity. Uses the FreeType auto-hinter. */ AutoFull, } /** Parameter container class that helps configure how {@link FreeTypeBitmapFontData} and {@link BitmapFont} instances are * generated. * * The packer field is for advanced usage, where it is necessary to pack multiple BitmapFonts (i.e. styles, sizes, families) * into a single Texture atlas. If no packer is specified, the generator will use its own PixmapPacker to pack the glyphs into * a power-of-two sized texture, and the resulting {@link FreeTypeBitmapFontData} will have a valid {@link TextureRegion} which * can be used to construct a new {@link BitmapFont}. * * @author siondream * @author Nathan Sweet */ public static class FreeTypeFontParameter { /** The size in pixels */ public int size = 16; /** If true, font smoothing is disabled. */ public boolean mono; /** Strength of hinting */ public Hinting hinting = Hinting.AutoMedium; /** Foreground color (required for non-black borders) */ public Color color = Color.WHITE; /** Glyph gamma. Values > 1 reduce antialiasing. */ public float gamma = 1.8f; /** Number of times to render the glyph. Useful with a shadow or border, so it doesn't show through the glyph. */ public int renderCount = 2; /** Border width in pixels, 0 to disable */ public float borderWidth = 0; /** Border color; only used if borderWidth > 0 */ public Color borderColor = Color.BLACK; /** true for straight (mitered), false for rounded borders */ public boolean borderStraight = false; /** Values < 1 increase the border size. */ public float borderGamma = 1.8f; /** Offset of text shadow on X axis in pixels, 0 to disable */ public int shadowOffsetX = 0; /** Offset of text shadow on Y axis in pixels, 0 to disable */ public int shadowOffsetY = 0; /** Shadow color; only used if shadowOffset > 0. If alpha component is 0, no shadow is drawn but characters are still offset * by shadowOffset. */ public Color shadowColor = new Color(0, 0, 0, 0.75f); /** Pixels to add to glyph spacing when text is rendered. Can be negative. */ public int spaceX, spaceY; /** Pixels to add to the glyph in the texture. Cannot be negative. */ public int padTop, padLeft, padBottom, padRight; /** The characters the font should contain. If '\0' is not included then {@link BitmapFontData#missingGlyph} is not set. */ public String characters = DEFAULT_CHARS; /** Whether the font should include kerning */ public boolean kerning = true; /** The optional PixmapPacker to use for packing multiple fonts into a single texture. * @see FreeTypeFontParameter */ public PixmapPacker packer = null; /** Whether to flip the font vertically */ public boolean flip = false; /** Whether to generate mip maps for the resulting texture */ public boolean genMipMaps = false; /** Minification filter */ public TextureFilter minFilter = TextureFilter.Nearest; /** Magnification filter */ public TextureFilter magFilter = TextureFilter.Nearest; /** When true, glyphs are rendered on the fly to the font's glyph page textures as they are needed. The * FreeTypeFontGenerator must not be disposed until the font is no longer needed. The FreeTypeBitmapFontData must be * disposed (separately from the generator) when the font is no longer needed. The FreeTypeFontParameter should not be * modified after creating a font. If a PixmapPacker is not specified, the font glyph page textures will use * {@link FreeTypeFontGenerator#getMaxTextureSize()}. */ public boolean incremental; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectTest.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import java.util.Random; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.ModelInstance; import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; import com.badlogic.gdx.graphics.g3d.loader.ObjLoader; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; public class ProjectTest extends GdxTest { Model sphere; Camera cam; SpriteBatch batch; BitmapFont font; ModelInstance[] instances = new ModelInstance[100]; ModelBatch modelBatch; Vector3 tmp = new Vector3(); TextureRegion logo; @Override public void create () { ObjLoader objLoader = new ObjLoader(); sphere = objLoader.loadModel(Gdx.files.internal("data/sphere.obj")); sphere.materials.get(0).set(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)); cam = new PerspectiveCamera(45, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.far = 200; Random rand = new Random(); for (int i = 0; i < instances.length; i++) { instances[i] = new ModelInstance(sphere, rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * -100 - 3); } batch = new SpriteBatch(); font = new BitmapFont(); logo = new TextureRegion(new Texture(Gdx.files.internal("data/badlogicsmall.jpg"))); modelBatch = new ModelBatch(); } @Override public void render () { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); cam.update(); modelBatch.begin(cam); int visible = 0; for (int i = 0; i < instances.length; i++) { instances[i].transform.getTranslation(tmp); if (cam.frustum.sphereInFrustum(tmp, 1)) { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.WHITE); visible++; } else { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.RED); } modelBatch.render(instances[i]); } modelBatch.end(); if (Gdx.input.isKeyPressed(Keys.A)) cam.rotate(20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); if (Gdx.input.isKeyPressed(Keys.D)) cam.rotate(-20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); batch.begin(); for (int i = 0; i < instances.length; i++) { instances[i].transform.getTranslation(tmp); cam.project(tmp); if (tmp.z < 0) continue; batch.draw(logo, tmp.x, tmp.y); } batch.end(); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests; import java.util.Random; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.ModelBatch; import com.badlogic.gdx.graphics.g3d.ModelInstance; import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; import com.badlogic.gdx.graphics.g3d.loader.ObjLoader; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; public class ProjectTest extends GdxTest { Model sphere; Camera cam; SpriteBatch batch; BitmapFont font; ModelInstance[] instances = new ModelInstance[100]; ModelBatch modelBatch; Vector3 tmp = new Vector3(); TextureRegion logo; @Override public void create () { ObjLoader objLoader = new ObjLoader(); sphere = objLoader.loadModel(Gdx.files.internal("data/sphere.obj")); sphere.materials.get(0).set(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)); cam = new PerspectiveCamera(45, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.far = 200; Random rand = new Random(); for (int i = 0; i < instances.length; i++) { instances[i] = new ModelInstance(sphere, rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * 100 - rand.nextFloat() * 100, rand.nextFloat() * -100 - 3); } batch = new SpriteBatch(); font = new BitmapFont(); logo = new TextureRegion(new Texture(Gdx.files.internal("data/badlogicsmall.jpg"))); modelBatch = new ModelBatch(); } @Override public void render () { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); cam.update(); modelBatch.begin(cam); int visible = 0; for (int i = 0; i < instances.length; i++) { instances[i].transform.getTranslation(tmp); if (cam.frustum.sphereInFrustum(tmp, 1)) { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.WHITE); visible++; } else { ((ColorAttribute)instances[i].materials.get(0).get(ColorAttribute.Diffuse)).color.set(Color.RED); } modelBatch.render(instances[i]); } modelBatch.end(); if (Gdx.input.isKeyPressed(Keys.A)) cam.rotate(20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); if (Gdx.input.isKeyPressed(Keys.D)) cam.rotate(-20 * Gdx.graphics.getDeltaTime(), 0, 1, 0); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); batch.begin(); for (int i = 0; i < instances.length; i++) { instances[i].transform.getTranslation(tmp); cam.project(tmp); if (tmp.z < 0) continue; batch.draw(logo, tmp.x, tmp.y); } batch.end(); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/src/bullet/BulletSoftBody/btSparseSDF.h
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ ///btSparseSdf implementation by Nathanael Presson #ifndef BT_SPARSE_SDF_H #define BT_SPARSE_SDF_H #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h" // Modified Paul Hsieh hash template <const int DWORDLEN> unsigned int HsiehHash(const void* pdata) { const unsigned short* data=(const unsigned short*)pdata; unsigned hash=DWORDLEN<<2,tmp; for(int i=0;i<DWORDLEN;++i) { hash += data[0]; tmp = (data[1]<<11)^hash; hash = (hash<<16)^tmp; data += 2; hash += hash>>11; } hash^=hash<<3;hash+=hash>>5; hash^=hash<<4;hash+=hash>>17; hash^=hash<<25;hash+=hash>>6; return(hash); } template <const int CELLSIZE> struct btSparseSdf { // // Inner types // struct IntFrac { int b; int i; btScalar f; }; struct Cell { btScalar d[CELLSIZE+1][CELLSIZE+1][CELLSIZE+1]; int c[3]; int puid; unsigned hash; const btCollisionShape* pclient; Cell* next; }; // // Fields // btAlignedObjectArray<Cell*> cells; btScalar voxelsz; int puid; int ncells; int m_clampCells; int nprobes; int nqueries; // // Methods // // void Initialize(int hashsize=2383, int clampCells = 256*1024) { //avoid a crash due to running out of memory, so clamp the maximum number of cells allocated //if this limit is reached, the SDF is reset (at the cost of some performance during the reset) m_clampCells = clampCells; cells.resize(hashsize,0); Reset(); } // void Reset() { for(int i=0,ni=cells.size();i<ni;++i) { Cell* pc=cells[i]; cells[i]=0; while(pc) { Cell* pn=pc->next; delete pc; pc=pn; } } voxelsz =0.25; puid =0; ncells =0; nprobes =1; nqueries =1; } // void GarbageCollect(int lifetime=256) { const int life=puid-lifetime; for(int i=0;i<cells.size();++i) { Cell*& root=cells[i]; Cell* pp=0; Cell* pc=root; while(pc) { Cell* pn=pc->next; if(pc->puid<life) { if(pp) pp->next=pn; else root=pn; delete pc;pc=pp;--ncells; } pp=pc;pc=pn; } } //printf("GC[%d]: %d cells, PpQ: %f\r\n",puid,ncells,nprobes/(btScalar)nqueries); nqueries=1; nprobes=1; ++puid; ///@todo: Reset puid's when int range limit is reached */ /* else setup a priority list... */ } // int RemoveReferences(btCollisionShape* pcs) { int refcount=0; for(int i=0;i<cells.size();++i) { Cell*& root=cells[i]; Cell* pp=0; Cell* pc=root; while(pc) { Cell* pn=pc->next; if(pc->pclient==pcs) { if(pp) pp->next=pn; else root=pn; delete pc;pc=pp;++refcount; } pp=pc;pc=pn; } } return(refcount); } // btScalar Evaluate( const btVector3& x, const btCollisionShape* shape, btVector3& normal, btScalar margin) { /* Lookup cell */ const btVector3 scx=x/voxelsz; const IntFrac ix=Decompose(scx.x()); const IntFrac iy=Decompose(scx.y()); const IntFrac iz=Decompose(scx.z()); const unsigned h=Hash(ix.b,iy.b,iz.b,shape); Cell*& root=cells[static_cast<int>(h%cells.size())]; Cell* c=root; ++nqueries; while(c) { ++nprobes; if( (c->hash==h) && (c->c[0]==ix.b) && (c->c[1]==iy.b) && (c->c[2]==iz.b) && (c->pclient==shape)) { break; } else { c=c->next; } } if(!c) { ++nprobes; ++ncells; //int sz = sizeof(Cell); if (ncells>m_clampCells) { static int numResets=0; numResets++; // printf("numResets=%d\n",numResets); Reset(); } c=new Cell(); c->next=root;root=c; c->pclient=shape; c->hash=h; c->c[0]=ix.b;c->c[1]=iy.b;c->c[2]=iz.b; BuildCell(*c); } c->puid=puid; /* Extract infos */ const int o[]={ ix.i,iy.i,iz.i}; const btScalar d[]={ c->d[o[0]+0][o[1]+0][o[2]+0], c->d[o[0]+1][o[1]+0][o[2]+0], c->d[o[0]+1][o[1]+1][o[2]+0], c->d[o[0]+0][o[1]+1][o[2]+0], c->d[o[0]+0][o[1]+0][o[2]+1], c->d[o[0]+1][o[1]+0][o[2]+1], c->d[o[0]+1][o[1]+1][o[2]+1], c->d[o[0]+0][o[1]+1][o[2]+1]}; /* Normal */ #if 1 const btScalar gx[]={ d[1]-d[0],d[2]-d[3], d[5]-d[4],d[6]-d[7]}; const btScalar gy[]={ d[3]-d[0],d[2]-d[1], d[7]-d[4],d[6]-d[5]}; const btScalar gz[]={ d[4]-d[0],d[5]-d[1], d[7]-d[3],d[6]-d[2]}; normal.setX(Lerp( Lerp(gx[0],gx[1],iy.f), Lerp(gx[2],gx[3],iy.f),iz.f)); normal.setY(Lerp( Lerp(gy[0],gy[1],ix.f), Lerp(gy[2],gy[3],ix.f),iz.f)); normal.setZ(Lerp( Lerp(gz[0],gz[1],ix.f), Lerp(gz[2],gz[3],ix.f),iy.f)); normal = normal.normalized(); #else normal = btVector3(d[1]-d[0],d[3]-d[0],d[4]-d[0]).normalized(); #endif /* Distance */ const btScalar d0=Lerp(Lerp(d[0],d[1],ix.f), Lerp(d[3],d[2],ix.f),iy.f); const btScalar d1=Lerp(Lerp(d[4],d[5],ix.f), Lerp(d[7],d[6],ix.f),iy.f); return(Lerp(d0,d1,iz.f)-margin); } // void BuildCell(Cell& c) { const btVector3 org=btVector3( (btScalar)c.c[0], (btScalar)c.c[1], (btScalar)c.c[2]) * CELLSIZE*voxelsz; for(int k=0;k<=CELLSIZE;++k) { const btScalar z=voxelsz*k+org.z(); for(int j=0;j<=CELLSIZE;++j) { const btScalar y=voxelsz*j+org.y(); for(int i=0;i<=CELLSIZE;++i) { const btScalar x=voxelsz*i+org.x(); c.d[i][j][k]=DistanceToShape( btVector3(x,y,z), c.pclient); } } } } // static inline btScalar DistanceToShape(const btVector3& x, const btCollisionShape* shape) { btTransform unit; unit.setIdentity(); if(shape->isConvex()) { btGjkEpaSolver2::sResults res; const btConvexShape* csh=static_cast<const btConvexShape*>(shape); return(btGjkEpaSolver2::SignedDistance(x,0,csh,unit,res)); } return(0); } // static inline IntFrac Decompose(btScalar x) { /* That one need a lot of improvements... */ /* Remove test, faster floor... */ IntFrac r; x/=CELLSIZE; const int o=x<0?(int)(-x+1):0; x+=o;r.b=(int)x; const btScalar k=(x-r.b)*CELLSIZE; r.i=(int)k;r.f=k-r.i;r.b-=o; return(r); } // static inline btScalar Lerp(btScalar a,btScalar b,btScalar t) { return(a+(b-a)*t); } // static inline unsigned int Hash(int x,int y,int z,const btCollisionShape* shape) { struct btS { int x,y,z; void* p; }; btS myset; myset.x=x;myset.y=y;myset.z=z;myset.p=(void*)shape; const void* ptr = &myset; unsigned int result = HsiehHash<sizeof(btS)/4> (ptr); return result; } }; #endif //BT_SPARSE_SDF_H
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ ///btSparseSdf implementation by Nathanael Presson #ifndef BT_SPARSE_SDF_H #define BT_SPARSE_SDF_H #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h" // Modified Paul Hsieh hash template <const int DWORDLEN> unsigned int HsiehHash(const void* pdata) { const unsigned short* data=(const unsigned short*)pdata; unsigned hash=DWORDLEN<<2,tmp; for(int i=0;i<DWORDLEN;++i) { hash += data[0]; tmp = (data[1]<<11)^hash; hash = (hash<<16)^tmp; data += 2; hash += hash>>11; } hash^=hash<<3;hash+=hash>>5; hash^=hash<<4;hash+=hash>>17; hash^=hash<<25;hash+=hash>>6; return(hash); } template <const int CELLSIZE> struct btSparseSdf { // // Inner types // struct IntFrac { int b; int i; btScalar f; }; struct Cell { btScalar d[CELLSIZE+1][CELLSIZE+1][CELLSIZE+1]; int c[3]; int puid; unsigned hash; const btCollisionShape* pclient; Cell* next; }; // // Fields // btAlignedObjectArray<Cell*> cells; btScalar voxelsz; int puid; int ncells; int m_clampCells; int nprobes; int nqueries; // // Methods // // void Initialize(int hashsize=2383, int clampCells = 256*1024) { //avoid a crash due to running out of memory, so clamp the maximum number of cells allocated //if this limit is reached, the SDF is reset (at the cost of some performance during the reset) m_clampCells = clampCells; cells.resize(hashsize,0); Reset(); } // void Reset() { for(int i=0,ni=cells.size();i<ni;++i) { Cell* pc=cells[i]; cells[i]=0; while(pc) { Cell* pn=pc->next; delete pc; pc=pn; } } voxelsz =0.25; puid =0; ncells =0; nprobes =1; nqueries =1; } // void GarbageCollect(int lifetime=256) { const int life=puid-lifetime; for(int i=0;i<cells.size();++i) { Cell*& root=cells[i]; Cell* pp=0; Cell* pc=root; while(pc) { Cell* pn=pc->next; if(pc->puid<life) { if(pp) pp->next=pn; else root=pn; delete pc;pc=pp;--ncells; } pp=pc;pc=pn; } } //printf("GC[%d]: %d cells, PpQ: %f\r\n",puid,ncells,nprobes/(btScalar)nqueries); nqueries=1; nprobes=1; ++puid; ///@todo: Reset puid's when int range limit is reached */ /* else setup a priority list... */ } // int RemoveReferences(btCollisionShape* pcs) { int refcount=0; for(int i=0;i<cells.size();++i) { Cell*& root=cells[i]; Cell* pp=0; Cell* pc=root; while(pc) { Cell* pn=pc->next; if(pc->pclient==pcs) { if(pp) pp->next=pn; else root=pn; delete pc;pc=pp;++refcount; } pp=pc;pc=pn; } } return(refcount); } // btScalar Evaluate( const btVector3& x, const btCollisionShape* shape, btVector3& normal, btScalar margin) { /* Lookup cell */ const btVector3 scx=x/voxelsz; const IntFrac ix=Decompose(scx.x()); const IntFrac iy=Decompose(scx.y()); const IntFrac iz=Decompose(scx.z()); const unsigned h=Hash(ix.b,iy.b,iz.b,shape); Cell*& root=cells[static_cast<int>(h%cells.size())]; Cell* c=root; ++nqueries; while(c) { ++nprobes; if( (c->hash==h) && (c->c[0]==ix.b) && (c->c[1]==iy.b) && (c->c[2]==iz.b) && (c->pclient==shape)) { break; } else { c=c->next; } } if(!c) { ++nprobes; ++ncells; //int sz = sizeof(Cell); if (ncells>m_clampCells) { static int numResets=0; numResets++; // printf("numResets=%d\n",numResets); Reset(); } c=new Cell(); c->next=root;root=c; c->pclient=shape; c->hash=h; c->c[0]=ix.b;c->c[1]=iy.b;c->c[2]=iz.b; BuildCell(*c); } c->puid=puid; /* Extract infos */ const int o[]={ ix.i,iy.i,iz.i}; const btScalar d[]={ c->d[o[0]+0][o[1]+0][o[2]+0], c->d[o[0]+1][o[1]+0][o[2]+0], c->d[o[0]+1][o[1]+1][o[2]+0], c->d[o[0]+0][o[1]+1][o[2]+0], c->d[o[0]+0][o[1]+0][o[2]+1], c->d[o[0]+1][o[1]+0][o[2]+1], c->d[o[0]+1][o[1]+1][o[2]+1], c->d[o[0]+0][o[1]+1][o[2]+1]}; /* Normal */ #if 1 const btScalar gx[]={ d[1]-d[0],d[2]-d[3], d[5]-d[4],d[6]-d[7]}; const btScalar gy[]={ d[3]-d[0],d[2]-d[1], d[7]-d[4],d[6]-d[5]}; const btScalar gz[]={ d[4]-d[0],d[5]-d[1], d[7]-d[3],d[6]-d[2]}; normal.setX(Lerp( Lerp(gx[0],gx[1],iy.f), Lerp(gx[2],gx[3],iy.f),iz.f)); normal.setY(Lerp( Lerp(gy[0],gy[1],ix.f), Lerp(gy[2],gy[3],ix.f),iz.f)); normal.setZ(Lerp( Lerp(gz[0],gz[1],ix.f), Lerp(gz[2],gz[3],ix.f),iy.f)); normal = normal.normalized(); #else normal = btVector3(d[1]-d[0],d[3]-d[0],d[4]-d[0]).normalized(); #endif /* Distance */ const btScalar d0=Lerp(Lerp(d[0],d[1],ix.f), Lerp(d[3],d[2],ix.f),iy.f); const btScalar d1=Lerp(Lerp(d[4],d[5],ix.f), Lerp(d[7],d[6],ix.f),iy.f); return(Lerp(d0,d1,iz.f)-margin); } // void BuildCell(Cell& c) { const btVector3 org=btVector3( (btScalar)c.c[0], (btScalar)c.c[1], (btScalar)c.c[2]) * CELLSIZE*voxelsz; for(int k=0;k<=CELLSIZE;++k) { const btScalar z=voxelsz*k+org.z(); for(int j=0;j<=CELLSIZE;++j) { const btScalar y=voxelsz*j+org.y(); for(int i=0;i<=CELLSIZE;++i) { const btScalar x=voxelsz*i+org.x(); c.d[i][j][k]=DistanceToShape( btVector3(x,y,z), c.pclient); } } } } // static inline btScalar DistanceToShape(const btVector3& x, const btCollisionShape* shape) { btTransform unit; unit.setIdentity(); if(shape->isConvex()) { btGjkEpaSolver2::sResults res; const btConvexShape* csh=static_cast<const btConvexShape*>(shape); return(btGjkEpaSolver2::SignedDistance(x,0,csh,unit,res)); } return(0); } // static inline IntFrac Decompose(btScalar x) { /* That one need a lot of improvements... */ /* Remove test, faster floor... */ IntFrac r; x/=CELLSIZE; const int o=x<0?(int)(-x+1):0; x+=o;r.b=(int)x; const btScalar k=(x-r.b)*CELLSIZE; r.i=(int)k;r.f=k-r.i;r.b-=o; return(r); } // static inline btScalar Lerp(btScalar a,btScalar b,btScalar t) { return(a+(b-a)*t); } // static inline unsigned int Hash(int x,int y,int z,const btCollisionShape* shape) { struct btS { int x,y,z; void* p; }; btS myset; myset.x=x;myset.y=y;myset.z=z;myset.p=(void*)shape; const void* ptr = &myset; unsigned int result = HsiehHash<sizeof(btS)/4> (ptr); return result; } }; #endif //BT_SPARSE_SDF_H
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/src/bullet/BulletSoftBody/btSoftBody.cpp
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ ///btSoftBody implementation by Nathanael Presson #include "btSoftBodyInternals.h" #include "BulletSoftBody/btSoftBodySolvers.h" #include "btSoftBodyData.h" #include "LinearMath/btSerializer.h" #include "BulletDynamics/Featherstone/btMultiBodyLinkCollider.h" #include "BulletDynamics/Featherstone/btMultiBodyConstraint.h" // btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo,int node_count, const btVector3* x, const btScalar* m) :m_softBodySolver(0),m_worldInfo(worldInfo) { /* Init */ initDefaults(); /* Default material */ Material* pm=appendMaterial(); pm->m_kLST = 1; pm->m_kAST = 1; pm->m_kVST = 1; pm->m_flags = fMaterial::Default; /* Nodes */ const btScalar margin=getCollisionShape()->getMargin(); m_nodes.resize(node_count); for(int i=0,ni=node_count;i<ni;++i) { Node& n=m_nodes[i]; ZeroInitialize(n); n.m_x = x?*x++:btVector3(0,0,0); n.m_q = n.m_x; n.m_im = m?*m++:1; n.m_im = n.m_im>0?1/n.m_im:0; n.m_leaf = m_ndbvt.insert(btDbvtVolume::FromCR(n.m_x,margin),&n); n.m_material= pm; } updateBounds(); } btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo) :m_worldInfo(worldInfo) { initDefaults(); } void btSoftBody::initDefaults() { m_internalType = CO_SOFT_BODY; m_cfg.aeromodel = eAeroModel::V_Point; m_cfg.kVCF = 1; m_cfg.kDG = 0; m_cfg.kLF = 0; m_cfg.kDP = 0; m_cfg.kPR = 0; m_cfg.kVC = 0; m_cfg.kDF = (btScalar)0.2; m_cfg.kMT = 0; m_cfg.kCHR = (btScalar)1.0; m_cfg.kKHR = (btScalar)0.1; m_cfg.kSHR = (btScalar)1.0; m_cfg.kAHR = (btScalar)0.7; m_cfg.kSRHR_CL = (btScalar)0.1; m_cfg.kSKHR_CL = (btScalar)1; m_cfg.kSSHR_CL = (btScalar)0.5; m_cfg.kSR_SPLT_CL = (btScalar)0.5; m_cfg.kSK_SPLT_CL = (btScalar)0.5; m_cfg.kSS_SPLT_CL = (btScalar)0.5; m_cfg.maxvolume = (btScalar)1; m_cfg.timescale = 1; m_cfg.viterations = 0; m_cfg.piterations = 1; m_cfg.diterations = 0; m_cfg.citerations = 4; m_cfg.collisions = fCollision::Default; m_pose.m_bvolume = false; m_pose.m_bframe = false; m_pose.m_volume = 0; m_pose.m_com = btVector3(0,0,0); m_pose.m_rot.setIdentity(); m_pose.m_scl.setIdentity(); m_tag = 0; m_timeacc = 0; m_bUpdateRtCst = true; m_bounds[0] = btVector3(0,0,0); m_bounds[1] = btVector3(0,0,0); m_worldTransform.setIdentity(); setSolver(eSolverPresets::Positions); /* Collision shape */ ///for now, create a collision shape internally m_collisionShape = new btSoftBodyCollisionShape(this); m_collisionShape->setMargin(0.25f); m_initialWorldTransform.setIdentity(); m_windVelocity = btVector3(0,0,0); m_restLengthScale = btScalar(1.0); } // btSoftBody::~btSoftBody() { //for now, delete the internal shape delete m_collisionShape; int i; releaseClusters(); for(i=0;i<m_materials.size();++i) btAlignedFree(m_materials[i]); for(i=0;i<m_joints.size();++i) btAlignedFree(m_joints[i]); } // bool btSoftBody::checkLink(int node0,int node1) const { return(checkLink(&m_nodes[node0],&m_nodes[node1])); } // bool btSoftBody::checkLink(const Node* node0,const Node* node1) const { const Node* n[]={node0,node1}; for(int i=0,ni=m_links.size();i<ni;++i) { const Link& l=m_links[i]; if( (l.m_n[0]==n[0]&&l.m_n[1]==n[1])|| (l.m_n[0]==n[1]&&l.m_n[1]==n[0])) { return(true); } } return(false); } // bool btSoftBody::checkFace(int node0,int node1,int node2) const { const Node* n[]={ &m_nodes[node0], &m_nodes[node1], &m_nodes[node2]}; for(int i=0,ni=m_faces.size();i<ni;++i) { const Face& f=m_faces[i]; int c=0; for(int j=0;j<3;++j) { if( (f.m_n[j]==n[0])|| (f.m_n[j]==n[1])|| (f.m_n[j]==n[2])) c|=1<<j; else break; } if(c==7) return(true); } return(false); } // btSoftBody::Material* btSoftBody::appendMaterial() { Material* pm=new(btAlignedAlloc(sizeof(Material),16)) Material(); if(m_materials.size()>0) *pm=*m_materials[0]; else ZeroInitialize(*pm); m_materials.push_back(pm); return(pm); } // void btSoftBody::appendNote( const char* text, const btVector3& o, const btVector4& c, Node* n0, Node* n1, Node* n2, Node* n3) { Note n; ZeroInitialize(n); n.m_rank = 0; n.m_text = text; n.m_offset = o; n.m_coords[0] = c.x(); n.m_coords[1] = c.y(); n.m_coords[2] = c.z(); n.m_coords[3] = c.w(); n.m_nodes[0] = n0;n.m_rank+=n0?1:0; n.m_nodes[1] = n1;n.m_rank+=n1?1:0; n.m_nodes[2] = n2;n.m_rank+=n2?1:0; n.m_nodes[3] = n3;n.m_rank+=n3?1:0; m_notes.push_back(n); } // void btSoftBody::appendNote( const char* text, const btVector3& o, Node* feature) { appendNote(text,o,btVector4(1,0,0,0),feature); } // void btSoftBody::appendNote( const char* text, const btVector3& o, Link* feature) { static const btScalar w=1/(btScalar)2; appendNote(text,o,btVector4(w,w,0,0), feature->m_n[0], feature->m_n[1]); } // void btSoftBody::appendNote( const char* text, const btVector3& o, Face* feature) { static const btScalar w=1/(btScalar)3; appendNote(text,o,btVector4(w,w,w,0), feature->m_n[0], feature->m_n[1], feature->m_n[2]); } // void btSoftBody::appendNode( const btVector3& x,btScalar m) { if(m_nodes.capacity()==m_nodes.size()) { pointersToIndices(); m_nodes.reserve(m_nodes.size()*2+1); indicesToPointers(); } const btScalar margin=getCollisionShape()->getMargin(); m_nodes.push_back(Node()); Node& n=m_nodes[m_nodes.size()-1]; ZeroInitialize(n); n.m_x = x; n.m_q = n.m_x; n.m_im = m>0?1/m:0; n.m_material = m_materials[0]; n.m_leaf = m_ndbvt.insert(btDbvtVolume::FromCR(n.m_x,margin),&n); } // void btSoftBody::appendLink(int model,Material* mat) { Link l; if(model>=0) l=m_links[model]; else { ZeroInitialize(l);l.m_material=mat?mat:m_materials[0]; } m_links.push_back(l); } // void btSoftBody::appendLink( int node0, int node1, Material* mat, bool bcheckexist) { appendLink(&m_nodes[node0],&m_nodes[node1],mat,bcheckexist); } // void btSoftBody::appendLink( Node* node0, Node* node1, Material* mat, bool bcheckexist) { if((!bcheckexist)||(!checkLink(node0,node1))) { appendLink(-1,mat); Link& l=m_links[m_links.size()-1]; l.m_n[0] = node0; l.m_n[1] = node1; l.m_rl = (l.m_n[0]->m_x-l.m_n[1]->m_x).length(); m_bUpdateRtCst=true; } } // void btSoftBody::appendFace(int model,Material* mat) { Face f; if(model>=0) { f=m_faces[model]; } else { ZeroInitialize(f);f.m_material=mat?mat:m_materials[0]; } m_faces.push_back(f); } // void btSoftBody::appendFace(int node0,int node1,int node2,Material* mat) { if (node0==node1) return; if (node1==node2) return; if (node2==node0) return; appendFace(-1,mat); Face& f=m_faces[m_faces.size()-1]; btAssert(node0!=node1); btAssert(node1!=node2); btAssert(node2!=node0); f.m_n[0] = &m_nodes[node0]; f.m_n[1] = &m_nodes[node1]; f.m_n[2] = &m_nodes[node2]; f.m_ra = AreaOf( f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x); m_bUpdateRtCst=true; } // void btSoftBody::appendTetra(int model,Material* mat) { Tetra t; if(model>=0) t=m_tetras[model]; else { ZeroInitialize(t);t.m_material=mat?mat:m_materials[0]; } m_tetras.push_back(t); } // void btSoftBody::appendTetra(int node0, int node1, int node2, int node3, Material* mat) { appendTetra(-1,mat); Tetra& t=m_tetras[m_tetras.size()-1]; t.m_n[0] = &m_nodes[node0]; t.m_n[1] = &m_nodes[node1]; t.m_n[2] = &m_nodes[node2]; t.m_n[3] = &m_nodes[node3]; t.m_rv = VolumeOf(t.m_n[0]->m_x,t.m_n[1]->m_x,t.m_n[2]->m_x,t.m_n[3]->m_x); m_bUpdateRtCst=true; } // void btSoftBody::appendAnchor(int node,btRigidBody* body, bool disableCollisionBetweenLinkedBodies,btScalar influence) { btVector3 local = body->getWorldTransform().inverse()*m_nodes[node].m_x; appendAnchor(node,body,local,disableCollisionBetweenLinkedBodies,influence); } // void btSoftBody::appendAnchor(int node,btRigidBody* body, const btVector3& localPivot,bool disableCollisionBetweenLinkedBodies,btScalar influence) { if (disableCollisionBetweenLinkedBodies) { if (m_collisionDisabledObjects.findLinearSearch(body)==m_collisionDisabledObjects.size()) { m_collisionDisabledObjects.push_back(body); } } Anchor a; a.m_node = &m_nodes[node]; a.m_body = body; a.m_local = localPivot; a.m_node->m_battach = 1; a.m_influence = influence; m_anchors.push_back(a); } // void btSoftBody::appendLinearJoint(const LJoint::Specs& specs,Cluster* body0,Body body1) { LJoint* pj = new(btAlignedAlloc(sizeof(LJoint),16)) LJoint(); pj->m_bodies[0] = body0; pj->m_bodies[1] = body1; pj->m_refs[0] = pj->m_bodies[0].xform().inverse()*specs.position; pj->m_refs[1] = pj->m_bodies[1].xform().inverse()*specs.position; pj->m_cfm = specs.cfm; pj->m_erp = specs.erp; pj->m_split = specs.split; m_joints.push_back(pj); } // void btSoftBody::appendLinearJoint(const LJoint::Specs& specs,Body body) { appendLinearJoint(specs,m_clusters[0],body); } // void btSoftBody::appendLinearJoint(const LJoint::Specs& specs,btSoftBody* body) { appendLinearJoint(specs,m_clusters[0],body->m_clusters[0]); } // void btSoftBody::appendAngularJoint(const AJoint::Specs& specs,Cluster* body0,Body body1) { AJoint* pj = new(btAlignedAlloc(sizeof(AJoint),16)) AJoint(); pj->m_bodies[0] = body0; pj->m_bodies[1] = body1; pj->m_refs[0] = pj->m_bodies[0].xform().inverse().getBasis()*specs.axis; pj->m_refs[1] = pj->m_bodies[1].xform().inverse().getBasis()*specs.axis; pj->m_cfm = specs.cfm; pj->m_erp = specs.erp; pj->m_split = specs.split; pj->m_icontrol = specs.icontrol; m_joints.push_back(pj); } // void btSoftBody::appendAngularJoint(const AJoint::Specs& specs,Body body) { appendAngularJoint(specs,m_clusters[0],body); } // void btSoftBody::appendAngularJoint(const AJoint::Specs& specs,btSoftBody* body) { appendAngularJoint(specs,m_clusters[0],body->m_clusters[0]); } // void btSoftBody::addForce(const btVector3& force) { for(int i=0,ni=m_nodes.size();i<ni;++i) addForce(force,i); } // void btSoftBody::addForce(const btVector3& force,int node) { Node& n=m_nodes[node]; if(n.m_im>0) { n.m_f += force; } } void btSoftBody::addAeroForceToNode(const btVector3& windVelocity,int nodeIndex) { btAssert(nodeIndex >= 0 && nodeIndex < m_nodes.size()); const btScalar dt = m_sst.sdt; const btScalar kLF = m_cfg.kLF; const btScalar kDG = m_cfg.kDG; //const btScalar kPR = m_cfg.kPR; //const btScalar kVC = m_cfg.kVC; const bool as_lift = kLF>0; const bool as_drag = kDG>0; const bool as_aero = as_lift || as_drag; const bool as_vaero = as_aero && (m_cfg.aeromodel < btSoftBody::eAeroModel::F_TwoSided); Node& n = m_nodes[nodeIndex]; if( n.m_im>0 ) { btSoftBody::sMedium medium; EvaluateMedium(m_worldInfo, n.m_x, medium); medium.m_velocity = windVelocity; medium.m_density = m_worldInfo->air_density; /* Aerodynamics */ if(as_vaero) { const btVector3 rel_v = n.m_v - medium.m_velocity; const btScalar rel_v_len = rel_v.length(); const btScalar rel_v2 = rel_v.length2(); if(rel_v2>SIMD_EPSILON) { const btVector3 rel_v_nrm = rel_v.normalized(); btVector3 nrm = n.m_n; if (m_cfg.aeromodel == btSoftBody::eAeroModel::V_TwoSidedLiftDrag) { nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); btVector3 fDrag(0, 0, 0); btVector3 fLift(0, 0, 0); btScalar n_dot_v = nrm.dot(rel_v_nrm); btScalar tri_area = 0.5f * n.m_area; fDrag = 0.5f * kDG * medium.m_density * rel_v2 * tri_area * n_dot_v * (-rel_v_nrm); // Check angle of attack // cos(10) = 0.98480 if ( 0 < n_dot_v && n_dot_v < 0.98480f) fLift = 0.5f * kLF * medium.m_density * rel_v_len * tri_area * btSqrt(1.0f-n_dot_v*n_dot_v) * (nrm.cross(rel_v_nrm).cross(rel_v_nrm)); // Check if the velocity change resulted by aero drag force exceeds the current velocity of the node. btVector3 del_v_by_fDrag = fDrag*n.m_im*m_sst.sdt; btScalar del_v_by_fDrag_len2 = del_v_by_fDrag.length2(); btScalar v_len2 = n.m_v.length2(); if (del_v_by_fDrag_len2 >= v_len2 && del_v_by_fDrag_len2 > 0) { btScalar del_v_by_fDrag_len = del_v_by_fDrag.length(); btScalar v_len = n.m_v.length(); fDrag *= btScalar(0.8)*(v_len / del_v_by_fDrag_len); } n.m_f += fDrag; n.m_f += fLift; } else if (m_cfg.aeromodel == btSoftBody::eAeroModel::V_Point || m_cfg.aeromodel == btSoftBody::eAeroModel::V_OneSided || m_cfg.aeromodel == btSoftBody::eAeroModel::V_TwoSided) { if (m_cfg.aeromodel == btSoftBody::eAeroModel::V_TwoSided) nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); const btScalar dvn = btDot(rel_v,nrm); /* Compute forces */ if(dvn>0) { btVector3 force(0,0,0); const btScalar c0 = n.m_area * dvn * rel_v2/2; const btScalar c1 = c0 * medium.m_density; force += nrm*(-c1*kLF); force += rel_v.normalized() * (-c1 * kDG); ApplyClampedForce(n, force, dt); } } } } } } void btSoftBody::addAeroForceToFace(const btVector3& windVelocity,int faceIndex) { const btScalar dt = m_sst.sdt; const btScalar kLF = m_cfg.kLF; const btScalar kDG = m_cfg.kDG; // const btScalar kPR = m_cfg.kPR; // const btScalar kVC = m_cfg.kVC; const bool as_lift = kLF>0; const bool as_drag = kDG>0; const bool as_aero = as_lift || as_drag; const bool as_faero = as_aero && (m_cfg.aeromodel >= btSoftBody::eAeroModel::F_TwoSided); if(as_faero) { btSoftBody::Face& f=m_faces[faceIndex]; btSoftBody::sMedium medium; const btVector3 v=(f.m_n[0]->m_v+f.m_n[1]->m_v+f.m_n[2]->m_v)/3; const btVector3 x=(f.m_n[0]->m_x+f.m_n[1]->m_x+f.m_n[2]->m_x)/3; EvaluateMedium(m_worldInfo,x,medium); medium.m_velocity = windVelocity; medium.m_density = m_worldInfo->air_density; const btVector3 rel_v=v-medium.m_velocity; const btScalar rel_v_len = rel_v.length(); const btScalar rel_v2=rel_v.length2(); if(rel_v2>SIMD_EPSILON) { const btVector3 rel_v_nrm = rel_v.normalized(); btVector3 nrm = f.m_normal; if (m_cfg.aeromodel == btSoftBody::eAeroModel::F_TwoSidedLiftDrag) { nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); btVector3 fDrag(0, 0, 0); btVector3 fLift(0, 0, 0); btScalar n_dot_v = nrm.dot(rel_v_nrm); btScalar tri_area = 0.5f * f.m_ra; fDrag = 0.5f * kDG * medium.m_density * rel_v2 * tri_area * n_dot_v * (-rel_v_nrm); // Check angle of attack // cos(10) = 0.98480 if ( 0 < n_dot_v && n_dot_v < 0.98480f) fLift = 0.5f * kLF * medium.m_density * rel_v_len * tri_area * btSqrt(1.0f-n_dot_v*n_dot_v) * (nrm.cross(rel_v_nrm).cross(rel_v_nrm)); fDrag /= 3; fLift /= 3; for(int j=0;j<3;++j) { if (f.m_n[j]->m_im>0) { // Check if the velocity change resulted by aero drag force exceeds the current velocity of the node. btVector3 del_v_by_fDrag = fDrag*f.m_n[j]->m_im*m_sst.sdt; btScalar del_v_by_fDrag_len2 = del_v_by_fDrag.length2(); btScalar v_len2 = f.m_n[j]->m_v.length2(); if (del_v_by_fDrag_len2 >= v_len2 && del_v_by_fDrag_len2 > 0) { btScalar del_v_by_fDrag_len = del_v_by_fDrag.length(); btScalar v_len = f.m_n[j]->m_v.length(); fDrag *= btScalar(0.8)*(v_len / del_v_by_fDrag_len); } f.m_n[j]->m_f += fDrag; f.m_n[j]->m_f += fLift; } } } else if (m_cfg.aeromodel == btSoftBody::eAeroModel::F_OneSided || m_cfg.aeromodel == btSoftBody::eAeroModel::F_TwoSided) { if (m_cfg.aeromodel == btSoftBody::eAeroModel::F_TwoSided) nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); const btScalar dvn=btDot(rel_v,nrm); /* Compute forces */ if(dvn>0) { btVector3 force(0,0,0); const btScalar c0 = f.m_ra*dvn*rel_v2; const btScalar c1 = c0*medium.m_density; force += nrm*(-c1*kLF); force += rel_v.normalized()*(-c1*kDG); force /= 3; for(int j=0;j<3;++j) ApplyClampedForce(*f.m_n[j],force,dt); } } } } } // void btSoftBody::addVelocity(const btVector3& velocity) { for(int i=0,ni=m_nodes.size();i<ni;++i) addVelocity(velocity,i); } /* Set velocity for the entire body */ void btSoftBody::setVelocity( const btVector3& velocity) { for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; if(n.m_im>0) { n.m_v = velocity; } } } // void btSoftBody::addVelocity(const btVector3& velocity,int node) { Node& n=m_nodes[node]; if(n.m_im>0) { n.m_v += velocity; } } // void btSoftBody::setMass(int node,btScalar mass) { m_nodes[node].m_im=mass>0?1/mass:0; m_bUpdateRtCst=true; } // btScalar btSoftBody::getMass(int node) const { return(m_nodes[node].m_im>0?1/m_nodes[node].m_im:0); } // btScalar btSoftBody::getTotalMass() const { btScalar mass=0; for(int i=0;i<m_nodes.size();++i) { mass+=getMass(i); } return(mass); } // void btSoftBody::setTotalMass(btScalar mass,bool fromfaces) { int i; if(fromfaces) { for(i=0;i<m_nodes.size();++i) { m_nodes[i].m_im=0; } for(i=0;i<m_faces.size();++i) { const Face& f=m_faces[i]; const btScalar twicearea=AreaOf( f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x); for(int j=0;j<3;++j) { f.m_n[j]->m_im+=twicearea; } } for( i=0;i<m_nodes.size();++i) { m_nodes[i].m_im=1/m_nodes[i].m_im; } } const btScalar tm=getTotalMass(); const btScalar itm=1/tm; for( i=0;i<m_nodes.size();++i) { m_nodes[i].m_im/=itm*mass; } m_bUpdateRtCst=true; } // void btSoftBody::setTotalDensity(btScalar density) { setTotalMass(getVolume()*density,true); } // void btSoftBody::setVolumeMass(btScalar mass) { btAlignedObjectArray<btScalar> ranks; ranks.resize(m_nodes.size(),0); int i; for(i=0;i<m_nodes.size();++i) { m_nodes[i].m_im=0; } for(i=0;i<m_tetras.size();++i) { const Tetra& t=m_tetras[i]; for(int j=0;j<4;++j) { t.m_n[j]->m_im+=btFabs(t.m_rv); ranks[int(t.m_n[j]-&m_nodes[0])]+=1; } } for( i=0;i<m_nodes.size();++i) { if(m_nodes[i].m_im>0) { m_nodes[i].m_im=ranks[i]/m_nodes[i].m_im; } } setTotalMass(mass,false); } // void btSoftBody::setVolumeDensity(btScalar density) { btScalar volume=0; for(int i=0;i<m_tetras.size();++i) { const Tetra& t=m_tetras[i]; for(int j=0;j<4;++j) { volume+=btFabs(t.m_rv); } } setVolumeMass(volume*density/6); } // void btSoftBody::transform(const btTransform& trs) { const btScalar margin=getCollisionShape()->getMargin(); ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_x=trs*n.m_x; n.m_q=trs*n.m_q; n.m_n=trs.getBasis()*n.m_n; vol = btDbvtVolume::FromCR(n.m_x,margin); m_ndbvt.update(n.m_leaf,vol); } updateNormals(); updateBounds(); updateConstants(); m_initialWorldTransform = trs; } // void btSoftBody::translate(const btVector3& trs) { btTransform t; t.setIdentity(); t.setOrigin(trs); transform(t); } // void btSoftBody::rotate( const btQuaternion& rot) { btTransform t; t.setIdentity(); t.setRotation(rot); transform(t); } // void btSoftBody::scale(const btVector3& scl) { const btScalar margin=getCollisionShape()->getMargin(); ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_x*=scl; n.m_q*=scl; vol = btDbvtVolume::FromCR(n.m_x,margin); m_ndbvt.update(n.m_leaf,vol); } updateNormals(); updateBounds(); updateConstants(); } // btScalar btSoftBody::getRestLengthScale() { return m_restLengthScale; } // void btSoftBody::setRestLengthScale(btScalar restLengthScale) { for(int i=0, ni=m_links.size(); i<ni; ++i) { Link& l=m_links[i]; l.m_rl = l.m_rl / m_restLengthScale * restLengthScale; l.m_c1 = l.m_rl*l.m_rl; } m_restLengthScale = restLengthScale; if (getActivationState() == ISLAND_SLEEPING) activate(); } // void btSoftBody::setPose(bool bvolume,bool bframe) { m_pose.m_bvolume = bvolume; m_pose.m_bframe = bframe; int i,ni; /* Weights */ const btScalar omass=getTotalMass(); const btScalar kmass=omass*m_nodes.size()*1000; btScalar tmass=omass; m_pose.m_wgh.resize(m_nodes.size()); for(i=0,ni=m_nodes.size();i<ni;++i) { if(m_nodes[i].m_im<=0) tmass+=kmass; } for( i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; m_pose.m_wgh[i]= n.m_im>0 ? 1/(m_nodes[i].m_im*tmass) : kmass/tmass; } /* Pos */ const btVector3 com=evaluateCom(); m_pose.m_pos.resize(m_nodes.size()); for( i=0,ni=m_nodes.size();i<ni;++i) { m_pose.m_pos[i]=m_nodes[i].m_x-com; } m_pose.m_volume = bvolume?getVolume():0; m_pose.m_com = com; m_pose.m_rot.setIdentity(); m_pose.m_scl.setIdentity(); /* Aqq */ m_pose.m_aqq[0] = m_pose.m_aqq[1] = m_pose.m_aqq[2] = btVector3(0,0,0); for( i=0,ni=m_nodes.size();i<ni;++i) { const btVector3& q=m_pose.m_pos[i]; const btVector3 mq=m_pose.m_wgh[i]*q; m_pose.m_aqq[0]+=mq.x()*q; m_pose.m_aqq[1]+=mq.y()*q; m_pose.m_aqq[2]+=mq.z()*q; } m_pose.m_aqq=m_pose.m_aqq.inverse(); updateConstants(); } void btSoftBody::resetLinkRestLengths() { for(int i=0, ni=m_links.size();i<ni;++i) { Link& l = m_links[i]; l.m_rl = (l.m_n[0]->m_x-l.m_n[1]->m_x).length(); l.m_c1 = l.m_rl*l.m_rl; } } // btScalar btSoftBody::getVolume() const { btScalar vol=0; if(m_nodes.size()>0) { int i,ni; const btVector3 org=m_nodes[0].m_x; for(i=0,ni=m_faces.size();i<ni;++i) { const Face& f=m_faces[i]; vol+=btDot(f.m_n[0]->m_x-org,btCross(f.m_n[1]->m_x-org,f.m_n[2]->m_x-org)); } vol/=(btScalar)6; } return(vol); } // int btSoftBody::clusterCount() const { return(m_clusters.size()); } // btVector3 btSoftBody::clusterCom(const Cluster* cluster) { btVector3 com(0,0,0); for(int i=0,ni=cluster->m_nodes.size();i<ni;++i) { com+=cluster->m_nodes[i]->m_x*cluster->m_masses[i]; } return(com*cluster->m_imass); } // btVector3 btSoftBody::clusterCom(int cluster) const { return(clusterCom(m_clusters[cluster])); } // btVector3 btSoftBody::clusterVelocity(const Cluster* cluster,const btVector3& rpos) { return(cluster->m_lv+btCross(cluster->m_av,rpos)); } // void btSoftBody::clusterVImpulse(Cluster* cluster,const btVector3& rpos,const btVector3& impulse) { const btVector3 li=cluster->m_imass*impulse; const btVector3 ai=cluster->m_invwi*btCross(rpos,impulse); cluster->m_vimpulses[0]+=li;cluster->m_lv+=li; cluster->m_vimpulses[1]+=ai;cluster->m_av+=ai; cluster->m_nvimpulses++; } // void btSoftBody::clusterDImpulse(Cluster* cluster,const btVector3& rpos,const btVector3& impulse) { const btVector3 li=cluster->m_imass*impulse; const btVector3 ai=cluster->m_invwi*btCross(rpos,impulse); cluster->m_dimpulses[0]+=li; cluster->m_dimpulses[1]+=ai; cluster->m_ndimpulses++; } // void btSoftBody::clusterImpulse(Cluster* cluster,const btVector3& rpos,const Impulse& impulse) { if(impulse.m_asVelocity) clusterVImpulse(cluster,rpos,impulse.m_velocity); if(impulse.m_asDrift) clusterDImpulse(cluster,rpos,impulse.m_drift); } // void btSoftBody::clusterVAImpulse(Cluster* cluster,const btVector3& impulse) { const btVector3 ai=cluster->m_invwi*impulse; cluster->m_vimpulses[1]+=ai;cluster->m_av+=ai; cluster->m_nvimpulses++; } // void btSoftBody::clusterDAImpulse(Cluster* cluster,const btVector3& impulse) { const btVector3 ai=cluster->m_invwi*impulse; cluster->m_dimpulses[1]+=ai; cluster->m_ndimpulses++; } // void btSoftBody::clusterAImpulse(Cluster* cluster,const Impulse& impulse) { if(impulse.m_asVelocity) clusterVAImpulse(cluster,impulse.m_velocity); if(impulse.m_asDrift) clusterDAImpulse(cluster,impulse.m_drift); } // void btSoftBody::clusterDCImpulse(Cluster* cluster,const btVector3& impulse) { cluster->m_dimpulses[0]+=impulse*cluster->m_imass; cluster->m_ndimpulses++; } struct NodeLinks { btAlignedObjectArray<int> m_links; }; // int btSoftBody::generateBendingConstraints(int distance,Material* mat) { int i,j; if(distance>1) { /* Build graph */ const int n=m_nodes.size(); const unsigned inf=(~(unsigned)0)>>1; unsigned* adj=new unsigned[n*n]; #define IDX(_x_,_y_) ((_y_)*n+(_x_)) for(j=0;j<n;++j) { for(i=0;i<n;++i) { if(i!=j) { adj[IDX(i,j)]=adj[IDX(j,i)]=inf; } else { adj[IDX(i,j)]=adj[IDX(j,i)]=0; } } } for( i=0;i<m_links.size();++i) { const int ia=(int)(m_links[i].m_n[0]-&m_nodes[0]); const int ib=(int)(m_links[i].m_n[1]-&m_nodes[0]); adj[IDX(ia,ib)]=1; adj[IDX(ib,ia)]=1; } //special optimized case for distance == 2 if (distance == 2) { btAlignedObjectArray<NodeLinks> nodeLinks; /* Build node links */ nodeLinks.resize(m_nodes.size()); for( i=0;i<m_links.size();++i) { const int ia=(int)(m_links[i].m_n[0]-&m_nodes[0]); const int ib=(int)(m_links[i].m_n[1]-&m_nodes[0]); if (nodeLinks[ia].m_links.findLinearSearch(ib)==nodeLinks[ia].m_links.size()) nodeLinks[ia].m_links.push_back(ib); if (nodeLinks[ib].m_links.findLinearSearch(ia)==nodeLinks[ib].m_links.size()) nodeLinks[ib].m_links.push_back(ia); } for (int ii=0;ii<nodeLinks.size();ii++) { int i=ii; for (int jj=0;jj<nodeLinks[ii].m_links.size();jj++) { int k = nodeLinks[ii].m_links[jj]; for (int kk=0;kk<nodeLinks[k].m_links.size();kk++) { int j = nodeLinks[k].m_links[kk]; if (i!=j) { const unsigned sum=adj[IDX(i,k)]+adj[IDX(k,j)]; btAssert(sum==2); if(adj[IDX(i,j)]>sum) { adj[IDX(i,j)]=adj[IDX(j,i)]=sum; } } } } } } else { ///generic Floyd's algorithm for(int k=0;k<n;++k) { for(j=0;j<n;++j) { for(i=j+1;i<n;++i) { const unsigned sum=adj[IDX(i,k)]+adj[IDX(k,j)]; if(adj[IDX(i,j)]>sum) { adj[IDX(i,j)]=adj[IDX(j,i)]=sum; } } } } } /* Build links */ int nlinks=0; for(j=0;j<n;++j) { for(i=j+1;i<n;++i) { if(adj[IDX(i,j)]==(unsigned)distance) { appendLink(i,j,mat); m_links[m_links.size()-1].m_bbending=1; ++nlinks; } } } delete[] adj; return(nlinks); } return(0); } // void btSoftBody::randomizeConstraints() { unsigned long seed=243703; #define NEXTRAND (seed=(1664525L*seed+1013904223L)&0xffffffff) int i,ni; for(i=0,ni=m_links.size();i<ni;++i) { btSwap(m_links[i],m_links[NEXTRAND%ni]); } for(i=0,ni=m_faces.size();i<ni;++i) { btSwap(m_faces[i],m_faces[NEXTRAND%ni]); } #undef NEXTRAND } // void btSoftBody::releaseCluster(int index) { Cluster* c=m_clusters[index]; if(c->m_leaf) m_cdbvt.remove(c->m_leaf); c->~Cluster(); btAlignedFree(c); m_clusters.remove(c); } // void btSoftBody::releaseClusters() { while(m_clusters.size()>0) releaseCluster(0); } // int btSoftBody::generateClusters(int k,int maxiterations) { int i; releaseClusters(); m_clusters.resize(btMin(k,m_nodes.size())); for(i=0;i<m_clusters.size();++i) { m_clusters[i] = new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); m_clusters[i]->m_collide= true; } k=m_clusters.size(); if(k>0) { /* Initialize */ btAlignedObjectArray<btVector3> centers; btVector3 cog(0,0,0); int i; for(i=0;i<m_nodes.size();++i) { cog+=m_nodes[i].m_x; m_clusters[(i*29873)%m_clusters.size()]->m_nodes.push_back(&m_nodes[i]); } cog/=(btScalar)m_nodes.size(); centers.resize(k,cog); /* Iterate */ const btScalar slope=16; bool changed; int iterations=0; do { const btScalar w=2-btMin<btScalar>(1,iterations/slope); changed=false; iterations++; int i; for(i=0;i<k;++i) { btVector3 c(0,0,0); for(int j=0;j<m_clusters[i]->m_nodes.size();++j) { c+=m_clusters[i]->m_nodes[j]->m_x; } if(m_clusters[i]->m_nodes.size()) { c /= (btScalar)m_clusters[i]->m_nodes.size(); c = centers[i]+(c-centers[i])*w; changed |= ((c-centers[i]).length2()>SIMD_EPSILON); centers[i] = c; m_clusters[i]->m_nodes.resize(0); } } for(i=0;i<m_nodes.size();++i) { const btVector3 nx=m_nodes[i].m_x; int kbest=0; btScalar kdist=ClusterMetric(centers[0],nx); for(int j=1;j<k;++j) { const btScalar d=ClusterMetric(centers[j],nx); if(d<kdist) { kbest=j; kdist=d; } } m_clusters[kbest]->m_nodes.push_back(&m_nodes[i]); } } while(changed&&(iterations<maxiterations)); /* Merge */ btAlignedObjectArray<int> cids; cids.resize(m_nodes.size(),-1); for(i=0;i<m_clusters.size();++i) { for(int j=0;j<m_clusters[i]->m_nodes.size();++j) { cids[int(m_clusters[i]->m_nodes[j]-&m_nodes[0])]=i; } } for(i=0;i<m_faces.size();++i) { const int idx[]={ int(m_faces[i].m_n[0]-&m_nodes[0]), int(m_faces[i].m_n[1]-&m_nodes[0]), int(m_faces[i].m_n[2]-&m_nodes[0])}; for(int j=0;j<3;++j) { const int cid=cids[idx[j]]; for(int q=1;q<3;++q) { const int kid=idx[(j+q)%3]; if(cids[kid]!=cid) { if(m_clusters[cid]->m_nodes.findLinearSearch(&m_nodes[kid])==m_clusters[cid]->m_nodes.size()) { m_clusters[cid]->m_nodes.push_back(&m_nodes[kid]); } } } } } /* Master */ if(m_clusters.size()>1) { Cluster* pmaster=new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); pmaster->m_collide = false; pmaster->m_nodes.reserve(m_nodes.size()); for(int i=0;i<m_nodes.size();++i) pmaster->m_nodes.push_back(&m_nodes[i]); m_clusters.push_back(pmaster); btSwap(m_clusters[0],m_clusters[m_clusters.size()-1]); } /* Terminate */ for(i=0;i<m_clusters.size();++i) { if(m_clusters[i]->m_nodes.size()==0) { releaseCluster(i--); } } } else { //create a cluster for each tetrahedron (if tetrahedra exist) or each face if (m_tetras.size()) { m_clusters.resize(m_tetras.size()); for(i=0;i<m_clusters.size();++i) { m_clusters[i] = new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); m_clusters[i]->m_collide= true; } for (i=0;i<m_tetras.size();i++) { for (int j=0;j<4;j++) { m_clusters[i]->m_nodes.push_back(m_tetras[i].m_n[j]); } } } else { m_clusters.resize(m_faces.size()); for(i=0;i<m_clusters.size();++i) { m_clusters[i] = new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); m_clusters[i]->m_collide= true; } for(i=0;i<m_faces.size();++i) { for(int j=0;j<3;++j) { m_clusters[i]->m_nodes.push_back(m_faces[i].m_n[j]); } } } } if (m_clusters.size()) { initializeClusters(); updateClusters(); //for self-collision m_clusterConnectivity.resize(m_clusters.size()*m_clusters.size()); { for (int c0=0;c0<m_clusters.size();c0++) { m_clusters[c0]->m_clusterIndex=c0; for (int c1=0;c1<m_clusters.size();c1++) { bool connected=false; Cluster* cla = m_clusters[c0]; Cluster* clb = m_clusters[c1]; for (int i=0;!connected&&i<cla->m_nodes.size();i++) { for (int j=0;j<clb->m_nodes.size();j++) { if (cla->m_nodes[i] == clb->m_nodes[j]) { connected=true; break; } } } m_clusterConnectivity[c0+c1*m_clusters.size()]=connected; } } } } return(m_clusters.size()); } // void btSoftBody::refine(ImplicitFn* ifn,btScalar accurary,bool cut) { const Node* nbase = &m_nodes[0]; int ncount = m_nodes.size(); btSymMatrix<int> edges(ncount,-2); int newnodes=0; int i,j,k,ni; /* Filter out */ for(i=0;i<m_links.size();++i) { Link& l=m_links[i]; if(l.m_bbending) { if(!SameSign(ifn->Eval(l.m_n[0]->m_x),ifn->Eval(l.m_n[1]->m_x))) { btSwap(m_links[i],m_links[m_links.size()-1]); m_links.pop_back();--i; } } } /* Fill edges */ for(i=0;i<m_links.size();++i) { Link& l=m_links[i]; edges(int(l.m_n[0]-nbase),int(l.m_n[1]-nbase))=-1; } for(i=0;i<m_faces.size();++i) { Face& f=m_faces[i]; edges(int(f.m_n[0]-nbase),int(f.m_n[1]-nbase))=-1; edges(int(f.m_n[1]-nbase),int(f.m_n[2]-nbase))=-1; edges(int(f.m_n[2]-nbase),int(f.m_n[0]-nbase))=-1; } /* Intersect */ for(i=0;i<ncount;++i) { for(j=i+1;j<ncount;++j) { if(edges(i,j)==-1) { Node& a=m_nodes[i]; Node& b=m_nodes[j]; const btScalar t=ImplicitSolve(ifn,a.m_x,b.m_x,accurary); if(t>0) { const btVector3 x=Lerp(a.m_x,b.m_x,t); const btVector3 v=Lerp(a.m_v,b.m_v,t); btScalar m=0; if(a.m_im>0) { if(b.m_im>0) { const btScalar ma=1/a.m_im; const btScalar mb=1/b.m_im; const btScalar mc=Lerp(ma,mb,t); const btScalar f=(ma+mb)/(ma+mb+mc); a.m_im=1/(ma*f); b.m_im=1/(mb*f); m=mc*f; } else { a.m_im/=0.5f;m=1/a.m_im; } } else { if(b.m_im>0) { b.m_im/=0.5f;m=1/b.m_im; } else m=0; } appendNode(x,m); edges(i,j)=m_nodes.size()-1; m_nodes[edges(i,j)].m_v=v; ++newnodes; } } } } nbase=&m_nodes[0]; /* Refine links */ for(i=0,ni=m_links.size();i<ni;++i) { Link& feat=m_links[i]; const int idx[]={ int(feat.m_n[0]-nbase), int(feat.m_n[1]-nbase)}; if((idx[0]<ncount)&&(idx[1]<ncount)) { const int ni=edges(idx[0],idx[1]); if(ni>0) { appendLink(i); Link* pft[]={ &m_links[i], &m_links[m_links.size()-1]}; pft[0]->m_n[0]=&m_nodes[idx[0]]; pft[0]->m_n[1]=&m_nodes[ni]; pft[1]->m_n[0]=&m_nodes[ni]; pft[1]->m_n[1]=&m_nodes[idx[1]]; } } } /* Refine faces */ for(i=0;i<m_faces.size();++i) { const Face& feat=m_faces[i]; const int idx[]={ int(feat.m_n[0]-nbase), int(feat.m_n[1]-nbase), int(feat.m_n[2]-nbase)}; for(j=2,k=0;k<3;j=k++) { if((idx[j]<ncount)&&(idx[k]<ncount)) { const int ni=edges(idx[j],idx[k]); if(ni>0) { appendFace(i); const int l=(k+1)%3; Face* pft[]={ &m_faces[i], &m_faces[m_faces.size()-1]}; pft[0]->m_n[0]=&m_nodes[idx[l]]; pft[0]->m_n[1]=&m_nodes[idx[j]]; pft[0]->m_n[2]=&m_nodes[ni]; pft[1]->m_n[0]=&m_nodes[ni]; pft[1]->m_n[1]=&m_nodes[idx[k]]; pft[1]->m_n[2]=&m_nodes[idx[l]]; appendLink(ni,idx[l],pft[0]->m_material); --i;break; } } } } /* Cut */ if(cut) { btAlignedObjectArray<int> cnodes; const int pcount=ncount; int i; ncount=m_nodes.size(); cnodes.resize(ncount,0); /* Nodes */ for(i=0;i<ncount;++i) { const btVector3 x=m_nodes[i].m_x; if((i>=pcount)||(btFabs(ifn->Eval(x))<accurary)) { const btVector3 v=m_nodes[i].m_v; btScalar m=getMass(i); if(m>0) { m*=0.5f;m_nodes[i].m_im/=0.5f; } appendNode(x,m); cnodes[i]=m_nodes.size()-1; m_nodes[cnodes[i]].m_v=v; } } nbase=&m_nodes[0]; /* Links */ for(i=0,ni=m_links.size();i<ni;++i) { const int id[]={ int(m_links[i].m_n[0]-nbase), int(m_links[i].m_n[1]-nbase)}; int todetach=0; if(cnodes[id[0]]&&cnodes[id[1]]) { appendLink(i); todetach=m_links.size()-1; } else { if(( (ifn->Eval(m_nodes[id[0]].m_x)<accurary)&& (ifn->Eval(m_nodes[id[1]].m_x)<accurary))) todetach=i; } if(todetach) { Link& l=m_links[todetach]; for(int j=0;j<2;++j) { int cn=cnodes[int(l.m_n[j]-nbase)]; if(cn) l.m_n[j]=&m_nodes[cn]; } } } /* Faces */ for(i=0,ni=m_faces.size();i<ni;++i) { Node** n= m_faces[i].m_n; if( (ifn->Eval(n[0]->m_x)<accurary)&& (ifn->Eval(n[1]->m_x)<accurary)&& (ifn->Eval(n[2]->m_x)<accurary)) { for(int j=0;j<3;++j) { int cn=cnodes[int(n[j]-nbase)]; if(cn) n[j]=&m_nodes[cn]; } } } /* Clean orphans */ int nnodes=m_nodes.size(); btAlignedObjectArray<int> ranks; btAlignedObjectArray<int> todelete; ranks.resize(nnodes,0); for(i=0,ni=m_links.size();i<ni;++i) { for(int j=0;j<2;++j) ranks[int(m_links[i].m_n[j]-nbase)]++; } for(i=0,ni=m_faces.size();i<ni;++i) { for(int j=0;j<3;++j) ranks[int(m_faces[i].m_n[j]-nbase)]++; } for(i=0;i<m_links.size();++i) { const int id[]={ int(m_links[i].m_n[0]-nbase), int(m_links[i].m_n[1]-nbase)}; const bool sg[]={ ranks[id[0]]==1, ranks[id[1]]==1}; if(sg[0]||sg[1]) { --ranks[id[0]]; --ranks[id[1]]; btSwap(m_links[i],m_links[m_links.size()-1]); m_links.pop_back();--i; } } #if 0 for(i=nnodes-1;i>=0;--i) { if(!ranks[i]) todelete.push_back(i); } if(todelete.size()) { btAlignedObjectArray<int>& map=ranks; for(int i=0;i<nnodes;++i) map[i]=i; PointersToIndices(this); for(int i=0,ni=todelete.size();i<ni;++i) { int j=todelete[i]; int& a=map[j]; int& b=map[--nnodes]; m_ndbvt.remove(m_nodes[a].m_leaf);m_nodes[a].m_leaf=0; btSwap(m_nodes[a],m_nodes[b]); j=a;a=b;b=j; } IndicesToPointers(this,&map[0]); m_nodes.resize(nnodes); } #endif } m_bUpdateRtCst=true; } // bool btSoftBody::cutLink(const Node* node0,const Node* node1,btScalar position) { return(cutLink(int(node0-&m_nodes[0]),int(node1-&m_nodes[0]),position)); } // bool btSoftBody::cutLink(int node0,int node1,btScalar position) { bool done=false; int i,ni; // const btVector3 d=m_nodes[node0].m_x-m_nodes[node1].m_x; const btVector3 x=Lerp(m_nodes[node0].m_x,m_nodes[node1].m_x,position); const btVector3 v=Lerp(m_nodes[node0].m_v,m_nodes[node1].m_v,position); const btScalar m=1; appendNode(x,m); appendNode(x,m); Node* pa=&m_nodes[node0]; Node* pb=&m_nodes[node1]; Node* pn[2]={ &m_nodes[m_nodes.size()-2], &m_nodes[m_nodes.size()-1]}; pn[0]->m_v=v; pn[1]->m_v=v; for(i=0,ni=m_links.size();i<ni;++i) { const int mtch=MatchEdge(m_links[i].m_n[0],m_links[i].m_n[1],pa,pb); if(mtch!=-1) { appendLink(i); Link* pft[]={&m_links[i],&m_links[m_links.size()-1]}; pft[0]->m_n[1]=pn[mtch]; pft[1]->m_n[0]=pn[1-mtch]; done=true; } } for(i=0,ni=m_faces.size();i<ni;++i) { for(int k=2,l=0;l<3;k=l++) { const int mtch=MatchEdge(m_faces[i].m_n[k],m_faces[i].m_n[l],pa,pb); if(mtch!=-1) { appendFace(i); Face* pft[]={&m_faces[i],&m_faces[m_faces.size()-1]}; pft[0]->m_n[l]=pn[mtch]; pft[1]->m_n[k]=pn[1-mtch]; appendLink(pn[0],pft[0]->m_n[(l+1)%3],pft[0]->m_material,true); appendLink(pn[1],pft[0]->m_n[(l+1)%3],pft[0]->m_material,true); } } } if(!done) { m_ndbvt.remove(pn[0]->m_leaf); m_ndbvt.remove(pn[1]->m_leaf); m_nodes.pop_back(); m_nodes.pop_back(); } return(done); } // bool btSoftBody::rayTest(const btVector3& rayFrom, const btVector3& rayTo, sRayCast& results) { if(m_faces.size()&&m_fdbvt.empty()) initializeFaceTree(); results.body = this; results.fraction = 1.f; results.feature = eFeature::None; results.index = -1; return(rayTest(rayFrom,rayTo,results.fraction,results.feature,results.index,false)!=0); } // void btSoftBody::setSolver(eSolverPresets::_ preset) { m_cfg.m_vsequence.clear(); m_cfg.m_psequence.clear(); m_cfg.m_dsequence.clear(); switch(preset) { case eSolverPresets::Positions: m_cfg.m_psequence.push_back(ePSolver::Anchors); m_cfg.m_psequence.push_back(ePSolver::RContacts); m_cfg.m_psequence.push_back(ePSolver::SContacts); m_cfg.m_psequence.push_back(ePSolver::Linear); break; case eSolverPresets::Velocities: m_cfg.m_vsequence.push_back(eVSolver::Linear); m_cfg.m_psequence.push_back(ePSolver::Anchors); m_cfg.m_psequence.push_back(ePSolver::RContacts); m_cfg.m_psequence.push_back(ePSolver::SContacts); m_cfg.m_dsequence.push_back(ePSolver::Linear); break; } } // void btSoftBody::predictMotion(btScalar dt) { int i,ni; /* Update */ if(m_bUpdateRtCst) { m_bUpdateRtCst=false; updateConstants(); m_fdbvt.clear(); if(m_cfg.collisions&fCollision::VF_SS) { initializeFaceTree(); } } /* Prepare */ m_sst.sdt = dt*m_cfg.timescale; m_sst.isdt = 1/m_sst.sdt; m_sst.velmrg = m_sst.sdt*3; m_sst.radmrg = getCollisionShape()->getMargin(); m_sst.updmrg = m_sst.radmrg*(btScalar)0.25; /* Forces */ addVelocity(m_worldInfo->m_gravity*m_sst.sdt); applyForces(); /* Integrate */ for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_q = n.m_x; btVector3 deltaV = n.m_f*n.m_im*m_sst.sdt; { btScalar maxDisplacement = m_worldInfo->m_maxDisplacement; btScalar clampDeltaV = maxDisplacement/m_sst.sdt; for (int c=0;c<3;c++) { if (deltaV[c]>clampDeltaV) { deltaV[c] = clampDeltaV; } if (deltaV[c]<-clampDeltaV) { deltaV[c]=-clampDeltaV; } } } n.m_v += deltaV; n.m_x += n.m_v*m_sst.sdt; n.m_f = btVector3(0,0,0); } /* Clusters */ updateClusters(); /* Bounds */ updateBounds(); /* Nodes */ ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; vol = btDbvtVolume::FromCR(n.m_x,m_sst.radmrg); m_ndbvt.update( n.m_leaf, vol, n.m_v*m_sst.velmrg, m_sst.updmrg); } /* Faces */ if(!m_fdbvt.empty()) { for(int i=0;i<m_faces.size();++i) { Face& f=m_faces[i]; const btVector3 v=( f.m_n[0]->m_v+ f.m_n[1]->m_v+ f.m_n[2]->m_v)/3; vol = VolumeOf(f,m_sst.radmrg); m_fdbvt.update( f.m_leaf, vol, v*m_sst.velmrg, m_sst.updmrg); } } /* Pose */ updatePose(); /* Match */ if(m_pose.m_bframe&&(m_cfg.kMT>0)) { const btMatrix3x3 posetrs=m_pose.m_rot; for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; if(n.m_im>0) { const btVector3 x=posetrs*m_pose.m_pos[i]+m_pose.m_com; n.m_x=Lerp(n.m_x,x,m_cfg.kMT); } } } /* Clear contacts */ m_rcontacts.resize(0); m_scontacts.resize(0); /* Optimize dbvt's */ m_ndbvt.optimizeIncremental(1); m_fdbvt.optimizeIncremental(1); m_cdbvt.optimizeIncremental(1); } // void btSoftBody::solveConstraints() { /* Apply clusters */ applyClusters(false); /* Prepare links */ int i,ni; for(i=0,ni=m_links.size();i<ni;++i) { Link& l=m_links[i]; l.m_c3 = l.m_n[1]->m_q-l.m_n[0]->m_q; l.m_c2 = 1/(l.m_c3.length2()*l.m_c0); } /* Prepare anchors */ for(i=0,ni=m_anchors.size();i<ni;++i) { Anchor& a=m_anchors[i]; const btVector3 ra=a.m_body->getWorldTransform().getBasis()*a.m_local; a.m_c0 = ImpulseMatrix( m_sst.sdt, a.m_node->m_im, a.m_body->getInvMass(), a.m_body->getInvInertiaTensorWorld(), ra); a.m_c1 = ra; a.m_c2 = m_sst.sdt*a.m_node->m_im; a.m_body->activate(); } /* Solve velocities */ if(m_cfg.viterations>0) { /* Solve */ for(int isolve=0;isolve<m_cfg.viterations;++isolve) { for(int iseq=0;iseq<m_cfg.m_vsequence.size();++iseq) { getSolver(m_cfg.m_vsequence[iseq])(this,1); } } /* Update */ for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_x = n.m_q+n.m_v*m_sst.sdt; } } /* Solve positions */ if(m_cfg.piterations>0) { for(int isolve=0;isolve<m_cfg.piterations;++isolve) { const btScalar ti=isolve/(btScalar)m_cfg.piterations; for(int iseq=0;iseq<m_cfg.m_psequence.size();++iseq) { getSolver(m_cfg.m_psequence[iseq])(this,1,ti); } } const btScalar vc=m_sst.isdt*(1-m_cfg.kDP); for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_v = (n.m_x-n.m_q)*vc; n.m_f = btVector3(0,0,0); } } /* Solve drift */ if(m_cfg.diterations>0) { const btScalar vcf=m_cfg.kVCF*m_sst.isdt; for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_q = n.m_x; } for(int idrift=0;idrift<m_cfg.diterations;++idrift) { for(int iseq=0;iseq<m_cfg.m_dsequence.size();++iseq) { getSolver(m_cfg.m_dsequence[iseq])(this,1,0); } } for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_v += (n.m_x-n.m_q)*vcf; } } /* Apply clusters */ dampClusters(); applyClusters(true); } // void btSoftBody::staticSolve(int iterations) { for(int isolve=0;isolve<iterations;++isolve) { for(int iseq=0;iseq<m_cfg.m_psequence.size();++iseq) { getSolver(m_cfg.m_psequence[iseq])(this,1,0); } } } // void btSoftBody::solveCommonConstraints(btSoftBody** /*bodies*/,int /*count*/,int /*iterations*/) { /// placeholder } // void btSoftBody::solveClusters(const btAlignedObjectArray<btSoftBody*>& bodies) { const int nb=bodies.size(); int iterations=0; int i; for(i=0;i<nb;++i) { iterations=btMax(iterations,bodies[i]->m_cfg.citerations); } for(i=0;i<nb;++i) { bodies[i]->prepareClusters(iterations); } for(i=0;i<iterations;++i) { const btScalar sor=1; for(int j=0;j<nb;++j) { bodies[j]->solveClusters(sor); } } for(i=0;i<nb;++i) { bodies[i]->cleanupClusters(); } } // void btSoftBody::integrateMotion() { /* Update */ updateNormals(); } // btSoftBody::RayFromToCaster::RayFromToCaster(const btVector3& rayFrom,const btVector3& rayTo,btScalar mxt) { m_rayFrom = rayFrom; m_rayNormalizedDirection = (rayTo-rayFrom); m_rayTo = rayTo; m_mint = mxt; m_face = 0; m_tests = 0; } // void btSoftBody::RayFromToCaster::Process(const btDbvtNode* leaf) { btSoftBody::Face& f=*(btSoftBody::Face*)leaf->data; const btScalar t=rayFromToTriangle( m_rayFrom,m_rayTo,m_rayNormalizedDirection, f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x, m_mint); if((t>0)&&(t<m_mint)) { m_mint=t;m_face=&f; } ++m_tests; } // btScalar btSoftBody::RayFromToCaster::rayFromToTriangle( const btVector3& rayFrom, const btVector3& rayTo, const btVector3& rayNormalizedDirection, const btVector3& a, const btVector3& b, const btVector3& c, btScalar maxt) { static const btScalar ceps=-SIMD_EPSILON*10; static const btScalar teps=SIMD_EPSILON*10; const btVector3 n=btCross(b-a,c-a); const btScalar d=btDot(a,n); const btScalar den=btDot(rayNormalizedDirection,n); if(!btFuzzyZero(den)) { const btScalar num=btDot(rayFrom,n)-d; const btScalar t=-num/den; if((t>teps)&&(t<maxt)) { const btVector3 hit=rayFrom+rayNormalizedDirection*t; if( (btDot(n,btCross(a-hit,b-hit))>ceps) && (btDot(n,btCross(b-hit,c-hit))>ceps) && (btDot(n,btCross(c-hit,a-hit))>ceps)) { return(t); } } } return(-1); } // void btSoftBody::pointersToIndices() { #define PTR2IDX(_p_,_b_) reinterpret_cast<btSoftBody::Node*>((_p_)-(_b_)) btSoftBody::Node* base=m_nodes.size() ? &m_nodes[0] : 0; int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { if(m_nodes[i].m_leaf) { m_nodes[i].m_leaf->data=*(void**)&i; } } for(i=0,ni=m_links.size();i<ni;++i) { m_links[i].m_n[0]=PTR2IDX(m_links[i].m_n[0],base); m_links[i].m_n[1]=PTR2IDX(m_links[i].m_n[1],base); } for(i=0,ni=m_faces.size();i<ni;++i) { m_faces[i].m_n[0]=PTR2IDX(m_faces[i].m_n[0],base); m_faces[i].m_n[1]=PTR2IDX(m_faces[i].m_n[1],base); m_faces[i].m_n[2]=PTR2IDX(m_faces[i].m_n[2],base); if(m_faces[i].m_leaf) { m_faces[i].m_leaf->data=*(void**)&i; } } for(i=0,ni=m_anchors.size();i<ni;++i) { m_anchors[i].m_node=PTR2IDX(m_anchors[i].m_node,base); } for(i=0,ni=m_notes.size();i<ni;++i) { for(int j=0;j<m_notes[i].m_rank;++j) { m_notes[i].m_nodes[j]=PTR2IDX(m_notes[i].m_nodes[j],base); } } #undef PTR2IDX } // void btSoftBody::indicesToPointers(const int* map) { #define IDX2PTR(_p_,_b_) map?(&(_b_)[map[(((char*)_p_)-(char*)0)]]): \ (&(_b_)[(((char*)_p_)-(char*)0)]) btSoftBody::Node* base=m_nodes.size() ? &m_nodes[0]:0; int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { if(m_nodes[i].m_leaf) { m_nodes[i].m_leaf->data=&m_nodes[i]; } } for(i=0,ni=m_links.size();i<ni;++i) { m_links[i].m_n[0]=IDX2PTR(m_links[i].m_n[0],base); m_links[i].m_n[1]=IDX2PTR(m_links[i].m_n[1],base); } for(i=0,ni=m_faces.size();i<ni;++i) { m_faces[i].m_n[0]=IDX2PTR(m_faces[i].m_n[0],base); m_faces[i].m_n[1]=IDX2PTR(m_faces[i].m_n[1],base); m_faces[i].m_n[2]=IDX2PTR(m_faces[i].m_n[2],base); if(m_faces[i].m_leaf) { m_faces[i].m_leaf->data=&m_faces[i]; } } for(i=0,ni=m_anchors.size();i<ni;++i) { m_anchors[i].m_node=IDX2PTR(m_anchors[i].m_node,base); } for(i=0,ni=m_notes.size();i<ni;++i) { for(int j=0;j<m_notes[i].m_rank;++j) { m_notes[i].m_nodes[j]=IDX2PTR(m_notes[i].m_nodes[j],base); } } #undef IDX2PTR } // int btSoftBody::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btScalar& mint,eFeature::_& feature,int& index,bool bcountonly) const { int cnt=0; btVector3 dir = rayTo-rayFrom; if(bcountonly||m_fdbvt.empty()) {/* Full search */ for(int i=0,ni=m_faces.size();i<ni;++i) { const btSoftBody::Face& f=m_faces[i]; const btScalar t=RayFromToCaster::rayFromToTriangle( rayFrom,rayTo,dir, f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x, mint); if(t>0) { ++cnt; if(!bcountonly) { feature=btSoftBody::eFeature::Face; index=i; mint=t; } } } } else {/* Use dbvt */ RayFromToCaster collider(rayFrom,rayTo,mint); btDbvt::rayTest(m_fdbvt.m_root,rayFrom,rayTo,collider); if(collider.m_face) { mint=collider.m_mint; feature=btSoftBody::eFeature::Face; index=(int)(collider.m_face-&m_faces[0]); cnt=1; } } for (int i=0;i<m_tetras.size();i++) { const btSoftBody::Tetra& tet = m_tetras[i]; int tetfaces[4][3] = {{0,1,2},{0,1,3},{1,2,3},{0,2,3}}; for (int f=0;f<4;f++) { int index0=tetfaces[f][0]; int index1=tetfaces[f][1]; int index2=tetfaces[f][2]; btVector3 v0=tet.m_n[index0]->m_x; btVector3 v1=tet.m_n[index1]->m_x; btVector3 v2=tet.m_n[index2]->m_x; const btScalar t=RayFromToCaster::rayFromToTriangle( rayFrom,rayTo,dir, v0,v1,v2, mint); if(t>0) { ++cnt; if(!bcountonly) { feature=btSoftBody::eFeature::Tetra; index=i; mint=t; } } } } return(cnt); } // void btSoftBody::initializeFaceTree() { m_fdbvt.clear(); for(int i=0;i<m_faces.size();++i) { Face& f=m_faces[i]; f.m_leaf=m_fdbvt.insert(VolumeOf(f,0),&f); } } // btVector3 btSoftBody::evaluateCom() const { btVector3 com(0,0,0); if(m_pose.m_bframe) { for(int i=0,ni=m_nodes.size();i<ni;++i) { com+=m_nodes[i].m_x*m_pose.m_wgh[i]; } } return(com); } // bool btSoftBody::checkContact( const btCollisionObjectWrapper* colObjWrap, const btVector3& x, btScalar margin, btSoftBody::sCti& cti) const { btVector3 nrm; const btCollisionShape *shp = colObjWrap->getCollisionShape(); // const btRigidBody *tmpRigid = btRigidBody::upcast(colObjWrap->getCollisionObject()); //const btTransform &wtr = tmpRigid ? tmpRigid->getWorldTransform() : colObjWrap->getWorldTransform(); const btTransform &wtr = colObjWrap->getWorldTransform(); //todo: check which transform is needed here btScalar dst = m_worldInfo->m_sparsesdf.Evaluate( wtr.invXform(x), shp, nrm, margin); if(dst<0) { cti.m_colObj = colObjWrap->getCollisionObject(); cti.m_normal = wtr.getBasis()*nrm; cti.m_offset = -btDot( cti.m_normal, x - cti.m_normal * dst ); return(true); } return(false); } // void btSoftBody::updateNormals() { const btVector3 zv(0,0,0); int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_n=zv; } for(i=0,ni=m_faces.size();i<ni;++i) { btSoftBody::Face& f=m_faces[i]; const btVector3 n=btCross(f.m_n[1]->m_x-f.m_n[0]->m_x, f.m_n[2]->m_x-f.m_n[0]->m_x); f.m_normal=n.normalized(); f.m_n[0]->m_n+=n; f.m_n[1]->m_n+=n; f.m_n[2]->m_n+=n; } for(i=0,ni=m_nodes.size();i<ni;++i) { btScalar len = m_nodes[i].m_n.length(); if (len>SIMD_EPSILON) m_nodes[i].m_n /= len; } } // void btSoftBody::updateBounds() { /*if( m_acceleratedSoftBody ) { // If we have an accelerated softbody we need to obtain the bounds correctly // For now (slightly hackily) just have a very large AABB // TODO: Write get bounds kernel // If that is updating in place, atomic collisions might be low (when the cloth isn't perfectly aligned to an axis) and we could // probably do a test and exchange reasonably efficiently. m_bounds[0] = btVector3(-1000, -1000, -1000); m_bounds[1] = btVector3(1000, 1000, 1000); } else {*/ if(m_ndbvt.m_root) { const btVector3& mins=m_ndbvt.m_root->volume.Mins(); const btVector3& maxs=m_ndbvt.m_root->volume.Maxs(); const btScalar csm=getCollisionShape()->getMargin(); const btVector3 mrg=btVector3( csm, csm, csm)*1; // ??? to investigate... m_bounds[0]=mins-mrg; m_bounds[1]=maxs+mrg; if(0!=getBroadphaseHandle()) { m_worldInfo->m_broadphase->setAabb( getBroadphaseHandle(), m_bounds[0], m_bounds[1], m_worldInfo->m_dispatcher); } } else { m_bounds[0]= m_bounds[1]=btVector3(0,0,0); } //} } // void btSoftBody::updatePose() { if(m_pose.m_bframe) { btSoftBody::Pose& pose=m_pose; const btVector3 com=evaluateCom(); /* Com */ pose.m_com = com; /* Rotation */ btMatrix3x3 Apq; const btScalar eps=SIMD_EPSILON; Apq[0]=Apq[1]=Apq[2]=btVector3(0,0,0); Apq[0].setX(eps);Apq[1].setY(eps*2);Apq[2].setZ(eps*3); for(int i=0,ni=m_nodes.size();i<ni;++i) { const btVector3 a=pose.m_wgh[i]*(m_nodes[i].m_x-com); const btVector3& b=pose.m_pos[i]; Apq[0]+=a.x()*b; Apq[1]+=a.y()*b; Apq[2]+=a.z()*b; } btMatrix3x3 r,s; PolarDecompose(Apq,r,s); pose.m_rot=r; pose.m_scl=pose.m_aqq*r.transpose()*Apq; if(m_cfg.maxvolume>1) { const btScalar idet=Clamp<btScalar>( 1/pose.m_scl.determinant(), 1,m_cfg.maxvolume); pose.m_scl=Mul(pose.m_scl,idet); } } } // void btSoftBody::updateArea(bool averageArea) { int i,ni; /* Face area */ for(i=0,ni=m_faces.size();i<ni;++i) { Face& f=m_faces[i]; f.m_ra = AreaOf(f.m_n[0]->m_x,f.m_n[1]->m_x,f.m_n[2]->m_x); } /* Node area */ if (averageArea) { btAlignedObjectArray<int> counts; counts.resize(m_nodes.size(),0); for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_area = 0; } for(i=0,ni=m_faces.size();i<ni;++i) { btSoftBody::Face& f=m_faces[i]; for(int j=0;j<3;++j) { const int index=(int)(f.m_n[j]-&m_nodes[0]); counts[index]++; f.m_n[j]->m_area+=btFabs(f.m_ra); } } for(i=0,ni=m_nodes.size();i<ni;++i) { if(counts[i]>0) m_nodes[i].m_area/=(btScalar)counts[i]; else m_nodes[i].m_area=0; } } else { // initialize node area as zero for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_area=0; } for(i=0,ni=m_faces.size();i<ni;++i) { btSoftBody::Face& f=m_faces[i]; for(int j=0;j<3;++j) { f.m_n[j]->m_area += f.m_ra; } } for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_area *= 0.3333333f; } } } void btSoftBody::updateLinkConstants() { int i,ni; /* Links */ for(i=0,ni=m_links.size();i<ni;++i) { Link& l=m_links[i]; Material& m=*l.m_material; l.m_c0 = (l.m_n[0]->m_im+l.m_n[1]->m_im)/m.m_kLST; } } void btSoftBody::updateConstants() { resetLinkRestLengths(); updateLinkConstants(); updateArea(); } // void btSoftBody::initializeClusters() { int i; for( i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; c.m_imass=0; c.m_masses.resize(c.m_nodes.size()); for(int j=0;j<c.m_nodes.size();++j) { if (c.m_nodes[j]->m_im==0) { c.m_containsAnchor = true; c.m_masses[j] = BT_LARGE_FLOAT; } else { c.m_masses[j] = btScalar(1.)/c.m_nodes[j]->m_im; } c.m_imass += c.m_masses[j]; } c.m_imass = btScalar(1.)/c.m_imass; c.m_com = btSoftBody::clusterCom(&c); c.m_lv = btVector3(0,0,0); c.m_av = btVector3(0,0,0); c.m_leaf = 0; /* Inertia */ btMatrix3x3& ii=c.m_locii; ii[0]=ii[1]=ii[2]=btVector3(0,0,0); { int i,ni; for(i=0,ni=c.m_nodes.size();i<ni;++i) { const btVector3 k=c.m_nodes[i]->m_x-c.m_com; const btVector3 q=k*k; const btScalar m=c.m_masses[i]; ii[0][0] += m*(q[1]+q[2]); ii[1][1] += m*(q[0]+q[2]); ii[2][2] += m*(q[0]+q[1]); ii[0][1] -= m*k[0]*k[1]; ii[0][2] -= m*k[0]*k[2]; ii[1][2] -= m*k[1]*k[2]; } } ii[1][0]=ii[0][1]; ii[2][0]=ii[0][2]; ii[2][1]=ii[1][2]; ii = ii.inverse(); /* Frame */ c.m_framexform.setIdentity(); c.m_framexform.setOrigin(c.m_com); c.m_framerefs.resize(c.m_nodes.size()); { int i; for(i=0;i<c.m_framerefs.size();++i) { c.m_framerefs[i]=c.m_nodes[i]->m_x-c.m_com; } } } } // void btSoftBody::updateClusters() { BT_PROFILE("UpdateClusters"); int i; for(i=0;i<m_clusters.size();++i) { btSoftBody::Cluster& c=*m_clusters[i]; const int n=c.m_nodes.size(); //const btScalar invn=1/(btScalar)n; if(n) { /* Frame */ const btScalar eps=btScalar(0.0001); btMatrix3x3 m,r,s; m[0]=m[1]=m[2]=btVector3(0,0,0); m[0][0]=eps*1; m[1][1]=eps*2; m[2][2]=eps*3; c.m_com=clusterCom(&c); for(int i=0;i<c.m_nodes.size();++i) { const btVector3 a=c.m_nodes[i]->m_x-c.m_com; const btVector3& b=c.m_framerefs[i]; m[0]+=a[0]*b;m[1]+=a[1]*b;m[2]+=a[2]*b; } PolarDecompose(m,r,s); c.m_framexform.setOrigin(c.m_com); c.m_framexform.setBasis(r); /* Inertia */ #if 1/* Constant */ c.m_invwi=c.m_framexform.getBasis()*c.m_locii*c.m_framexform.getBasis().transpose(); #else #if 0/* Sphere */ const btScalar rk=(2*c.m_extents.length2())/(5*c.m_imass); const btVector3 inertia(rk,rk,rk); const btVector3 iin(btFabs(inertia[0])>SIMD_EPSILON?1/inertia[0]:0, btFabs(inertia[1])>SIMD_EPSILON?1/inertia[1]:0, btFabs(inertia[2])>SIMD_EPSILON?1/inertia[2]:0); c.m_invwi=c.m_xform.getBasis().scaled(iin)*c.m_xform.getBasis().transpose(); #else/* Actual */ c.m_invwi[0]=c.m_invwi[1]=c.m_invwi[2]=btVector3(0,0,0); for(int i=0;i<n;++i) { const btVector3 k=c.m_nodes[i]->m_x-c.m_com; const btVector3 q=k*k; const btScalar m=1/c.m_nodes[i]->m_im; c.m_invwi[0][0] += m*(q[1]+q[2]); c.m_invwi[1][1] += m*(q[0]+q[2]); c.m_invwi[2][2] += m*(q[0]+q[1]); c.m_invwi[0][1] -= m*k[0]*k[1]; c.m_invwi[0][2] -= m*k[0]*k[2]; c.m_invwi[1][2] -= m*k[1]*k[2]; } c.m_invwi[1][0]=c.m_invwi[0][1]; c.m_invwi[2][0]=c.m_invwi[0][2]; c.m_invwi[2][1]=c.m_invwi[1][2]; c.m_invwi=c.m_invwi.inverse(); #endif #endif /* Velocities */ c.m_lv=btVector3(0,0,0); c.m_av=btVector3(0,0,0); { int i; for(i=0;i<n;++i) { const btVector3 v=c.m_nodes[i]->m_v*c.m_masses[i]; c.m_lv += v; c.m_av += btCross(c.m_nodes[i]->m_x-c.m_com,v); } } c.m_lv=c.m_imass*c.m_lv*(1-c.m_ldamping); c.m_av=c.m_invwi*c.m_av*(1-c.m_adamping); c.m_vimpulses[0] = c.m_vimpulses[1] = btVector3(0,0,0); c.m_dimpulses[0] = c.m_dimpulses[1] = btVector3(0,0,0); c.m_nvimpulses = 0; c.m_ndimpulses = 0; /* Matching */ if(c.m_matching>0) { for(int j=0;j<c.m_nodes.size();++j) { Node& n=*c.m_nodes[j]; const btVector3 x=c.m_framexform*c.m_framerefs[j]; n.m_x=Lerp(n.m_x,x,c.m_matching); } } /* Dbvt */ if(c.m_collide) { btVector3 mi=c.m_nodes[0]->m_x; btVector3 mx=mi; for(int j=1;j<n;++j) { mi.setMin(c.m_nodes[j]->m_x); mx.setMax(c.m_nodes[j]->m_x); } ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds=btDbvtVolume::FromMM(mi,mx); if(c.m_leaf) m_cdbvt.update(c.m_leaf,bounds,c.m_lv*m_sst.sdt*3,m_sst.radmrg); else c.m_leaf=m_cdbvt.insert(bounds,&c); } } } } // void btSoftBody::cleanupClusters() { for(int i=0;i<m_joints.size();++i) { m_joints[i]->Terminate(m_sst.sdt); if(m_joints[i]->m_delete) { btAlignedFree(m_joints[i]); m_joints.remove(m_joints[i--]); } } } // void btSoftBody::prepareClusters(int iterations) { for(int i=0;i<m_joints.size();++i) { m_joints[i]->Prepare(m_sst.sdt,iterations); } } // void btSoftBody::solveClusters(btScalar sor) { for(int i=0,ni=m_joints.size();i<ni;++i) { m_joints[i]->Solve(m_sst.sdt,sor); } } // void btSoftBody::applyClusters(bool drift) { BT_PROFILE("ApplyClusters"); // const btScalar f0=m_sst.sdt; //const btScalar f1=f0/2; btAlignedObjectArray<btVector3> deltas; btAlignedObjectArray<btScalar> weights; deltas.resize(m_nodes.size(),btVector3(0,0,0)); weights.resize(m_nodes.size(),0); int i; if(drift) { for(i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; if(c.m_ndimpulses) { c.m_dimpulses[0]/=(btScalar)c.m_ndimpulses; c.m_dimpulses[1]/=(btScalar)c.m_ndimpulses; } } } for(i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; if(0<(drift?c.m_ndimpulses:c.m_nvimpulses)) { const btVector3 v=(drift?c.m_dimpulses[0]:c.m_vimpulses[0])*m_sst.sdt; const btVector3 w=(drift?c.m_dimpulses[1]:c.m_vimpulses[1])*m_sst.sdt; for(int j=0;j<c.m_nodes.size();++j) { const int idx=int(c.m_nodes[j]-&m_nodes[0]); const btVector3& x=c.m_nodes[j]->m_x; const btScalar q=c.m_masses[j]; deltas[idx] += (v+btCross(w,x-c.m_com))*q; weights[idx] += q; } } } for(i=0;i<deltas.size();++i) { if(weights[i]>0) { m_nodes[i].m_x+=deltas[i]/weights[i]; } } } // void btSoftBody::dampClusters() { int i; for(i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; if(c.m_ndamping>0) { for(int j=0;j<c.m_nodes.size();++j) { Node& n=*c.m_nodes[j]; if(n.m_im>0) { const btVector3 vx=c.m_lv+btCross(c.m_av,c.m_nodes[j]->m_q-c.m_com); if(vx.length2()<=n.m_v.length2()) { n.m_v += c.m_ndamping*(vx-n.m_v); } } } } } } // void btSoftBody::Joint::Prepare(btScalar dt,int) { m_bodies[0].activate(); m_bodies[1].activate(); } // void btSoftBody::LJoint::Prepare(btScalar dt,int iterations) { static const btScalar maxdrift=4; Joint::Prepare(dt,iterations); m_rpos[0] = m_bodies[0].xform()*m_refs[0]; m_rpos[1] = m_bodies[1].xform()*m_refs[1]; m_drift = Clamp(m_rpos[0]-m_rpos[1],maxdrift)*m_erp/dt; m_rpos[0] -= m_bodies[0].xform().getOrigin(); m_rpos[1] -= m_bodies[1].xform().getOrigin(); m_massmatrix = ImpulseMatrix( m_bodies[0].invMass(),m_bodies[0].invWorldInertia(),m_rpos[0], m_bodies[1].invMass(),m_bodies[1].invWorldInertia(),m_rpos[1]); if(m_split>0) { m_sdrift = m_massmatrix*(m_drift*m_split); m_drift *= 1-m_split; } m_drift /=(btScalar)iterations; } // void btSoftBody::LJoint::Solve(btScalar dt,btScalar sor) { const btVector3 va=m_bodies[0].velocity(m_rpos[0]); const btVector3 vb=m_bodies[1].velocity(m_rpos[1]); const btVector3 vr=va-vb; btSoftBody::Impulse impulse; impulse.m_asVelocity = 1; impulse.m_velocity = m_massmatrix*(m_drift+vr*m_cfm)*sor; m_bodies[0].applyImpulse(-impulse,m_rpos[0]); m_bodies[1].applyImpulse( impulse,m_rpos[1]); } // void btSoftBody::LJoint::Terminate(btScalar dt) { if(m_split>0) { m_bodies[0].applyDImpulse(-m_sdrift,m_rpos[0]); m_bodies[1].applyDImpulse( m_sdrift,m_rpos[1]); } } // void btSoftBody::AJoint::Prepare(btScalar dt,int iterations) { static const btScalar maxdrift=SIMD_PI/16; m_icontrol->Prepare(this); Joint::Prepare(dt,iterations); m_axis[0] = m_bodies[0].xform().getBasis()*m_refs[0]; m_axis[1] = m_bodies[1].xform().getBasis()*m_refs[1]; m_drift = NormalizeAny(btCross(m_axis[1],m_axis[0])); m_drift *= btMin(maxdrift,btAcos(Clamp<btScalar>(btDot(m_axis[0],m_axis[1]),-1,+1))); m_drift *= m_erp/dt; m_massmatrix= AngularImpulseMatrix(m_bodies[0].invWorldInertia(),m_bodies[1].invWorldInertia()); if(m_split>0) { m_sdrift = m_massmatrix*(m_drift*m_split); m_drift *= 1-m_split; } m_drift /=(btScalar)iterations; } // void btSoftBody::AJoint::Solve(btScalar dt,btScalar sor) { const btVector3 va=m_bodies[0].angularVelocity(); const btVector3 vb=m_bodies[1].angularVelocity(); const btVector3 vr=va-vb; const btScalar sp=btDot(vr,m_axis[0]); const btVector3 vc=vr-m_axis[0]*m_icontrol->Speed(this,sp); btSoftBody::Impulse impulse; impulse.m_asVelocity = 1; impulse.m_velocity = m_massmatrix*(m_drift+vc*m_cfm)*sor; m_bodies[0].applyAImpulse(-impulse); m_bodies[1].applyAImpulse( impulse); } // void btSoftBody::AJoint::Terminate(btScalar dt) { if(m_split>0) { m_bodies[0].applyDAImpulse(-m_sdrift); m_bodies[1].applyDAImpulse( m_sdrift); } } // void btSoftBody::CJoint::Prepare(btScalar dt,int iterations) { Joint::Prepare(dt,iterations); const bool dodrift=(m_life==0); m_delete=(++m_life)>m_maxlife; if(dodrift) { m_drift=m_drift*m_erp/dt; if(m_split>0) { m_sdrift = m_massmatrix*(m_drift*m_split); m_drift *= 1-m_split; } m_drift/=(btScalar)iterations; } else { m_drift=m_sdrift=btVector3(0,0,0); } } // void btSoftBody::CJoint::Solve(btScalar dt,btScalar sor) { const btVector3 va=m_bodies[0].velocity(m_rpos[0]); const btVector3 vb=m_bodies[1].velocity(m_rpos[1]); const btVector3 vrel=va-vb; const btScalar rvac=btDot(vrel,m_normal); btSoftBody::Impulse impulse; impulse.m_asVelocity = 1; impulse.m_velocity = m_drift; if(rvac<0) { const btVector3 iv=m_normal*rvac; const btVector3 fv=vrel-iv; impulse.m_velocity += iv+fv*m_friction; } impulse.m_velocity=m_massmatrix*impulse.m_velocity*sor; if (m_bodies[0].m_soft==m_bodies[1].m_soft) { if ((impulse.m_velocity.getX() ==impulse.m_velocity.getX())&&(impulse.m_velocity.getY() ==impulse.m_velocity.getY())&& (impulse.m_velocity.getZ() ==impulse.m_velocity.getZ())) { if (impulse.m_asVelocity) { if (impulse.m_velocity.length() <m_bodies[0].m_soft->m_maxSelfCollisionImpulse) { } else { m_bodies[0].applyImpulse(-impulse*m_bodies[0].m_soft->m_selfCollisionImpulseFactor,m_rpos[0]); m_bodies[1].applyImpulse( impulse*m_bodies[0].m_soft->m_selfCollisionImpulseFactor,m_rpos[1]); } } } } else { m_bodies[0].applyImpulse(-impulse,m_rpos[0]); m_bodies[1].applyImpulse( impulse,m_rpos[1]); } } // void btSoftBody::CJoint::Terminate(btScalar dt) { if(m_split>0) { m_bodies[0].applyDImpulse(-m_sdrift,m_rpos[0]); m_bodies[1].applyDImpulse( m_sdrift,m_rpos[1]); } } // void btSoftBody::applyForces() { BT_PROFILE("SoftBody applyForces"); // const btScalar dt = m_sst.sdt; const btScalar kLF = m_cfg.kLF; const btScalar kDG = m_cfg.kDG; const btScalar kPR = m_cfg.kPR; const btScalar kVC = m_cfg.kVC; const bool as_lift = kLF>0; const bool as_drag = kDG>0; const bool as_pressure = kPR!=0; const bool as_volume = kVC>0; const bool as_aero = as_lift || as_drag ; //const bool as_vaero = as_aero && // (m_cfg.aeromodel < btSoftBody::eAeroModel::F_TwoSided); //const bool as_faero = as_aero && // (m_cfg.aeromodel >= btSoftBody::eAeroModel::F_TwoSided); const bool use_medium = as_aero; const bool use_volume = as_pressure || as_volume ; btScalar volume = 0; btScalar ivolumetp = 0; btScalar dvolumetv = 0; btSoftBody::sMedium medium; if(use_volume) { volume = getVolume(); ivolumetp = 1/btFabs(volume)*kPR; dvolumetv = (m_pose.m_volume-volume)*kVC; } /* Per vertex forces */ int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { btSoftBody::Node& n=m_nodes[i]; if(n.m_im>0) { if(use_medium) { /* Aerodynamics */ addAeroForceToNode(m_windVelocity, i); } /* Pressure */ if(as_pressure) { n.m_f += n.m_n*(n.m_area*ivolumetp); } /* Volume */ if(as_volume) { n.m_f += n.m_n*(n.m_area*dvolumetv); } } } /* Per face forces */ for(i=0,ni=m_faces.size();i<ni;++i) { // btSoftBody::Face& f=m_faces[i]; /* Aerodynamics */ addAeroForceToFace(m_windVelocity, i); } } // void btSoftBody::PSolve_Anchors(btSoftBody* psb,btScalar kst,btScalar ti) { BT_PROFILE("PSolve_Anchors"); const btScalar kAHR=psb->m_cfg.kAHR*kst; const btScalar dt=psb->m_sst.sdt; for(int i=0,ni=psb->m_anchors.size();i<ni;++i) { const Anchor& a=psb->m_anchors[i]; const btTransform& t=a.m_body->getWorldTransform(); Node& n=*a.m_node; const btVector3 wa=t*a.m_local; const btVector3 va=a.m_body->getVelocityInLocalPoint(a.m_c1)*dt; const btVector3 vb=n.m_x-n.m_q; const btVector3 vr=(va-vb)+(wa-n.m_x)*kAHR; const btVector3 impulse=a.m_c0*vr*a.m_influence; n.m_x+=impulse*a.m_c2; a.m_body->applyImpulse(-impulse,a.m_c1); } } // void btSoftBody::PSolve_RContacts(btSoftBody* psb, btScalar kst, btScalar ti) { BT_PROFILE("PSolve_RContacts"); const btScalar dt = psb->m_sst.sdt; const btScalar mrg = psb->getCollisionShape()->getMargin(); btMultiBodyJacobianData jacobianData; for(int i=0,ni=psb->m_rcontacts.size();i<ni;++i) { const RContact& c = psb->m_rcontacts[i]; const sCti& cti = c.m_cti; if (cti.m_colObj->hasContactResponse()) { btVector3 va(0,0,0); btRigidBody* rigidCol=0; btMultiBodyLinkCollider* multibodyLinkCol=0; btScalar* deltaV; if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY) { rigidCol = (btRigidBody*)btRigidBody::upcast(cti.m_colObj); va = rigidCol ? rigidCol->getVelocityInLocalPoint(c.m_c1)*dt : btVector3(0,0,0); } else if (cti.m_colObj->getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK) { multibodyLinkCol = (btMultiBodyLinkCollider*)btMultiBodyLinkCollider::upcast(cti.m_colObj); if (multibodyLinkCol) { const int ndof = multibodyLinkCol->m_multiBody->getNumDofs() + 6; jacobianData.m_jacobians.resize(ndof); jacobianData.m_deltaVelocitiesUnitImpulse.resize(ndof); btScalar* jac=&jacobianData.m_jacobians[0]; multibodyLinkCol->m_multiBody->fillContactJacobianMultiDof(multibodyLinkCol->m_link, c.m_node->m_x, cti.m_normal, jac, jacobianData.scratch_r, jacobianData.scratch_v, jacobianData.scratch_m); deltaV = &jacobianData.m_deltaVelocitiesUnitImpulse[0]; multibodyLinkCol->m_multiBody->calcAccelerationDeltasMultiDof(&jacobianData.m_jacobians[0],deltaV,jacobianData.scratch_r, jacobianData.scratch_v); btScalar vel = 0.0; for (int j = 0; j < ndof ; ++j) { vel += multibodyLinkCol->m_multiBody->getVelocityVector()[j] * jac[j]; } va = cti.m_normal*vel*dt; } } const btVector3 vb = c.m_node->m_x-c.m_node->m_q; const btVector3 vr = vb-va; const btScalar dn = btDot(vr, cti.m_normal); if(dn<=SIMD_EPSILON) { const btScalar dp = btMin( (btDot(c.m_node->m_x, cti.m_normal) + cti.m_offset), mrg ); const btVector3 fv = vr - (cti.m_normal * dn); // c0 is the impulse matrix, c3 is 1 - the friction coefficient or 0, c4 is the contact hardness coefficient const btVector3 impulse = c.m_c0 * ( (vr - (fv * c.m_c3) + (cti.m_normal * (dp * c.m_c4))) * kst ); c.m_node->m_x -= impulse * c.m_c2; if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY) { if (rigidCol) rigidCol->applyImpulse(impulse,c.m_c1); } else if (cti.m_colObj->getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK) { if (multibodyLinkCol) { double multiplier = 0.5; multibodyLinkCol->m_multiBody->applyDeltaVeeMultiDof(deltaV,-impulse.length()*multiplier); } } } } } } // void btSoftBody::PSolve_SContacts(btSoftBody* psb,btScalar,btScalar ti) { BT_PROFILE("PSolve_SContacts"); for(int i=0,ni=psb->m_scontacts.size();i<ni;++i) { const SContact& c=psb->m_scontacts[i]; const btVector3& nr=c.m_normal; Node& n=*c.m_node; Face& f=*c.m_face; const btVector3 p=BaryEval( f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x, c.m_weights); const btVector3 q=BaryEval( f.m_n[0]->m_q, f.m_n[1]->m_q, f.m_n[2]->m_q, c.m_weights); const btVector3 vr=(n.m_x-n.m_q)-(p-q); btVector3 corr(0,0,0); btScalar dot = btDot(vr,nr); if(dot<0) { const btScalar j=c.m_margin-(btDot(nr,n.m_x)-btDot(nr,p)); corr+=c.m_normal*j; } corr -= ProjectOnPlane(vr,nr)*c.m_friction; n.m_x += corr*c.m_cfm[0]; f.m_n[0]->m_x -= corr*(c.m_cfm[1]*c.m_weights.x()); f.m_n[1]->m_x -= corr*(c.m_cfm[1]*c.m_weights.y()); f.m_n[2]->m_x -= corr*(c.m_cfm[1]*c.m_weights.z()); } } // void btSoftBody::PSolve_Links(btSoftBody* psb,btScalar kst,btScalar ti) { BT_PROFILE("PSolve_Links"); for(int i=0,ni=psb->m_links.size();i<ni;++i) { Link& l=psb->m_links[i]; if(l.m_c0>0) { Node& a=*l.m_n[0]; Node& b=*l.m_n[1]; const btVector3 del=b.m_x-a.m_x; const btScalar len=del.length2(); if (l.m_c1+len > SIMD_EPSILON) { const btScalar k=((l.m_c1-len)/(l.m_c0*(l.m_c1+len)))*kst; a.m_x-=del*(k*a.m_im); b.m_x+=del*(k*b.m_im); } } } } // void btSoftBody::VSolve_Links(btSoftBody* psb,btScalar kst) { BT_PROFILE("VSolve_Links"); for(int i=0,ni=psb->m_links.size();i<ni;++i) { Link& l=psb->m_links[i]; Node** n=l.m_n; const btScalar j=-btDot(l.m_c3,n[0]->m_v-n[1]->m_v)*l.m_c2*kst; n[0]->m_v+= l.m_c3*(j*n[0]->m_im); n[1]->m_v-= l.m_c3*(j*n[1]->m_im); } } // btSoftBody::psolver_t btSoftBody::getSolver(ePSolver::_ solver) { switch(solver) { case ePSolver::Anchors: return(&btSoftBody::PSolve_Anchors); case ePSolver::Linear: return(&btSoftBody::PSolve_Links); case ePSolver::RContacts: return(&btSoftBody::PSolve_RContacts); case ePSolver::SContacts: return(&btSoftBody::PSolve_SContacts); default: { } } return(0); } // btSoftBody::vsolver_t btSoftBody::getSolver(eVSolver::_ solver) { switch(solver) { case eVSolver::Linear: return(&btSoftBody::VSolve_Links); default: { } } return(0); } // void btSoftBody::defaultCollisionHandler(const btCollisionObjectWrapper* pcoWrap) { switch(m_cfg.collisions&fCollision::RVSmask) { case fCollision::SDF_RS: { btSoftColliders::CollideSDF_RS docollide; btRigidBody* prb1=(btRigidBody*) btRigidBody::upcast(pcoWrap->getCollisionObject()); btTransform wtr=pcoWrap->getWorldTransform(); const btTransform ctr=pcoWrap->getWorldTransform(); const btScalar timemargin=(wtr.getOrigin()-ctr.getOrigin()).length(); const btScalar basemargin=getCollisionShape()->getMargin(); btVector3 mins; btVector3 maxs; ATTRIBUTE_ALIGNED16(btDbvtVolume) volume; pcoWrap->getCollisionShape()->getAabb( pcoWrap->getWorldTransform(), mins, maxs); volume=btDbvtVolume::FromMM(mins,maxs); volume.Expand(btVector3(basemargin,basemargin,basemargin)); docollide.psb = this; docollide.m_colObj1Wrap = pcoWrap; docollide.m_rigidBody = prb1; docollide.dynmargin = basemargin+timemargin; docollide.stamargin = basemargin; m_ndbvt.collideTV(m_ndbvt.m_root,volume,docollide); } break; case fCollision::CL_RS: { btSoftColliders::CollideCL_RS collider; collider.ProcessColObj(this,pcoWrap); } break; } } // void btSoftBody::defaultCollisionHandler(btSoftBody* psb) { const int cf=m_cfg.collisions&psb->m_cfg.collisions; switch(cf&fCollision::SVSmask) { case fCollision::CL_SS: { //support self-collision if CL_SELF flag set if (this!=psb || psb->m_cfg.collisions&fCollision::CL_SELF) { btSoftColliders::CollideCL_SS docollide; docollide.ProcessSoftSoft(this,psb); } } break; case fCollision::VF_SS: { //only self-collision for Cluster, not Vertex-Face yet if (this!=psb) { btSoftColliders::CollideVF_SS docollide; /* common */ docollide.mrg= getCollisionShape()->getMargin()+ psb->getCollisionShape()->getMargin(); /* psb0 nodes vs psb1 faces */ docollide.psb[0]=this; docollide.psb[1]=psb; docollide.psb[0]->m_ndbvt.collideTT( docollide.psb[0]->m_ndbvt.m_root, docollide.psb[1]->m_fdbvt.m_root, docollide); /* psb1 nodes vs psb0 faces */ docollide.psb[0]=psb; docollide.psb[1]=this; docollide.psb[0]->m_ndbvt.collideTT( docollide.psb[0]->m_ndbvt.m_root, docollide.psb[1]->m_fdbvt.m_root, docollide); } } break; default: { } } } void btSoftBody::setWindVelocity( const btVector3 &velocity ) { m_windVelocity = velocity; } const btVector3& btSoftBody::getWindVelocity() { return m_windVelocity; } int btSoftBody::calculateSerializeBufferSize() const { int sz = sizeof(btSoftBodyData); return sz; } ///fills the dataBuffer and returns the struct name (and 0 on failure) const char* btSoftBody::serialize(void* dataBuffer, class btSerializer* serializer) const { btSoftBodyData* sbd = (btSoftBodyData*) dataBuffer; btCollisionObject::serialize(&sbd->m_collisionObjectData, serializer); btHashMap<btHashPtr,int> m_nodeIndexMap; sbd->m_numMaterials = m_materials.size(); sbd->m_materials = sbd->m_numMaterials? (SoftBodyMaterialData**) serializer->getUniquePointer((void*)&m_materials): 0; if (sbd->m_materials) { int sz = sizeof(SoftBodyMaterialData*); int numElem = sbd->m_numMaterials; btChunk* chunk = serializer->allocate(sz,numElem); //SoftBodyMaterialData** memPtr = chunk->m_oldPtr; SoftBodyMaterialData** memPtr = (SoftBodyMaterialData**)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { btSoftBody::Material* mat = m_materials[i]; *memPtr = mat ? (SoftBodyMaterialData*)serializer->getUniquePointer((void*)mat) : 0; if (!serializer->findPointer(mat)) { //serialize it here btChunk* chunk = serializer->allocate(sizeof(SoftBodyMaterialData),1); SoftBodyMaterialData* memPtr = (SoftBodyMaterialData*)chunk->m_oldPtr; memPtr->m_flags = mat->m_flags; memPtr->m_angularStiffness = mat->m_kAST; memPtr->m_linearStiffness = mat->m_kLST; memPtr->m_volumeStiffness = mat->m_kVST; serializer->finalizeChunk(chunk,"SoftBodyMaterialData",BT_SBMATERIAL_CODE,mat); } } serializer->finalizeChunk(chunk,"SoftBodyMaterialData",BT_ARRAY_CODE,(void*) &m_materials); } sbd->m_numNodes = m_nodes.size(); sbd->m_nodes = sbd->m_numNodes ? (SoftBodyNodeData*)serializer->getUniquePointer((void*)&m_nodes): 0; if (sbd->m_nodes) { int sz = sizeof(SoftBodyNodeData); int numElem = sbd->m_numNodes; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyNodeData* memPtr = (SoftBodyNodeData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { m_nodes[i].m_f.serializeFloat( memPtr->m_accumulatedForce); memPtr->m_area = m_nodes[i].m_area; memPtr->m_attach = m_nodes[i].m_battach; memPtr->m_inverseMass = m_nodes[i].m_im; memPtr->m_material = m_nodes[i].m_material? (SoftBodyMaterialData*)serializer->getUniquePointer((void*) m_nodes[i].m_material):0; m_nodes[i].m_n.serializeFloat(memPtr->m_normal); m_nodes[i].m_x.serializeFloat(memPtr->m_position); m_nodes[i].m_q.serializeFloat(memPtr->m_previousPosition); m_nodes[i].m_v.serializeFloat(memPtr->m_velocity); m_nodeIndexMap.insert(&m_nodes[i],i); } serializer->finalizeChunk(chunk,"SoftBodyNodeData",BT_SBNODE_CODE,(void*) &m_nodes); } sbd->m_numLinks = m_links.size(); sbd->m_links = sbd->m_numLinks? (SoftBodyLinkData*) serializer->getUniquePointer((void*)&m_links[0]):0; if (sbd->m_links) { int sz = sizeof(SoftBodyLinkData); int numElem = sbd->m_numLinks; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyLinkData* memPtr = (SoftBodyLinkData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_bbending = m_links[i].m_bbending; memPtr->m_material = m_links[i].m_material? (SoftBodyMaterialData*)serializer->getUniquePointer((void*) m_links[i].m_material):0; memPtr->m_nodeIndices[0] = m_links[i].m_n[0] ? m_links[i].m_n[0] - &m_nodes[0]: -1; memPtr->m_nodeIndices[1] = m_links[i].m_n[1] ? m_links[i].m_n[1] - &m_nodes[0]: -1; btAssert(memPtr->m_nodeIndices[0]<m_nodes.size()); btAssert(memPtr->m_nodeIndices[1]<m_nodes.size()); memPtr->m_restLength = m_links[i].m_rl; } serializer->finalizeChunk(chunk,"SoftBodyLinkData",BT_ARRAY_CODE,(void*) &m_links[0]); } sbd->m_numFaces = m_faces.size(); sbd->m_faces = sbd->m_numFaces? (SoftBodyFaceData*) serializer->getUniquePointer((void*)&m_faces[0]):0; if (sbd->m_faces) { int sz = sizeof(SoftBodyFaceData); int numElem = sbd->m_numFaces; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyFaceData* memPtr = (SoftBodyFaceData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_material = m_faces[i].m_material ? (SoftBodyMaterialData*) serializer->getUniquePointer((void*)m_faces[i].m_material): 0; m_faces[i].m_normal.serializeFloat( memPtr->m_normal); for (int j=0;j<3;j++) { memPtr->m_nodeIndices[j] = m_faces[i].m_n[j]? m_faces[i].m_n[j] - &m_nodes[0]: -1; } memPtr->m_restArea = m_faces[i].m_ra; } serializer->finalizeChunk(chunk,"SoftBodyFaceData",BT_ARRAY_CODE,(void*) &m_faces[0]); } sbd->m_numTetrahedra = m_tetras.size(); sbd->m_tetrahedra = sbd->m_numTetrahedra ? (SoftBodyTetraData*) serializer->getUniquePointer((void*)&m_tetras[0]):0; if (sbd->m_tetrahedra) { int sz = sizeof(SoftBodyTetraData); int numElem = sbd->m_numTetrahedra; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyTetraData* memPtr = (SoftBodyTetraData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { for (int j=0;j<4;j++) { m_tetras[i].m_c0[j].serializeFloat( memPtr->m_c0[j] ); memPtr->m_nodeIndices[j] = m_tetras[j].m_n[j]? m_tetras[j].m_n[j]-&m_nodes[0] : -1; } memPtr->m_c1 = m_tetras[i].m_c1; memPtr->m_c2 = m_tetras[i].m_c2; memPtr->m_material = m_tetras[i].m_material ? (SoftBodyMaterialData*)serializer->getUniquePointer((void*) m_tetras[i].m_material): 0; memPtr->m_restVolume = m_tetras[i].m_rv; } serializer->finalizeChunk(chunk,"SoftBodyTetraData",BT_ARRAY_CODE,(void*) &m_tetras[0]); } sbd->m_numAnchors = m_anchors.size(); sbd->m_anchors = sbd->m_numAnchors ? (SoftRigidAnchorData*) serializer->getUniquePointer((void*)&m_anchors[0]):0; if (sbd->m_anchors) { int sz = sizeof(SoftRigidAnchorData); int numElem = sbd->m_numAnchors; btChunk* chunk = serializer->allocate(sz,numElem); SoftRigidAnchorData* memPtr = (SoftRigidAnchorData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { m_anchors[i].m_c0.serializeFloat(memPtr->m_c0); m_anchors[i].m_c1.serializeFloat(memPtr->m_c1); memPtr->m_c2 = m_anchors[i].m_c2; m_anchors[i].m_local.serializeFloat(memPtr->m_localFrame); memPtr->m_nodeIndex = m_anchors[i].m_node? m_anchors[i].m_node-&m_nodes[0]: -1; memPtr->m_rigidBody = m_anchors[i].m_body? (btRigidBodyData*) serializer->getUniquePointer((void*)m_anchors[i].m_body): 0; btAssert(memPtr->m_nodeIndex < m_nodes.size()); } serializer->finalizeChunk(chunk,"SoftRigidAnchorData",BT_ARRAY_CODE,(void*) &m_anchors[0]); } sbd->m_config.m_dynamicFriction = m_cfg.kDF; sbd->m_config.m_baumgarte = m_cfg.kVCF; sbd->m_config.m_pressure = m_cfg.kPR; sbd->m_config.m_aeroModel = this->m_cfg.aeromodel; sbd->m_config.m_lift = m_cfg.kLF; sbd->m_config.m_drag = m_cfg.kDG; sbd->m_config.m_positionIterations = m_cfg.piterations; sbd->m_config.m_driftIterations = m_cfg.diterations; sbd->m_config.m_clusterIterations = m_cfg.citerations; sbd->m_config.m_velocityIterations = m_cfg.viterations; sbd->m_config.m_maxVolume = m_cfg.maxvolume; sbd->m_config.m_damping = m_cfg.kDP; sbd->m_config.m_poseMatch = m_cfg.kMT; sbd->m_config.m_collisionFlags = m_cfg.collisions; sbd->m_config.m_volume = m_cfg.kVC; sbd->m_config.m_rigidContactHardness = m_cfg.kCHR; sbd->m_config.m_kineticContactHardness = m_cfg.kKHR; sbd->m_config.m_softContactHardness = m_cfg.kSHR; sbd->m_config.m_anchorHardness = m_cfg.kAHR; sbd->m_config.m_timeScale = m_cfg.timescale; sbd->m_config.m_maxVolume = m_cfg.maxvolume; sbd->m_config.m_softRigidClusterHardness = m_cfg.kSRHR_CL; sbd->m_config.m_softKineticClusterHardness = m_cfg.kSKHR_CL; sbd->m_config.m_softSoftClusterHardness = m_cfg.kSSHR_CL; sbd->m_config.m_softRigidClusterImpulseSplit = m_cfg.kSR_SPLT_CL; sbd->m_config.m_softKineticClusterImpulseSplit = m_cfg.kSK_SPLT_CL; sbd->m_config.m_softSoftClusterImpulseSplit = m_cfg.kSS_SPLT_CL; //pose for shape matching { sbd->m_pose = (SoftBodyPoseData*)serializer->getUniquePointer((void*)&m_pose); int sz = sizeof(SoftBodyPoseData); btChunk* chunk = serializer->allocate(sz,1); SoftBodyPoseData* memPtr = (SoftBodyPoseData*)chunk->m_oldPtr; m_pose.m_aqq.serializeFloat(memPtr->m_aqq); memPtr->m_bframe = m_pose.m_bframe; memPtr->m_bvolume = m_pose.m_bvolume; m_pose.m_com.serializeFloat(memPtr->m_com); memPtr->m_numPositions = m_pose.m_pos.size(); memPtr->m_positions = memPtr->m_numPositions ? (btVector3FloatData*)serializer->getUniquePointer((void*)&m_pose.m_pos[0]): 0; if (memPtr->m_numPositions) { int numElem = memPtr->m_numPositions; int sz = sizeof(btVector3Data); btChunk* chunk = serializer->allocate(sz,numElem); btVector3FloatData* memPtr = (btVector3FloatData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { m_pose.m_pos[i].serializeFloat(*memPtr); } serializer->finalizeChunk(chunk,"btVector3FloatData",BT_ARRAY_CODE,(void*)&m_pose.m_pos[0]); } memPtr->m_restVolume = m_pose.m_volume; m_pose.m_rot.serializeFloat(memPtr->m_rot); m_pose.m_scl.serializeFloat(memPtr->m_scale); memPtr->m_numWeigts = m_pose.m_wgh.size(); memPtr->m_weights = memPtr->m_numWeigts? (float*) serializer->getUniquePointer((void*) &m_pose.m_wgh[0]) : 0; if (memPtr->m_numWeigts) { int numElem = memPtr->m_numWeigts; int sz = sizeof(float); btChunk* chunk = serializer->allocate(sz,numElem); float* memPtr = (float*) chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { *memPtr = m_pose.m_wgh[i]; } serializer->finalizeChunk(chunk,"float",BT_ARRAY_CODE,(void*)&m_pose.m_wgh[0]); } serializer->finalizeChunk(chunk,"SoftBodyPoseData",BT_ARRAY_CODE,(void*)&m_pose); } //clusters for convex-cluster collision detection sbd->m_numClusters = m_clusters.size(); sbd->m_clusters = sbd->m_numClusters? (SoftBodyClusterData*) serializer->getUniquePointer((void*)m_clusters[0]) : 0; if (sbd->m_numClusters) { int numElem = sbd->m_numClusters; int sz = sizeof(SoftBodyClusterData); btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyClusterData* memPtr = (SoftBodyClusterData*) chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_adamping= m_clusters[i]->m_adamping; m_clusters[i]->m_av.serializeFloat(memPtr->m_av); memPtr->m_clusterIndex = m_clusters[i]->m_clusterIndex; memPtr->m_collide = m_clusters[i]->m_collide; m_clusters[i]->m_com.serializeFloat(memPtr->m_com); memPtr->m_containsAnchor = m_clusters[i]->m_containsAnchor; m_clusters[i]->m_dimpulses[0].serializeFloat(memPtr->m_dimpulses[0]); m_clusters[i]->m_dimpulses[1].serializeFloat(memPtr->m_dimpulses[1]); m_clusters[i]->m_framexform.serializeFloat(memPtr->m_framexform); memPtr->m_idmass = m_clusters[i]->m_idmass; memPtr->m_imass = m_clusters[i]->m_imass; m_clusters[i]->m_invwi.serializeFloat(memPtr->m_invwi); memPtr->m_ldamping = m_clusters[i]->m_ldamping; m_clusters[i]->m_locii.serializeFloat(memPtr->m_locii); m_clusters[i]->m_lv.serializeFloat(memPtr->m_lv); memPtr->m_matching = m_clusters[i]->m_matching; memPtr->m_maxSelfCollisionImpulse = m_clusters[i]->m_maxSelfCollisionImpulse; memPtr->m_ndamping = m_clusters[i]->m_ndamping; memPtr->m_ldamping = m_clusters[i]->m_ldamping; memPtr->m_adamping = m_clusters[i]->m_adamping; memPtr->m_selfCollisionImpulseFactor = m_clusters[i]->m_selfCollisionImpulseFactor; memPtr->m_numFrameRefs = m_clusters[i]->m_framerefs.size(); memPtr->m_numMasses = m_clusters[i]->m_masses.size(); memPtr->m_numNodes = m_clusters[i]->m_nodes.size(); memPtr->m_nvimpulses = m_clusters[i]->m_nvimpulses; m_clusters[i]->m_vimpulses[0].serializeFloat(memPtr->m_vimpulses[0]); m_clusters[i]->m_vimpulses[1].serializeFloat(memPtr->m_vimpulses[1]); memPtr->m_ndimpulses = m_clusters[i]->m_ndimpulses; memPtr->m_framerefs = memPtr->m_numFrameRefs? (btVector3FloatData*)serializer->getUniquePointer((void*)&m_clusters[i]->m_framerefs[0]) : 0; if (memPtr->m_framerefs) { int numElem = memPtr->m_numFrameRefs; int sz = sizeof(btVector3FloatData); btChunk* chunk = serializer->allocate(sz,numElem); btVector3FloatData* memPtr = (btVector3FloatData*) chunk->m_oldPtr; for (int j=0;j<numElem;j++,memPtr++) { m_clusters[i]->m_framerefs[j].serializeFloat(*memPtr); } serializer->finalizeChunk(chunk,"btVector3FloatData",BT_ARRAY_CODE,(void*)&m_clusters[i]->m_framerefs[0]); } memPtr->m_masses = memPtr->m_numMasses ? (float*) serializer->getUniquePointer((void*)&m_clusters[i]->m_masses[0]): 0; if (memPtr->m_masses) { int numElem = memPtr->m_numMasses; int sz = sizeof(float); btChunk* chunk = serializer->allocate(sz,numElem); float* memPtr = (float*) chunk->m_oldPtr; for (int j=0;j<numElem;j++,memPtr++) { *memPtr = m_clusters[i]->m_masses[j]; } serializer->finalizeChunk(chunk,"float",BT_ARRAY_CODE,(void*)&m_clusters[i]->m_masses[0]); } memPtr->m_nodeIndices = memPtr->m_numNodes ? (int*) serializer->getUniquePointer((void*) &m_clusters[i]->m_nodes) : 0; if (memPtr->m_nodeIndices ) { int numElem = memPtr->m_numMasses; int sz = sizeof(int); btChunk* chunk = serializer->allocate(sz,numElem); int* memPtr = (int*) chunk->m_oldPtr; for (int j=0;j<numElem;j++,memPtr++) { int* indexPtr = m_nodeIndexMap.find(m_clusters[i]->m_nodes[j]); btAssert(indexPtr); *memPtr = *indexPtr; } serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*)&m_clusters[i]->m_nodes); } } serializer->finalizeChunk(chunk,"SoftBodyClusterData",BT_ARRAY_CODE,(void*)m_clusters[0]); } sbd->m_numJoints = m_joints.size(); sbd->m_joints = m_joints.size()? (btSoftBodyJointData*) serializer->getUniquePointer((void*)&m_joints[0]) : 0; if (sbd->m_joints) { int sz = sizeof(btSoftBodyJointData); int numElem = m_joints.size(); btChunk* chunk = serializer->allocate(sz,numElem); btSoftBodyJointData* memPtr = (btSoftBodyJointData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_jointType = (int)m_joints[i]->Type(); m_joints[i]->m_refs[0].serializeFloat(memPtr->m_refs[0]); m_joints[i]->m_refs[1].serializeFloat(memPtr->m_refs[1]); memPtr->m_cfm = m_joints[i]->m_cfm; memPtr->m_erp = float(m_joints[i]->m_erp); memPtr->m_split = float(m_joints[i]->m_split); memPtr->m_delete = m_joints[i]->m_delete; for (int j=0;j<4;j++) { memPtr->m_relPosition[0].m_floats[j] = 0.f; memPtr->m_relPosition[1].m_floats[j] = 0.f; } memPtr->m_bodyA = 0; memPtr->m_bodyB = 0; if (m_joints[i]->m_bodies[0].m_soft) { memPtr->m_bodyAtype = BT_JOINT_SOFT_BODY_CLUSTER; memPtr->m_bodyA = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[0].m_soft); } if (m_joints[i]->m_bodies[0].m_collisionObject) { memPtr->m_bodyAtype = BT_JOINT_COLLISION_OBJECT; memPtr->m_bodyA = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[0].m_collisionObject); } if (m_joints[i]->m_bodies[0].m_rigid) { memPtr->m_bodyAtype = BT_JOINT_RIGID_BODY; memPtr->m_bodyA = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[0].m_rigid); } if (m_joints[i]->m_bodies[1].m_soft) { memPtr->m_bodyBtype = BT_JOINT_SOFT_BODY_CLUSTER; memPtr->m_bodyB = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[1].m_soft); } if (m_joints[i]->m_bodies[1].m_collisionObject) { memPtr->m_bodyBtype = BT_JOINT_COLLISION_OBJECT; memPtr->m_bodyB = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[1].m_collisionObject); } if (m_joints[i]->m_bodies[1].m_rigid) { memPtr->m_bodyBtype = BT_JOINT_RIGID_BODY; memPtr->m_bodyB = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[1].m_rigid); } } serializer->finalizeChunk(chunk,"btSoftBodyJointData",BT_ARRAY_CODE,(void*) &m_joints[0]); } return btSoftBodyDataName; }
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ ///btSoftBody implementation by Nathanael Presson #include "btSoftBodyInternals.h" #include "BulletSoftBody/btSoftBodySolvers.h" #include "btSoftBodyData.h" #include "LinearMath/btSerializer.h" #include "BulletDynamics/Featherstone/btMultiBodyLinkCollider.h" #include "BulletDynamics/Featherstone/btMultiBodyConstraint.h" // btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo,int node_count, const btVector3* x, const btScalar* m) :m_softBodySolver(0),m_worldInfo(worldInfo) { /* Init */ initDefaults(); /* Default material */ Material* pm=appendMaterial(); pm->m_kLST = 1; pm->m_kAST = 1; pm->m_kVST = 1; pm->m_flags = fMaterial::Default; /* Nodes */ const btScalar margin=getCollisionShape()->getMargin(); m_nodes.resize(node_count); for(int i=0,ni=node_count;i<ni;++i) { Node& n=m_nodes[i]; ZeroInitialize(n); n.m_x = x?*x++:btVector3(0,0,0); n.m_q = n.m_x; n.m_im = m?*m++:1; n.m_im = n.m_im>0?1/n.m_im:0; n.m_leaf = m_ndbvt.insert(btDbvtVolume::FromCR(n.m_x,margin),&n); n.m_material= pm; } updateBounds(); } btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo) :m_worldInfo(worldInfo) { initDefaults(); } void btSoftBody::initDefaults() { m_internalType = CO_SOFT_BODY; m_cfg.aeromodel = eAeroModel::V_Point; m_cfg.kVCF = 1; m_cfg.kDG = 0; m_cfg.kLF = 0; m_cfg.kDP = 0; m_cfg.kPR = 0; m_cfg.kVC = 0; m_cfg.kDF = (btScalar)0.2; m_cfg.kMT = 0; m_cfg.kCHR = (btScalar)1.0; m_cfg.kKHR = (btScalar)0.1; m_cfg.kSHR = (btScalar)1.0; m_cfg.kAHR = (btScalar)0.7; m_cfg.kSRHR_CL = (btScalar)0.1; m_cfg.kSKHR_CL = (btScalar)1; m_cfg.kSSHR_CL = (btScalar)0.5; m_cfg.kSR_SPLT_CL = (btScalar)0.5; m_cfg.kSK_SPLT_CL = (btScalar)0.5; m_cfg.kSS_SPLT_CL = (btScalar)0.5; m_cfg.maxvolume = (btScalar)1; m_cfg.timescale = 1; m_cfg.viterations = 0; m_cfg.piterations = 1; m_cfg.diterations = 0; m_cfg.citerations = 4; m_cfg.collisions = fCollision::Default; m_pose.m_bvolume = false; m_pose.m_bframe = false; m_pose.m_volume = 0; m_pose.m_com = btVector3(0,0,0); m_pose.m_rot.setIdentity(); m_pose.m_scl.setIdentity(); m_tag = 0; m_timeacc = 0; m_bUpdateRtCst = true; m_bounds[0] = btVector3(0,0,0); m_bounds[1] = btVector3(0,0,0); m_worldTransform.setIdentity(); setSolver(eSolverPresets::Positions); /* Collision shape */ ///for now, create a collision shape internally m_collisionShape = new btSoftBodyCollisionShape(this); m_collisionShape->setMargin(0.25f); m_initialWorldTransform.setIdentity(); m_windVelocity = btVector3(0,0,0); m_restLengthScale = btScalar(1.0); } // btSoftBody::~btSoftBody() { //for now, delete the internal shape delete m_collisionShape; int i; releaseClusters(); for(i=0;i<m_materials.size();++i) btAlignedFree(m_materials[i]); for(i=0;i<m_joints.size();++i) btAlignedFree(m_joints[i]); } // bool btSoftBody::checkLink(int node0,int node1) const { return(checkLink(&m_nodes[node0],&m_nodes[node1])); } // bool btSoftBody::checkLink(const Node* node0,const Node* node1) const { const Node* n[]={node0,node1}; for(int i=0,ni=m_links.size();i<ni;++i) { const Link& l=m_links[i]; if( (l.m_n[0]==n[0]&&l.m_n[1]==n[1])|| (l.m_n[0]==n[1]&&l.m_n[1]==n[0])) { return(true); } } return(false); } // bool btSoftBody::checkFace(int node0,int node1,int node2) const { const Node* n[]={ &m_nodes[node0], &m_nodes[node1], &m_nodes[node2]}; for(int i=0,ni=m_faces.size();i<ni;++i) { const Face& f=m_faces[i]; int c=0; for(int j=0;j<3;++j) { if( (f.m_n[j]==n[0])|| (f.m_n[j]==n[1])|| (f.m_n[j]==n[2])) c|=1<<j; else break; } if(c==7) return(true); } return(false); } // btSoftBody::Material* btSoftBody::appendMaterial() { Material* pm=new(btAlignedAlloc(sizeof(Material),16)) Material(); if(m_materials.size()>0) *pm=*m_materials[0]; else ZeroInitialize(*pm); m_materials.push_back(pm); return(pm); } // void btSoftBody::appendNote( const char* text, const btVector3& o, const btVector4& c, Node* n0, Node* n1, Node* n2, Node* n3) { Note n; ZeroInitialize(n); n.m_rank = 0; n.m_text = text; n.m_offset = o; n.m_coords[0] = c.x(); n.m_coords[1] = c.y(); n.m_coords[2] = c.z(); n.m_coords[3] = c.w(); n.m_nodes[0] = n0;n.m_rank+=n0?1:0; n.m_nodes[1] = n1;n.m_rank+=n1?1:0; n.m_nodes[2] = n2;n.m_rank+=n2?1:0; n.m_nodes[3] = n3;n.m_rank+=n3?1:0; m_notes.push_back(n); } // void btSoftBody::appendNote( const char* text, const btVector3& o, Node* feature) { appendNote(text,o,btVector4(1,0,0,0),feature); } // void btSoftBody::appendNote( const char* text, const btVector3& o, Link* feature) { static const btScalar w=1/(btScalar)2; appendNote(text,o,btVector4(w,w,0,0), feature->m_n[0], feature->m_n[1]); } // void btSoftBody::appendNote( const char* text, const btVector3& o, Face* feature) { static const btScalar w=1/(btScalar)3; appendNote(text,o,btVector4(w,w,w,0), feature->m_n[0], feature->m_n[1], feature->m_n[2]); } // void btSoftBody::appendNode( const btVector3& x,btScalar m) { if(m_nodes.capacity()==m_nodes.size()) { pointersToIndices(); m_nodes.reserve(m_nodes.size()*2+1); indicesToPointers(); } const btScalar margin=getCollisionShape()->getMargin(); m_nodes.push_back(Node()); Node& n=m_nodes[m_nodes.size()-1]; ZeroInitialize(n); n.m_x = x; n.m_q = n.m_x; n.m_im = m>0?1/m:0; n.m_material = m_materials[0]; n.m_leaf = m_ndbvt.insert(btDbvtVolume::FromCR(n.m_x,margin),&n); } // void btSoftBody::appendLink(int model,Material* mat) { Link l; if(model>=0) l=m_links[model]; else { ZeroInitialize(l);l.m_material=mat?mat:m_materials[0]; } m_links.push_back(l); } // void btSoftBody::appendLink( int node0, int node1, Material* mat, bool bcheckexist) { appendLink(&m_nodes[node0],&m_nodes[node1],mat,bcheckexist); } // void btSoftBody::appendLink( Node* node0, Node* node1, Material* mat, bool bcheckexist) { if((!bcheckexist)||(!checkLink(node0,node1))) { appendLink(-1,mat); Link& l=m_links[m_links.size()-1]; l.m_n[0] = node0; l.m_n[1] = node1; l.m_rl = (l.m_n[0]->m_x-l.m_n[1]->m_x).length(); m_bUpdateRtCst=true; } } // void btSoftBody::appendFace(int model,Material* mat) { Face f; if(model>=0) { f=m_faces[model]; } else { ZeroInitialize(f);f.m_material=mat?mat:m_materials[0]; } m_faces.push_back(f); } // void btSoftBody::appendFace(int node0,int node1,int node2,Material* mat) { if (node0==node1) return; if (node1==node2) return; if (node2==node0) return; appendFace(-1,mat); Face& f=m_faces[m_faces.size()-1]; btAssert(node0!=node1); btAssert(node1!=node2); btAssert(node2!=node0); f.m_n[0] = &m_nodes[node0]; f.m_n[1] = &m_nodes[node1]; f.m_n[2] = &m_nodes[node2]; f.m_ra = AreaOf( f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x); m_bUpdateRtCst=true; } // void btSoftBody::appendTetra(int model,Material* mat) { Tetra t; if(model>=0) t=m_tetras[model]; else { ZeroInitialize(t);t.m_material=mat?mat:m_materials[0]; } m_tetras.push_back(t); } // void btSoftBody::appendTetra(int node0, int node1, int node2, int node3, Material* mat) { appendTetra(-1,mat); Tetra& t=m_tetras[m_tetras.size()-1]; t.m_n[0] = &m_nodes[node0]; t.m_n[1] = &m_nodes[node1]; t.m_n[2] = &m_nodes[node2]; t.m_n[3] = &m_nodes[node3]; t.m_rv = VolumeOf(t.m_n[0]->m_x,t.m_n[1]->m_x,t.m_n[2]->m_x,t.m_n[3]->m_x); m_bUpdateRtCst=true; } // void btSoftBody::appendAnchor(int node,btRigidBody* body, bool disableCollisionBetweenLinkedBodies,btScalar influence) { btVector3 local = body->getWorldTransform().inverse()*m_nodes[node].m_x; appendAnchor(node,body,local,disableCollisionBetweenLinkedBodies,influence); } // void btSoftBody::appendAnchor(int node,btRigidBody* body, const btVector3& localPivot,bool disableCollisionBetweenLinkedBodies,btScalar influence) { if (disableCollisionBetweenLinkedBodies) { if (m_collisionDisabledObjects.findLinearSearch(body)==m_collisionDisabledObjects.size()) { m_collisionDisabledObjects.push_back(body); } } Anchor a; a.m_node = &m_nodes[node]; a.m_body = body; a.m_local = localPivot; a.m_node->m_battach = 1; a.m_influence = influence; m_anchors.push_back(a); } // void btSoftBody::appendLinearJoint(const LJoint::Specs& specs,Cluster* body0,Body body1) { LJoint* pj = new(btAlignedAlloc(sizeof(LJoint),16)) LJoint(); pj->m_bodies[0] = body0; pj->m_bodies[1] = body1; pj->m_refs[0] = pj->m_bodies[0].xform().inverse()*specs.position; pj->m_refs[1] = pj->m_bodies[1].xform().inverse()*specs.position; pj->m_cfm = specs.cfm; pj->m_erp = specs.erp; pj->m_split = specs.split; m_joints.push_back(pj); } // void btSoftBody::appendLinearJoint(const LJoint::Specs& specs,Body body) { appendLinearJoint(specs,m_clusters[0],body); } // void btSoftBody::appendLinearJoint(const LJoint::Specs& specs,btSoftBody* body) { appendLinearJoint(specs,m_clusters[0],body->m_clusters[0]); } // void btSoftBody::appendAngularJoint(const AJoint::Specs& specs,Cluster* body0,Body body1) { AJoint* pj = new(btAlignedAlloc(sizeof(AJoint),16)) AJoint(); pj->m_bodies[0] = body0; pj->m_bodies[1] = body1; pj->m_refs[0] = pj->m_bodies[0].xform().inverse().getBasis()*specs.axis; pj->m_refs[1] = pj->m_bodies[1].xform().inverse().getBasis()*specs.axis; pj->m_cfm = specs.cfm; pj->m_erp = specs.erp; pj->m_split = specs.split; pj->m_icontrol = specs.icontrol; m_joints.push_back(pj); } // void btSoftBody::appendAngularJoint(const AJoint::Specs& specs,Body body) { appendAngularJoint(specs,m_clusters[0],body); } // void btSoftBody::appendAngularJoint(const AJoint::Specs& specs,btSoftBody* body) { appendAngularJoint(specs,m_clusters[0],body->m_clusters[0]); } // void btSoftBody::addForce(const btVector3& force) { for(int i=0,ni=m_nodes.size();i<ni;++i) addForce(force,i); } // void btSoftBody::addForce(const btVector3& force,int node) { Node& n=m_nodes[node]; if(n.m_im>0) { n.m_f += force; } } void btSoftBody::addAeroForceToNode(const btVector3& windVelocity,int nodeIndex) { btAssert(nodeIndex >= 0 && nodeIndex < m_nodes.size()); const btScalar dt = m_sst.sdt; const btScalar kLF = m_cfg.kLF; const btScalar kDG = m_cfg.kDG; //const btScalar kPR = m_cfg.kPR; //const btScalar kVC = m_cfg.kVC; const bool as_lift = kLF>0; const bool as_drag = kDG>0; const bool as_aero = as_lift || as_drag; const bool as_vaero = as_aero && (m_cfg.aeromodel < btSoftBody::eAeroModel::F_TwoSided); Node& n = m_nodes[nodeIndex]; if( n.m_im>0 ) { btSoftBody::sMedium medium; EvaluateMedium(m_worldInfo, n.m_x, medium); medium.m_velocity = windVelocity; medium.m_density = m_worldInfo->air_density; /* Aerodynamics */ if(as_vaero) { const btVector3 rel_v = n.m_v - medium.m_velocity; const btScalar rel_v_len = rel_v.length(); const btScalar rel_v2 = rel_v.length2(); if(rel_v2>SIMD_EPSILON) { const btVector3 rel_v_nrm = rel_v.normalized(); btVector3 nrm = n.m_n; if (m_cfg.aeromodel == btSoftBody::eAeroModel::V_TwoSidedLiftDrag) { nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); btVector3 fDrag(0, 0, 0); btVector3 fLift(0, 0, 0); btScalar n_dot_v = nrm.dot(rel_v_nrm); btScalar tri_area = 0.5f * n.m_area; fDrag = 0.5f * kDG * medium.m_density * rel_v2 * tri_area * n_dot_v * (-rel_v_nrm); // Check angle of attack // cos(10) = 0.98480 if ( 0 < n_dot_v && n_dot_v < 0.98480f) fLift = 0.5f * kLF * medium.m_density * rel_v_len * tri_area * btSqrt(1.0f-n_dot_v*n_dot_v) * (nrm.cross(rel_v_nrm).cross(rel_v_nrm)); // Check if the velocity change resulted by aero drag force exceeds the current velocity of the node. btVector3 del_v_by_fDrag = fDrag*n.m_im*m_sst.sdt; btScalar del_v_by_fDrag_len2 = del_v_by_fDrag.length2(); btScalar v_len2 = n.m_v.length2(); if (del_v_by_fDrag_len2 >= v_len2 && del_v_by_fDrag_len2 > 0) { btScalar del_v_by_fDrag_len = del_v_by_fDrag.length(); btScalar v_len = n.m_v.length(); fDrag *= btScalar(0.8)*(v_len / del_v_by_fDrag_len); } n.m_f += fDrag; n.m_f += fLift; } else if (m_cfg.aeromodel == btSoftBody::eAeroModel::V_Point || m_cfg.aeromodel == btSoftBody::eAeroModel::V_OneSided || m_cfg.aeromodel == btSoftBody::eAeroModel::V_TwoSided) { if (m_cfg.aeromodel == btSoftBody::eAeroModel::V_TwoSided) nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); const btScalar dvn = btDot(rel_v,nrm); /* Compute forces */ if(dvn>0) { btVector3 force(0,0,0); const btScalar c0 = n.m_area * dvn * rel_v2/2; const btScalar c1 = c0 * medium.m_density; force += nrm*(-c1*kLF); force += rel_v.normalized() * (-c1 * kDG); ApplyClampedForce(n, force, dt); } } } } } } void btSoftBody::addAeroForceToFace(const btVector3& windVelocity,int faceIndex) { const btScalar dt = m_sst.sdt; const btScalar kLF = m_cfg.kLF; const btScalar kDG = m_cfg.kDG; // const btScalar kPR = m_cfg.kPR; // const btScalar kVC = m_cfg.kVC; const bool as_lift = kLF>0; const bool as_drag = kDG>0; const bool as_aero = as_lift || as_drag; const bool as_faero = as_aero && (m_cfg.aeromodel >= btSoftBody::eAeroModel::F_TwoSided); if(as_faero) { btSoftBody::Face& f=m_faces[faceIndex]; btSoftBody::sMedium medium; const btVector3 v=(f.m_n[0]->m_v+f.m_n[1]->m_v+f.m_n[2]->m_v)/3; const btVector3 x=(f.m_n[0]->m_x+f.m_n[1]->m_x+f.m_n[2]->m_x)/3; EvaluateMedium(m_worldInfo,x,medium); medium.m_velocity = windVelocity; medium.m_density = m_worldInfo->air_density; const btVector3 rel_v=v-medium.m_velocity; const btScalar rel_v_len = rel_v.length(); const btScalar rel_v2=rel_v.length2(); if(rel_v2>SIMD_EPSILON) { const btVector3 rel_v_nrm = rel_v.normalized(); btVector3 nrm = f.m_normal; if (m_cfg.aeromodel == btSoftBody::eAeroModel::F_TwoSidedLiftDrag) { nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); btVector3 fDrag(0, 0, 0); btVector3 fLift(0, 0, 0); btScalar n_dot_v = nrm.dot(rel_v_nrm); btScalar tri_area = 0.5f * f.m_ra; fDrag = 0.5f * kDG * medium.m_density * rel_v2 * tri_area * n_dot_v * (-rel_v_nrm); // Check angle of attack // cos(10) = 0.98480 if ( 0 < n_dot_v && n_dot_v < 0.98480f) fLift = 0.5f * kLF * medium.m_density * rel_v_len * tri_area * btSqrt(1.0f-n_dot_v*n_dot_v) * (nrm.cross(rel_v_nrm).cross(rel_v_nrm)); fDrag /= 3; fLift /= 3; for(int j=0;j<3;++j) { if (f.m_n[j]->m_im>0) { // Check if the velocity change resulted by aero drag force exceeds the current velocity of the node. btVector3 del_v_by_fDrag = fDrag*f.m_n[j]->m_im*m_sst.sdt; btScalar del_v_by_fDrag_len2 = del_v_by_fDrag.length2(); btScalar v_len2 = f.m_n[j]->m_v.length2(); if (del_v_by_fDrag_len2 >= v_len2 && del_v_by_fDrag_len2 > 0) { btScalar del_v_by_fDrag_len = del_v_by_fDrag.length(); btScalar v_len = f.m_n[j]->m_v.length(); fDrag *= btScalar(0.8)*(v_len / del_v_by_fDrag_len); } f.m_n[j]->m_f += fDrag; f.m_n[j]->m_f += fLift; } } } else if (m_cfg.aeromodel == btSoftBody::eAeroModel::F_OneSided || m_cfg.aeromodel == btSoftBody::eAeroModel::F_TwoSided) { if (m_cfg.aeromodel == btSoftBody::eAeroModel::F_TwoSided) nrm *= (btScalar)( (btDot(nrm,rel_v) < 0) ? -1 : +1); const btScalar dvn=btDot(rel_v,nrm); /* Compute forces */ if(dvn>0) { btVector3 force(0,0,0); const btScalar c0 = f.m_ra*dvn*rel_v2; const btScalar c1 = c0*medium.m_density; force += nrm*(-c1*kLF); force += rel_v.normalized()*(-c1*kDG); force /= 3; for(int j=0;j<3;++j) ApplyClampedForce(*f.m_n[j],force,dt); } } } } } // void btSoftBody::addVelocity(const btVector3& velocity) { for(int i=0,ni=m_nodes.size();i<ni;++i) addVelocity(velocity,i); } /* Set velocity for the entire body */ void btSoftBody::setVelocity( const btVector3& velocity) { for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; if(n.m_im>0) { n.m_v = velocity; } } } // void btSoftBody::addVelocity(const btVector3& velocity,int node) { Node& n=m_nodes[node]; if(n.m_im>0) { n.m_v += velocity; } } // void btSoftBody::setMass(int node,btScalar mass) { m_nodes[node].m_im=mass>0?1/mass:0; m_bUpdateRtCst=true; } // btScalar btSoftBody::getMass(int node) const { return(m_nodes[node].m_im>0?1/m_nodes[node].m_im:0); } // btScalar btSoftBody::getTotalMass() const { btScalar mass=0; for(int i=0;i<m_nodes.size();++i) { mass+=getMass(i); } return(mass); } // void btSoftBody::setTotalMass(btScalar mass,bool fromfaces) { int i; if(fromfaces) { for(i=0;i<m_nodes.size();++i) { m_nodes[i].m_im=0; } for(i=0;i<m_faces.size();++i) { const Face& f=m_faces[i]; const btScalar twicearea=AreaOf( f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x); for(int j=0;j<3;++j) { f.m_n[j]->m_im+=twicearea; } } for( i=0;i<m_nodes.size();++i) { m_nodes[i].m_im=1/m_nodes[i].m_im; } } const btScalar tm=getTotalMass(); const btScalar itm=1/tm; for( i=0;i<m_nodes.size();++i) { m_nodes[i].m_im/=itm*mass; } m_bUpdateRtCst=true; } // void btSoftBody::setTotalDensity(btScalar density) { setTotalMass(getVolume()*density,true); } // void btSoftBody::setVolumeMass(btScalar mass) { btAlignedObjectArray<btScalar> ranks; ranks.resize(m_nodes.size(),0); int i; for(i=0;i<m_nodes.size();++i) { m_nodes[i].m_im=0; } for(i=0;i<m_tetras.size();++i) { const Tetra& t=m_tetras[i]; for(int j=0;j<4;++j) { t.m_n[j]->m_im+=btFabs(t.m_rv); ranks[int(t.m_n[j]-&m_nodes[0])]+=1; } } for( i=0;i<m_nodes.size();++i) { if(m_nodes[i].m_im>0) { m_nodes[i].m_im=ranks[i]/m_nodes[i].m_im; } } setTotalMass(mass,false); } // void btSoftBody::setVolumeDensity(btScalar density) { btScalar volume=0; for(int i=0;i<m_tetras.size();++i) { const Tetra& t=m_tetras[i]; for(int j=0;j<4;++j) { volume+=btFabs(t.m_rv); } } setVolumeMass(volume*density/6); } // void btSoftBody::transform(const btTransform& trs) { const btScalar margin=getCollisionShape()->getMargin(); ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_x=trs*n.m_x; n.m_q=trs*n.m_q; n.m_n=trs.getBasis()*n.m_n; vol = btDbvtVolume::FromCR(n.m_x,margin); m_ndbvt.update(n.m_leaf,vol); } updateNormals(); updateBounds(); updateConstants(); m_initialWorldTransform = trs; } // void btSoftBody::translate(const btVector3& trs) { btTransform t; t.setIdentity(); t.setOrigin(trs); transform(t); } // void btSoftBody::rotate( const btQuaternion& rot) { btTransform t; t.setIdentity(); t.setRotation(rot); transform(t); } // void btSoftBody::scale(const btVector3& scl) { const btScalar margin=getCollisionShape()->getMargin(); ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_x*=scl; n.m_q*=scl; vol = btDbvtVolume::FromCR(n.m_x,margin); m_ndbvt.update(n.m_leaf,vol); } updateNormals(); updateBounds(); updateConstants(); } // btScalar btSoftBody::getRestLengthScale() { return m_restLengthScale; } // void btSoftBody::setRestLengthScale(btScalar restLengthScale) { for(int i=0, ni=m_links.size(); i<ni; ++i) { Link& l=m_links[i]; l.m_rl = l.m_rl / m_restLengthScale * restLengthScale; l.m_c1 = l.m_rl*l.m_rl; } m_restLengthScale = restLengthScale; if (getActivationState() == ISLAND_SLEEPING) activate(); } // void btSoftBody::setPose(bool bvolume,bool bframe) { m_pose.m_bvolume = bvolume; m_pose.m_bframe = bframe; int i,ni; /* Weights */ const btScalar omass=getTotalMass(); const btScalar kmass=omass*m_nodes.size()*1000; btScalar tmass=omass; m_pose.m_wgh.resize(m_nodes.size()); for(i=0,ni=m_nodes.size();i<ni;++i) { if(m_nodes[i].m_im<=0) tmass+=kmass; } for( i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; m_pose.m_wgh[i]= n.m_im>0 ? 1/(m_nodes[i].m_im*tmass) : kmass/tmass; } /* Pos */ const btVector3 com=evaluateCom(); m_pose.m_pos.resize(m_nodes.size()); for( i=0,ni=m_nodes.size();i<ni;++i) { m_pose.m_pos[i]=m_nodes[i].m_x-com; } m_pose.m_volume = bvolume?getVolume():0; m_pose.m_com = com; m_pose.m_rot.setIdentity(); m_pose.m_scl.setIdentity(); /* Aqq */ m_pose.m_aqq[0] = m_pose.m_aqq[1] = m_pose.m_aqq[2] = btVector3(0,0,0); for( i=0,ni=m_nodes.size();i<ni;++i) { const btVector3& q=m_pose.m_pos[i]; const btVector3 mq=m_pose.m_wgh[i]*q; m_pose.m_aqq[0]+=mq.x()*q; m_pose.m_aqq[1]+=mq.y()*q; m_pose.m_aqq[2]+=mq.z()*q; } m_pose.m_aqq=m_pose.m_aqq.inverse(); updateConstants(); } void btSoftBody::resetLinkRestLengths() { for(int i=0, ni=m_links.size();i<ni;++i) { Link& l = m_links[i]; l.m_rl = (l.m_n[0]->m_x-l.m_n[1]->m_x).length(); l.m_c1 = l.m_rl*l.m_rl; } } // btScalar btSoftBody::getVolume() const { btScalar vol=0; if(m_nodes.size()>0) { int i,ni; const btVector3 org=m_nodes[0].m_x; for(i=0,ni=m_faces.size();i<ni;++i) { const Face& f=m_faces[i]; vol+=btDot(f.m_n[0]->m_x-org,btCross(f.m_n[1]->m_x-org,f.m_n[2]->m_x-org)); } vol/=(btScalar)6; } return(vol); } // int btSoftBody::clusterCount() const { return(m_clusters.size()); } // btVector3 btSoftBody::clusterCom(const Cluster* cluster) { btVector3 com(0,0,0); for(int i=0,ni=cluster->m_nodes.size();i<ni;++i) { com+=cluster->m_nodes[i]->m_x*cluster->m_masses[i]; } return(com*cluster->m_imass); } // btVector3 btSoftBody::clusterCom(int cluster) const { return(clusterCom(m_clusters[cluster])); } // btVector3 btSoftBody::clusterVelocity(const Cluster* cluster,const btVector3& rpos) { return(cluster->m_lv+btCross(cluster->m_av,rpos)); } // void btSoftBody::clusterVImpulse(Cluster* cluster,const btVector3& rpos,const btVector3& impulse) { const btVector3 li=cluster->m_imass*impulse; const btVector3 ai=cluster->m_invwi*btCross(rpos,impulse); cluster->m_vimpulses[0]+=li;cluster->m_lv+=li; cluster->m_vimpulses[1]+=ai;cluster->m_av+=ai; cluster->m_nvimpulses++; } // void btSoftBody::clusterDImpulse(Cluster* cluster,const btVector3& rpos,const btVector3& impulse) { const btVector3 li=cluster->m_imass*impulse; const btVector3 ai=cluster->m_invwi*btCross(rpos,impulse); cluster->m_dimpulses[0]+=li; cluster->m_dimpulses[1]+=ai; cluster->m_ndimpulses++; } // void btSoftBody::clusterImpulse(Cluster* cluster,const btVector3& rpos,const Impulse& impulse) { if(impulse.m_asVelocity) clusterVImpulse(cluster,rpos,impulse.m_velocity); if(impulse.m_asDrift) clusterDImpulse(cluster,rpos,impulse.m_drift); } // void btSoftBody::clusterVAImpulse(Cluster* cluster,const btVector3& impulse) { const btVector3 ai=cluster->m_invwi*impulse; cluster->m_vimpulses[1]+=ai;cluster->m_av+=ai; cluster->m_nvimpulses++; } // void btSoftBody::clusterDAImpulse(Cluster* cluster,const btVector3& impulse) { const btVector3 ai=cluster->m_invwi*impulse; cluster->m_dimpulses[1]+=ai; cluster->m_ndimpulses++; } // void btSoftBody::clusterAImpulse(Cluster* cluster,const Impulse& impulse) { if(impulse.m_asVelocity) clusterVAImpulse(cluster,impulse.m_velocity); if(impulse.m_asDrift) clusterDAImpulse(cluster,impulse.m_drift); } // void btSoftBody::clusterDCImpulse(Cluster* cluster,const btVector3& impulse) { cluster->m_dimpulses[0]+=impulse*cluster->m_imass; cluster->m_ndimpulses++; } struct NodeLinks { btAlignedObjectArray<int> m_links; }; // int btSoftBody::generateBendingConstraints(int distance,Material* mat) { int i,j; if(distance>1) { /* Build graph */ const int n=m_nodes.size(); const unsigned inf=(~(unsigned)0)>>1; unsigned* adj=new unsigned[n*n]; #define IDX(_x_,_y_) ((_y_)*n+(_x_)) for(j=0;j<n;++j) { for(i=0;i<n;++i) { if(i!=j) { adj[IDX(i,j)]=adj[IDX(j,i)]=inf; } else { adj[IDX(i,j)]=adj[IDX(j,i)]=0; } } } for( i=0;i<m_links.size();++i) { const int ia=(int)(m_links[i].m_n[0]-&m_nodes[0]); const int ib=(int)(m_links[i].m_n[1]-&m_nodes[0]); adj[IDX(ia,ib)]=1; adj[IDX(ib,ia)]=1; } //special optimized case for distance == 2 if (distance == 2) { btAlignedObjectArray<NodeLinks> nodeLinks; /* Build node links */ nodeLinks.resize(m_nodes.size()); for( i=0;i<m_links.size();++i) { const int ia=(int)(m_links[i].m_n[0]-&m_nodes[0]); const int ib=(int)(m_links[i].m_n[1]-&m_nodes[0]); if (nodeLinks[ia].m_links.findLinearSearch(ib)==nodeLinks[ia].m_links.size()) nodeLinks[ia].m_links.push_back(ib); if (nodeLinks[ib].m_links.findLinearSearch(ia)==nodeLinks[ib].m_links.size()) nodeLinks[ib].m_links.push_back(ia); } for (int ii=0;ii<nodeLinks.size();ii++) { int i=ii; for (int jj=0;jj<nodeLinks[ii].m_links.size();jj++) { int k = nodeLinks[ii].m_links[jj]; for (int kk=0;kk<nodeLinks[k].m_links.size();kk++) { int j = nodeLinks[k].m_links[kk]; if (i!=j) { const unsigned sum=adj[IDX(i,k)]+adj[IDX(k,j)]; btAssert(sum==2); if(adj[IDX(i,j)]>sum) { adj[IDX(i,j)]=adj[IDX(j,i)]=sum; } } } } } } else { ///generic Floyd's algorithm for(int k=0;k<n;++k) { for(j=0;j<n;++j) { for(i=j+1;i<n;++i) { const unsigned sum=adj[IDX(i,k)]+adj[IDX(k,j)]; if(adj[IDX(i,j)]>sum) { adj[IDX(i,j)]=adj[IDX(j,i)]=sum; } } } } } /* Build links */ int nlinks=0; for(j=0;j<n;++j) { for(i=j+1;i<n;++i) { if(adj[IDX(i,j)]==(unsigned)distance) { appendLink(i,j,mat); m_links[m_links.size()-1].m_bbending=1; ++nlinks; } } } delete[] adj; return(nlinks); } return(0); } // void btSoftBody::randomizeConstraints() { unsigned long seed=243703; #define NEXTRAND (seed=(1664525L*seed+1013904223L)&0xffffffff) int i,ni; for(i=0,ni=m_links.size();i<ni;++i) { btSwap(m_links[i],m_links[NEXTRAND%ni]); } for(i=0,ni=m_faces.size();i<ni;++i) { btSwap(m_faces[i],m_faces[NEXTRAND%ni]); } #undef NEXTRAND } // void btSoftBody::releaseCluster(int index) { Cluster* c=m_clusters[index]; if(c->m_leaf) m_cdbvt.remove(c->m_leaf); c->~Cluster(); btAlignedFree(c); m_clusters.remove(c); } // void btSoftBody::releaseClusters() { while(m_clusters.size()>0) releaseCluster(0); } // int btSoftBody::generateClusters(int k,int maxiterations) { int i; releaseClusters(); m_clusters.resize(btMin(k,m_nodes.size())); for(i=0;i<m_clusters.size();++i) { m_clusters[i] = new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); m_clusters[i]->m_collide= true; } k=m_clusters.size(); if(k>0) { /* Initialize */ btAlignedObjectArray<btVector3> centers; btVector3 cog(0,0,0); int i; for(i=0;i<m_nodes.size();++i) { cog+=m_nodes[i].m_x; m_clusters[(i*29873)%m_clusters.size()]->m_nodes.push_back(&m_nodes[i]); } cog/=(btScalar)m_nodes.size(); centers.resize(k,cog); /* Iterate */ const btScalar slope=16; bool changed; int iterations=0; do { const btScalar w=2-btMin<btScalar>(1,iterations/slope); changed=false; iterations++; int i; for(i=0;i<k;++i) { btVector3 c(0,0,0); for(int j=0;j<m_clusters[i]->m_nodes.size();++j) { c+=m_clusters[i]->m_nodes[j]->m_x; } if(m_clusters[i]->m_nodes.size()) { c /= (btScalar)m_clusters[i]->m_nodes.size(); c = centers[i]+(c-centers[i])*w; changed |= ((c-centers[i]).length2()>SIMD_EPSILON); centers[i] = c; m_clusters[i]->m_nodes.resize(0); } } for(i=0;i<m_nodes.size();++i) { const btVector3 nx=m_nodes[i].m_x; int kbest=0; btScalar kdist=ClusterMetric(centers[0],nx); for(int j=1;j<k;++j) { const btScalar d=ClusterMetric(centers[j],nx); if(d<kdist) { kbest=j; kdist=d; } } m_clusters[kbest]->m_nodes.push_back(&m_nodes[i]); } } while(changed&&(iterations<maxiterations)); /* Merge */ btAlignedObjectArray<int> cids; cids.resize(m_nodes.size(),-1); for(i=0;i<m_clusters.size();++i) { for(int j=0;j<m_clusters[i]->m_nodes.size();++j) { cids[int(m_clusters[i]->m_nodes[j]-&m_nodes[0])]=i; } } for(i=0;i<m_faces.size();++i) { const int idx[]={ int(m_faces[i].m_n[0]-&m_nodes[0]), int(m_faces[i].m_n[1]-&m_nodes[0]), int(m_faces[i].m_n[2]-&m_nodes[0])}; for(int j=0;j<3;++j) { const int cid=cids[idx[j]]; for(int q=1;q<3;++q) { const int kid=idx[(j+q)%3]; if(cids[kid]!=cid) { if(m_clusters[cid]->m_nodes.findLinearSearch(&m_nodes[kid])==m_clusters[cid]->m_nodes.size()) { m_clusters[cid]->m_nodes.push_back(&m_nodes[kid]); } } } } } /* Master */ if(m_clusters.size()>1) { Cluster* pmaster=new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); pmaster->m_collide = false; pmaster->m_nodes.reserve(m_nodes.size()); for(int i=0;i<m_nodes.size();++i) pmaster->m_nodes.push_back(&m_nodes[i]); m_clusters.push_back(pmaster); btSwap(m_clusters[0],m_clusters[m_clusters.size()-1]); } /* Terminate */ for(i=0;i<m_clusters.size();++i) { if(m_clusters[i]->m_nodes.size()==0) { releaseCluster(i--); } } } else { //create a cluster for each tetrahedron (if tetrahedra exist) or each face if (m_tetras.size()) { m_clusters.resize(m_tetras.size()); for(i=0;i<m_clusters.size();++i) { m_clusters[i] = new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); m_clusters[i]->m_collide= true; } for (i=0;i<m_tetras.size();i++) { for (int j=0;j<4;j++) { m_clusters[i]->m_nodes.push_back(m_tetras[i].m_n[j]); } } } else { m_clusters.resize(m_faces.size()); for(i=0;i<m_clusters.size();++i) { m_clusters[i] = new(btAlignedAlloc(sizeof(Cluster),16)) Cluster(); m_clusters[i]->m_collide= true; } for(i=0;i<m_faces.size();++i) { for(int j=0;j<3;++j) { m_clusters[i]->m_nodes.push_back(m_faces[i].m_n[j]); } } } } if (m_clusters.size()) { initializeClusters(); updateClusters(); //for self-collision m_clusterConnectivity.resize(m_clusters.size()*m_clusters.size()); { for (int c0=0;c0<m_clusters.size();c0++) { m_clusters[c0]->m_clusterIndex=c0; for (int c1=0;c1<m_clusters.size();c1++) { bool connected=false; Cluster* cla = m_clusters[c0]; Cluster* clb = m_clusters[c1]; for (int i=0;!connected&&i<cla->m_nodes.size();i++) { for (int j=0;j<clb->m_nodes.size();j++) { if (cla->m_nodes[i] == clb->m_nodes[j]) { connected=true; break; } } } m_clusterConnectivity[c0+c1*m_clusters.size()]=connected; } } } } return(m_clusters.size()); } // void btSoftBody::refine(ImplicitFn* ifn,btScalar accurary,bool cut) { const Node* nbase = &m_nodes[0]; int ncount = m_nodes.size(); btSymMatrix<int> edges(ncount,-2); int newnodes=0; int i,j,k,ni; /* Filter out */ for(i=0;i<m_links.size();++i) { Link& l=m_links[i]; if(l.m_bbending) { if(!SameSign(ifn->Eval(l.m_n[0]->m_x),ifn->Eval(l.m_n[1]->m_x))) { btSwap(m_links[i],m_links[m_links.size()-1]); m_links.pop_back();--i; } } } /* Fill edges */ for(i=0;i<m_links.size();++i) { Link& l=m_links[i]; edges(int(l.m_n[0]-nbase),int(l.m_n[1]-nbase))=-1; } for(i=0;i<m_faces.size();++i) { Face& f=m_faces[i]; edges(int(f.m_n[0]-nbase),int(f.m_n[1]-nbase))=-1; edges(int(f.m_n[1]-nbase),int(f.m_n[2]-nbase))=-1; edges(int(f.m_n[2]-nbase),int(f.m_n[0]-nbase))=-1; } /* Intersect */ for(i=0;i<ncount;++i) { for(j=i+1;j<ncount;++j) { if(edges(i,j)==-1) { Node& a=m_nodes[i]; Node& b=m_nodes[j]; const btScalar t=ImplicitSolve(ifn,a.m_x,b.m_x,accurary); if(t>0) { const btVector3 x=Lerp(a.m_x,b.m_x,t); const btVector3 v=Lerp(a.m_v,b.m_v,t); btScalar m=0; if(a.m_im>0) { if(b.m_im>0) { const btScalar ma=1/a.m_im; const btScalar mb=1/b.m_im; const btScalar mc=Lerp(ma,mb,t); const btScalar f=(ma+mb)/(ma+mb+mc); a.m_im=1/(ma*f); b.m_im=1/(mb*f); m=mc*f; } else { a.m_im/=0.5f;m=1/a.m_im; } } else { if(b.m_im>0) { b.m_im/=0.5f;m=1/b.m_im; } else m=0; } appendNode(x,m); edges(i,j)=m_nodes.size()-1; m_nodes[edges(i,j)].m_v=v; ++newnodes; } } } } nbase=&m_nodes[0]; /* Refine links */ for(i=0,ni=m_links.size();i<ni;++i) { Link& feat=m_links[i]; const int idx[]={ int(feat.m_n[0]-nbase), int(feat.m_n[1]-nbase)}; if((idx[0]<ncount)&&(idx[1]<ncount)) { const int ni=edges(idx[0],idx[1]); if(ni>0) { appendLink(i); Link* pft[]={ &m_links[i], &m_links[m_links.size()-1]}; pft[0]->m_n[0]=&m_nodes[idx[0]]; pft[0]->m_n[1]=&m_nodes[ni]; pft[1]->m_n[0]=&m_nodes[ni]; pft[1]->m_n[1]=&m_nodes[idx[1]]; } } } /* Refine faces */ for(i=0;i<m_faces.size();++i) { const Face& feat=m_faces[i]; const int idx[]={ int(feat.m_n[0]-nbase), int(feat.m_n[1]-nbase), int(feat.m_n[2]-nbase)}; for(j=2,k=0;k<3;j=k++) { if((idx[j]<ncount)&&(idx[k]<ncount)) { const int ni=edges(idx[j],idx[k]); if(ni>0) { appendFace(i); const int l=(k+1)%3; Face* pft[]={ &m_faces[i], &m_faces[m_faces.size()-1]}; pft[0]->m_n[0]=&m_nodes[idx[l]]; pft[0]->m_n[1]=&m_nodes[idx[j]]; pft[0]->m_n[2]=&m_nodes[ni]; pft[1]->m_n[0]=&m_nodes[ni]; pft[1]->m_n[1]=&m_nodes[idx[k]]; pft[1]->m_n[2]=&m_nodes[idx[l]]; appendLink(ni,idx[l],pft[0]->m_material); --i;break; } } } } /* Cut */ if(cut) { btAlignedObjectArray<int> cnodes; const int pcount=ncount; int i; ncount=m_nodes.size(); cnodes.resize(ncount,0); /* Nodes */ for(i=0;i<ncount;++i) { const btVector3 x=m_nodes[i].m_x; if((i>=pcount)||(btFabs(ifn->Eval(x))<accurary)) { const btVector3 v=m_nodes[i].m_v; btScalar m=getMass(i); if(m>0) { m*=0.5f;m_nodes[i].m_im/=0.5f; } appendNode(x,m); cnodes[i]=m_nodes.size()-1; m_nodes[cnodes[i]].m_v=v; } } nbase=&m_nodes[0]; /* Links */ for(i=0,ni=m_links.size();i<ni;++i) { const int id[]={ int(m_links[i].m_n[0]-nbase), int(m_links[i].m_n[1]-nbase)}; int todetach=0; if(cnodes[id[0]]&&cnodes[id[1]]) { appendLink(i); todetach=m_links.size()-1; } else { if(( (ifn->Eval(m_nodes[id[0]].m_x)<accurary)&& (ifn->Eval(m_nodes[id[1]].m_x)<accurary))) todetach=i; } if(todetach) { Link& l=m_links[todetach]; for(int j=0;j<2;++j) { int cn=cnodes[int(l.m_n[j]-nbase)]; if(cn) l.m_n[j]=&m_nodes[cn]; } } } /* Faces */ for(i=0,ni=m_faces.size();i<ni;++i) { Node** n= m_faces[i].m_n; if( (ifn->Eval(n[0]->m_x)<accurary)&& (ifn->Eval(n[1]->m_x)<accurary)&& (ifn->Eval(n[2]->m_x)<accurary)) { for(int j=0;j<3;++j) { int cn=cnodes[int(n[j]-nbase)]; if(cn) n[j]=&m_nodes[cn]; } } } /* Clean orphans */ int nnodes=m_nodes.size(); btAlignedObjectArray<int> ranks; btAlignedObjectArray<int> todelete; ranks.resize(nnodes,0); for(i=0,ni=m_links.size();i<ni;++i) { for(int j=0;j<2;++j) ranks[int(m_links[i].m_n[j]-nbase)]++; } for(i=0,ni=m_faces.size();i<ni;++i) { for(int j=0;j<3;++j) ranks[int(m_faces[i].m_n[j]-nbase)]++; } for(i=0;i<m_links.size();++i) { const int id[]={ int(m_links[i].m_n[0]-nbase), int(m_links[i].m_n[1]-nbase)}; const bool sg[]={ ranks[id[0]]==1, ranks[id[1]]==1}; if(sg[0]||sg[1]) { --ranks[id[0]]; --ranks[id[1]]; btSwap(m_links[i],m_links[m_links.size()-1]); m_links.pop_back();--i; } } #if 0 for(i=nnodes-1;i>=0;--i) { if(!ranks[i]) todelete.push_back(i); } if(todelete.size()) { btAlignedObjectArray<int>& map=ranks; for(int i=0;i<nnodes;++i) map[i]=i; PointersToIndices(this); for(int i=0,ni=todelete.size();i<ni;++i) { int j=todelete[i]; int& a=map[j]; int& b=map[--nnodes]; m_ndbvt.remove(m_nodes[a].m_leaf);m_nodes[a].m_leaf=0; btSwap(m_nodes[a],m_nodes[b]); j=a;a=b;b=j; } IndicesToPointers(this,&map[0]); m_nodes.resize(nnodes); } #endif } m_bUpdateRtCst=true; } // bool btSoftBody::cutLink(const Node* node0,const Node* node1,btScalar position) { return(cutLink(int(node0-&m_nodes[0]),int(node1-&m_nodes[0]),position)); } // bool btSoftBody::cutLink(int node0,int node1,btScalar position) { bool done=false; int i,ni; // const btVector3 d=m_nodes[node0].m_x-m_nodes[node1].m_x; const btVector3 x=Lerp(m_nodes[node0].m_x,m_nodes[node1].m_x,position); const btVector3 v=Lerp(m_nodes[node0].m_v,m_nodes[node1].m_v,position); const btScalar m=1; appendNode(x,m); appendNode(x,m); Node* pa=&m_nodes[node0]; Node* pb=&m_nodes[node1]; Node* pn[2]={ &m_nodes[m_nodes.size()-2], &m_nodes[m_nodes.size()-1]}; pn[0]->m_v=v; pn[1]->m_v=v; for(i=0,ni=m_links.size();i<ni;++i) { const int mtch=MatchEdge(m_links[i].m_n[0],m_links[i].m_n[1],pa,pb); if(mtch!=-1) { appendLink(i); Link* pft[]={&m_links[i],&m_links[m_links.size()-1]}; pft[0]->m_n[1]=pn[mtch]; pft[1]->m_n[0]=pn[1-mtch]; done=true; } } for(i=0,ni=m_faces.size();i<ni;++i) { for(int k=2,l=0;l<3;k=l++) { const int mtch=MatchEdge(m_faces[i].m_n[k],m_faces[i].m_n[l],pa,pb); if(mtch!=-1) { appendFace(i); Face* pft[]={&m_faces[i],&m_faces[m_faces.size()-1]}; pft[0]->m_n[l]=pn[mtch]; pft[1]->m_n[k]=pn[1-mtch]; appendLink(pn[0],pft[0]->m_n[(l+1)%3],pft[0]->m_material,true); appendLink(pn[1],pft[0]->m_n[(l+1)%3],pft[0]->m_material,true); } } } if(!done) { m_ndbvt.remove(pn[0]->m_leaf); m_ndbvt.remove(pn[1]->m_leaf); m_nodes.pop_back(); m_nodes.pop_back(); } return(done); } // bool btSoftBody::rayTest(const btVector3& rayFrom, const btVector3& rayTo, sRayCast& results) { if(m_faces.size()&&m_fdbvt.empty()) initializeFaceTree(); results.body = this; results.fraction = 1.f; results.feature = eFeature::None; results.index = -1; return(rayTest(rayFrom,rayTo,results.fraction,results.feature,results.index,false)!=0); } // void btSoftBody::setSolver(eSolverPresets::_ preset) { m_cfg.m_vsequence.clear(); m_cfg.m_psequence.clear(); m_cfg.m_dsequence.clear(); switch(preset) { case eSolverPresets::Positions: m_cfg.m_psequence.push_back(ePSolver::Anchors); m_cfg.m_psequence.push_back(ePSolver::RContacts); m_cfg.m_psequence.push_back(ePSolver::SContacts); m_cfg.m_psequence.push_back(ePSolver::Linear); break; case eSolverPresets::Velocities: m_cfg.m_vsequence.push_back(eVSolver::Linear); m_cfg.m_psequence.push_back(ePSolver::Anchors); m_cfg.m_psequence.push_back(ePSolver::RContacts); m_cfg.m_psequence.push_back(ePSolver::SContacts); m_cfg.m_dsequence.push_back(ePSolver::Linear); break; } } // void btSoftBody::predictMotion(btScalar dt) { int i,ni; /* Update */ if(m_bUpdateRtCst) { m_bUpdateRtCst=false; updateConstants(); m_fdbvt.clear(); if(m_cfg.collisions&fCollision::VF_SS) { initializeFaceTree(); } } /* Prepare */ m_sst.sdt = dt*m_cfg.timescale; m_sst.isdt = 1/m_sst.sdt; m_sst.velmrg = m_sst.sdt*3; m_sst.radmrg = getCollisionShape()->getMargin(); m_sst.updmrg = m_sst.radmrg*(btScalar)0.25; /* Forces */ addVelocity(m_worldInfo->m_gravity*m_sst.sdt); applyForces(); /* Integrate */ for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_q = n.m_x; btVector3 deltaV = n.m_f*n.m_im*m_sst.sdt; { btScalar maxDisplacement = m_worldInfo->m_maxDisplacement; btScalar clampDeltaV = maxDisplacement/m_sst.sdt; for (int c=0;c<3;c++) { if (deltaV[c]>clampDeltaV) { deltaV[c] = clampDeltaV; } if (deltaV[c]<-clampDeltaV) { deltaV[c]=-clampDeltaV; } } } n.m_v += deltaV; n.m_x += n.m_v*m_sst.sdt; n.m_f = btVector3(0,0,0); } /* Clusters */ updateClusters(); /* Bounds */ updateBounds(); /* Nodes */ ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; vol = btDbvtVolume::FromCR(n.m_x,m_sst.radmrg); m_ndbvt.update( n.m_leaf, vol, n.m_v*m_sst.velmrg, m_sst.updmrg); } /* Faces */ if(!m_fdbvt.empty()) { for(int i=0;i<m_faces.size();++i) { Face& f=m_faces[i]; const btVector3 v=( f.m_n[0]->m_v+ f.m_n[1]->m_v+ f.m_n[2]->m_v)/3; vol = VolumeOf(f,m_sst.radmrg); m_fdbvt.update( f.m_leaf, vol, v*m_sst.velmrg, m_sst.updmrg); } } /* Pose */ updatePose(); /* Match */ if(m_pose.m_bframe&&(m_cfg.kMT>0)) { const btMatrix3x3 posetrs=m_pose.m_rot; for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; if(n.m_im>0) { const btVector3 x=posetrs*m_pose.m_pos[i]+m_pose.m_com; n.m_x=Lerp(n.m_x,x,m_cfg.kMT); } } } /* Clear contacts */ m_rcontacts.resize(0); m_scontacts.resize(0); /* Optimize dbvt's */ m_ndbvt.optimizeIncremental(1); m_fdbvt.optimizeIncremental(1); m_cdbvt.optimizeIncremental(1); } // void btSoftBody::solveConstraints() { /* Apply clusters */ applyClusters(false); /* Prepare links */ int i,ni; for(i=0,ni=m_links.size();i<ni;++i) { Link& l=m_links[i]; l.m_c3 = l.m_n[1]->m_q-l.m_n[0]->m_q; l.m_c2 = 1/(l.m_c3.length2()*l.m_c0); } /* Prepare anchors */ for(i=0,ni=m_anchors.size();i<ni;++i) { Anchor& a=m_anchors[i]; const btVector3 ra=a.m_body->getWorldTransform().getBasis()*a.m_local; a.m_c0 = ImpulseMatrix( m_sst.sdt, a.m_node->m_im, a.m_body->getInvMass(), a.m_body->getInvInertiaTensorWorld(), ra); a.m_c1 = ra; a.m_c2 = m_sst.sdt*a.m_node->m_im; a.m_body->activate(); } /* Solve velocities */ if(m_cfg.viterations>0) { /* Solve */ for(int isolve=0;isolve<m_cfg.viterations;++isolve) { for(int iseq=0;iseq<m_cfg.m_vsequence.size();++iseq) { getSolver(m_cfg.m_vsequence[iseq])(this,1); } } /* Update */ for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_x = n.m_q+n.m_v*m_sst.sdt; } } /* Solve positions */ if(m_cfg.piterations>0) { for(int isolve=0;isolve<m_cfg.piterations;++isolve) { const btScalar ti=isolve/(btScalar)m_cfg.piterations; for(int iseq=0;iseq<m_cfg.m_psequence.size();++iseq) { getSolver(m_cfg.m_psequence[iseq])(this,1,ti); } } const btScalar vc=m_sst.isdt*(1-m_cfg.kDP); for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_v = (n.m_x-n.m_q)*vc; n.m_f = btVector3(0,0,0); } } /* Solve drift */ if(m_cfg.diterations>0) { const btScalar vcf=m_cfg.kVCF*m_sst.isdt; for(i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_q = n.m_x; } for(int idrift=0;idrift<m_cfg.diterations;++idrift) { for(int iseq=0;iseq<m_cfg.m_dsequence.size();++iseq) { getSolver(m_cfg.m_dsequence[iseq])(this,1,0); } } for(int i=0,ni=m_nodes.size();i<ni;++i) { Node& n=m_nodes[i]; n.m_v += (n.m_x-n.m_q)*vcf; } } /* Apply clusters */ dampClusters(); applyClusters(true); } // void btSoftBody::staticSolve(int iterations) { for(int isolve=0;isolve<iterations;++isolve) { for(int iseq=0;iseq<m_cfg.m_psequence.size();++iseq) { getSolver(m_cfg.m_psequence[iseq])(this,1,0); } } } // void btSoftBody::solveCommonConstraints(btSoftBody** /*bodies*/,int /*count*/,int /*iterations*/) { /// placeholder } // void btSoftBody::solveClusters(const btAlignedObjectArray<btSoftBody*>& bodies) { const int nb=bodies.size(); int iterations=0; int i; for(i=0;i<nb;++i) { iterations=btMax(iterations,bodies[i]->m_cfg.citerations); } for(i=0;i<nb;++i) { bodies[i]->prepareClusters(iterations); } for(i=0;i<iterations;++i) { const btScalar sor=1; for(int j=0;j<nb;++j) { bodies[j]->solveClusters(sor); } } for(i=0;i<nb;++i) { bodies[i]->cleanupClusters(); } } // void btSoftBody::integrateMotion() { /* Update */ updateNormals(); } // btSoftBody::RayFromToCaster::RayFromToCaster(const btVector3& rayFrom,const btVector3& rayTo,btScalar mxt) { m_rayFrom = rayFrom; m_rayNormalizedDirection = (rayTo-rayFrom); m_rayTo = rayTo; m_mint = mxt; m_face = 0; m_tests = 0; } // void btSoftBody::RayFromToCaster::Process(const btDbvtNode* leaf) { btSoftBody::Face& f=*(btSoftBody::Face*)leaf->data; const btScalar t=rayFromToTriangle( m_rayFrom,m_rayTo,m_rayNormalizedDirection, f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x, m_mint); if((t>0)&&(t<m_mint)) { m_mint=t;m_face=&f; } ++m_tests; } // btScalar btSoftBody::RayFromToCaster::rayFromToTriangle( const btVector3& rayFrom, const btVector3& rayTo, const btVector3& rayNormalizedDirection, const btVector3& a, const btVector3& b, const btVector3& c, btScalar maxt) { static const btScalar ceps=-SIMD_EPSILON*10; static const btScalar teps=SIMD_EPSILON*10; const btVector3 n=btCross(b-a,c-a); const btScalar d=btDot(a,n); const btScalar den=btDot(rayNormalizedDirection,n); if(!btFuzzyZero(den)) { const btScalar num=btDot(rayFrom,n)-d; const btScalar t=-num/den; if((t>teps)&&(t<maxt)) { const btVector3 hit=rayFrom+rayNormalizedDirection*t; if( (btDot(n,btCross(a-hit,b-hit))>ceps) && (btDot(n,btCross(b-hit,c-hit))>ceps) && (btDot(n,btCross(c-hit,a-hit))>ceps)) { return(t); } } } return(-1); } // void btSoftBody::pointersToIndices() { #define PTR2IDX(_p_,_b_) reinterpret_cast<btSoftBody::Node*>((_p_)-(_b_)) btSoftBody::Node* base=m_nodes.size() ? &m_nodes[0] : 0; int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { if(m_nodes[i].m_leaf) { m_nodes[i].m_leaf->data=*(void**)&i; } } for(i=0,ni=m_links.size();i<ni;++i) { m_links[i].m_n[0]=PTR2IDX(m_links[i].m_n[0],base); m_links[i].m_n[1]=PTR2IDX(m_links[i].m_n[1],base); } for(i=0,ni=m_faces.size();i<ni;++i) { m_faces[i].m_n[0]=PTR2IDX(m_faces[i].m_n[0],base); m_faces[i].m_n[1]=PTR2IDX(m_faces[i].m_n[1],base); m_faces[i].m_n[2]=PTR2IDX(m_faces[i].m_n[2],base); if(m_faces[i].m_leaf) { m_faces[i].m_leaf->data=*(void**)&i; } } for(i=0,ni=m_anchors.size();i<ni;++i) { m_anchors[i].m_node=PTR2IDX(m_anchors[i].m_node,base); } for(i=0,ni=m_notes.size();i<ni;++i) { for(int j=0;j<m_notes[i].m_rank;++j) { m_notes[i].m_nodes[j]=PTR2IDX(m_notes[i].m_nodes[j],base); } } #undef PTR2IDX } // void btSoftBody::indicesToPointers(const int* map) { #define IDX2PTR(_p_,_b_) map?(&(_b_)[map[(((char*)_p_)-(char*)0)]]): \ (&(_b_)[(((char*)_p_)-(char*)0)]) btSoftBody::Node* base=m_nodes.size() ? &m_nodes[0]:0; int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { if(m_nodes[i].m_leaf) { m_nodes[i].m_leaf->data=&m_nodes[i]; } } for(i=0,ni=m_links.size();i<ni;++i) { m_links[i].m_n[0]=IDX2PTR(m_links[i].m_n[0],base); m_links[i].m_n[1]=IDX2PTR(m_links[i].m_n[1],base); } for(i=0,ni=m_faces.size();i<ni;++i) { m_faces[i].m_n[0]=IDX2PTR(m_faces[i].m_n[0],base); m_faces[i].m_n[1]=IDX2PTR(m_faces[i].m_n[1],base); m_faces[i].m_n[2]=IDX2PTR(m_faces[i].m_n[2],base); if(m_faces[i].m_leaf) { m_faces[i].m_leaf->data=&m_faces[i]; } } for(i=0,ni=m_anchors.size();i<ni;++i) { m_anchors[i].m_node=IDX2PTR(m_anchors[i].m_node,base); } for(i=0,ni=m_notes.size();i<ni;++i) { for(int j=0;j<m_notes[i].m_rank;++j) { m_notes[i].m_nodes[j]=IDX2PTR(m_notes[i].m_nodes[j],base); } } #undef IDX2PTR } // int btSoftBody::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btScalar& mint,eFeature::_& feature,int& index,bool bcountonly) const { int cnt=0; btVector3 dir = rayTo-rayFrom; if(bcountonly||m_fdbvt.empty()) {/* Full search */ for(int i=0,ni=m_faces.size();i<ni;++i) { const btSoftBody::Face& f=m_faces[i]; const btScalar t=RayFromToCaster::rayFromToTriangle( rayFrom,rayTo,dir, f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x, mint); if(t>0) { ++cnt; if(!bcountonly) { feature=btSoftBody::eFeature::Face; index=i; mint=t; } } } } else {/* Use dbvt */ RayFromToCaster collider(rayFrom,rayTo,mint); btDbvt::rayTest(m_fdbvt.m_root,rayFrom,rayTo,collider); if(collider.m_face) { mint=collider.m_mint; feature=btSoftBody::eFeature::Face; index=(int)(collider.m_face-&m_faces[0]); cnt=1; } } for (int i=0;i<m_tetras.size();i++) { const btSoftBody::Tetra& tet = m_tetras[i]; int tetfaces[4][3] = {{0,1,2},{0,1,3},{1,2,3},{0,2,3}}; for (int f=0;f<4;f++) { int index0=tetfaces[f][0]; int index1=tetfaces[f][1]; int index2=tetfaces[f][2]; btVector3 v0=tet.m_n[index0]->m_x; btVector3 v1=tet.m_n[index1]->m_x; btVector3 v2=tet.m_n[index2]->m_x; const btScalar t=RayFromToCaster::rayFromToTriangle( rayFrom,rayTo,dir, v0,v1,v2, mint); if(t>0) { ++cnt; if(!bcountonly) { feature=btSoftBody::eFeature::Tetra; index=i; mint=t; } } } } return(cnt); } // void btSoftBody::initializeFaceTree() { m_fdbvt.clear(); for(int i=0;i<m_faces.size();++i) { Face& f=m_faces[i]; f.m_leaf=m_fdbvt.insert(VolumeOf(f,0),&f); } } // btVector3 btSoftBody::evaluateCom() const { btVector3 com(0,0,0); if(m_pose.m_bframe) { for(int i=0,ni=m_nodes.size();i<ni;++i) { com+=m_nodes[i].m_x*m_pose.m_wgh[i]; } } return(com); } // bool btSoftBody::checkContact( const btCollisionObjectWrapper* colObjWrap, const btVector3& x, btScalar margin, btSoftBody::sCti& cti) const { btVector3 nrm; const btCollisionShape *shp = colObjWrap->getCollisionShape(); // const btRigidBody *tmpRigid = btRigidBody::upcast(colObjWrap->getCollisionObject()); //const btTransform &wtr = tmpRigid ? tmpRigid->getWorldTransform() : colObjWrap->getWorldTransform(); const btTransform &wtr = colObjWrap->getWorldTransform(); //todo: check which transform is needed here btScalar dst = m_worldInfo->m_sparsesdf.Evaluate( wtr.invXform(x), shp, nrm, margin); if(dst<0) { cti.m_colObj = colObjWrap->getCollisionObject(); cti.m_normal = wtr.getBasis()*nrm; cti.m_offset = -btDot( cti.m_normal, x - cti.m_normal * dst ); return(true); } return(false); } // void btSoftBody::updateNormals() { const btVector3 zv(0,0,0); int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_n=zv; } for(i=0,ni=m_faces.size();i<ni;++i) { btSoftBody::Face& f=m_faces[i]; const btVector3 n=btCross(f.m_n[1]->m_x-f.m_n[0]->m_x, f.m_n[2]->m_x-f.m_n[0]->m_x); f.m_normal=n.normalized(); f.m_n[0]->m_n+=n; f.m_n[1]->m_n+=n; f.m_n[2]->m_n+=n; } for(i=0,ni=m_nodes.size();i<ni;++i) { btScalar len = m_nodes[i].m_n.length(); if (len>SIMD_EPSILON) m_nodes[i].m_n /= len; } } // void btSoftBody::updateBounds() { /*if( m_acceleratedSoftBody ) { // If we have an accelerated softbody we need to obtain the bounds correctly // For now (slightly hackily) just have a very large AABB // TODO: Write get bounds kernel // If that is updating in place, atomic collisions might be low (when the cloth isn't perfectly aligned to an axis) and we could // probably do a test and exchange reasonably efficiently. m_bounds[0] = btVector3(-1000, -1000, -1000); m_bounds[1] = btVector3(1000, 1000, 1000); } else {*/ if(m_ndbvt.m_root) { const btVector3& mins=m_ndbvt.m_root->volume.Mins(); const btVector3& maxs=m_ndbvt.m_root->volume.Maxs(); const btScalar csm=getCollisionShape()->getMargin(); const btVector3 mrg=btVector3( csm, csm, csm)*1; // ??? to investigate... m_bounds[0]=mins-mrg; m_bounds[1]=maxs+mrg; if(0!=getBroadphaseHandle()) { m_worldInfo->m_broadphase->setAabb( getBroadphaseHandle(), m_bounds[0], m_bounds[1], m_worldInfo->m_dispatcher); } } else { m_bounds[0]= m_bounds[1]=btVector3(0,0,0); } //} } // void btSoftBody::updatePose() { if(m_pose.m_bframe) { btSoftBody::Pose& pose=m_pose; const btVector3 com=evaluateCom(); /* Com */ pose.m_com = com; /* Rotation */ btMatrix3x3 Apq; const btScalar eps=SIMD_EPSILON; Apq[0]=Apq[1]=Apq[2]=btVector3(0,0,0); Apq[0].setX(eps);Apq[1].setY(eps*2);Apq[2].setZ(eps*3); for(int i=0,ni=m_nodes.size();i<ni;++i) { const btVector3 a=pose.m_wgh[i]*(m_nodes[i].m_x-com); const btVector3& b=pose.m_pos[i]; Apq[0]+=a.x()*b; Apq[1]+=a.y()*b; Apq[2]+=a.z()*b; } btMatrix3x3 r,s; PolarDecompose(Apq,r,s); pose.m_rot=r; pose.m_scl=pose.m_aqq*r.transpose()*Apq; if(m_cfg.maxvolume>1) { const btScalar idet=Clamp<btScalar>( 1/pose.m_scl.determinant(), 1,m_cfg.maxvolume); pose.m_scl=Mul(pose.m_scl,idet); } } } // void btSoftBody::updateArea(bool averageArea) { int i,ni; /* Face area */ for(i=0,ni=m_faces.size();i<ni;++i) { Face& f=m_faces[i]; f.m_ra = AreaOf(f.m_n[0]->m_x,f.m_n[1]->m_x,f.m_n[2]->m_x); } /* Node area */ if (averageArea) { btAlignedObjectArray<int> counts; counts.resize(m_nodes.size(),0); for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_area = 0; } for(i=0,ni=m_faces.size();i<ni;++i) { btSoftBody::Face& f=m_faces[i]; for(int j=0;j<3;++j) { const int index=(int)(f.m_n[j]-&m_nodes[0]); counts[index]++; f.m_n[j]->m_area+=btFabs(f.m_ra); } } for(i=0,ni=m_nodes.size();i<ni;++i) { if(counts[i]>0) m_nodes[i].m_area/=(btScalar)counts[i]; else m_nodes[i].m_area=0; } } else { // initialize node area as zero for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_area=0; } for(i=0,ni=m_faces.size();i<ni;++i) { btSoftBody::Face& f=m_faces[i]; for(int j=0;j<3;++j) { f.m_n[j]->m_area += f.m_ra; } } for(i=0,ni=m_nodes.size();i<ni;++i) { m_nodes[i].m_area *= 0.3333333f; } } } void btSoftBody::updateLinkConstants() { int i,ni; /* Links */ for(i=0,ni=m_links.size();i<ni;++i) { Link& l=m_links[i]; Material& m=*l.m_material; l.m_c0 = (l.m_n[0]->m_im+l.m_n[1]->m_im)/m.m_kLST; } } void btSoftBody::updateConstants() { resetLinkRestLengths(); updateLinkConstants(); updateArea(); } // void btSoftBody::initializeClusters() { int i; for( i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; c.m_imass=0; c.m_masses.resize(c.m_nodes.size()); for(int j=0;j<c.m_nodes.size();++j) { if (c.m_nodes[j]->m_im==0) { c.m_containsAnchor = true; c.m_masses[j] = BT_LARGE_FLOAT; } else { c.m_masses[j] = btScalar(1.)/c.m_nodes[j]->m_im; } c.m_imass += c.m_masses[j]; } c.m_imass = btScalar(1.)/c.m_imass; c.m_com = btSoftBody::clusterCom(&c); c.m_lv = btVector3(0,0,0); c.m_av = btVector3(0,0,0); c.m_leaf = 0; /* Inertia */ btMatrix3x3& ii=c.m_locii; ii[0]=ii[1]=ii[2]=btVector3(0,0,0); { int i,ni; for(i=0,ni=c.m_nodes.size();i<ni;++i) { const btVector3 k=c.m_nodes[i]->m_x-c.m_com; const btVector3 q=k*k; const btScalar m=c.m_masses[i]; ii[0][0] += m*(q[1]+q[2]); ii[1][1] += m*(q[0]+q[2]); ii[2][2] += m*(q[0]+q[1]); ii[0][1] -= m*k[0]*k[1]; ii[0][2] -= m*k[0]*k[2]; ii[1][2] -= m*k[1]*k[2]; } } ii[1][0]=ii[0][1]; ii[2][0]=ii[0][2]; ii[2][1]=ii[1][2]; ii = ii.inverse(); /* Frame */ c.m_framexform.setIdentity(); c.m_framexform.setOrigin(c.m_com); c.m_framerefs.resize(c.m_nodes.size()); { int i; for(i=0;i<c.m_framerefs.size();++i) { c.m_framerefs[i]=c.m_nodes[i]->m_x-c.m_com; } } } } // void btSoftBody::updateClusters() { BT_PROFILE("UpdateClusters"); int i; for(i=0;i<m_clusters.size();++i) { btSoftBody::Cluster& c=*m_clusters[i]; const int n=c.m_nodes.size(); //const btScalar invn=1/(btScalar)n; if(n) { /* Frame */ const btScalar eps=btScalar(0.0001); btMatrix3x3 m,r,s; m[0]=m[1]=m[2]=btVector3(0,0,0); m[0][0]=eps*1; m[1][1]=eps*2; m[2][2]=eps*3; c.m_com=clusterCom(&c); for(int i=0;i<c.m_nodes.size();++i) { const btVector3 a=c.m_nodes[i]->m_x-c.m_com; const btVector3& b=c.m_framerefs[i]; m[0]+=a[0]*b;m[1]+=a[1]*b;m[2]+=a[2]*b; } PolarDecompose(m,r,s); c.m_framexform.setOrigin(c.m_com); c.m_framexform.setBasis(r); /* Inertia */ #if 1/* Constant */ c.m_invwi=c.m_framexform.getBasis()*c.m_locii*c.m_framexform.getBasis().transpose(); #else #if 0/* Sphere */ const btScalar rk=(2*c.m_extents.length2())/(5*c.m_imass); const btVector3 inertia(rk,rk,rk); const btVector3 iin(btFabs(inertia[0])>SIMD_EPSILON?1/inertia[0]:0, btFabs(inertia[1])>SIMD_EPSILON?1/inertia[1]:0, btFabs(inertia[2])>SIMD_EPSILON?1/inertia[2]:0); c.m_invwi=c.m_xform.getBasis().scaled(iin)*c.m_xform.getBasis().transpose(); #else/* Actual */ c.m_invwi[0]=c.m_invwi[1]=c.m_invwi[2]=btVector3(0,0,0); for(int i=0;i<n;++i) { const btVector3 k=c.m_nodes[i]->m_x-c.m_com; const btVector3 q=k*k; const btScalar m=1/c.m_nodes[i]->m_im; c.m_invwi[0][0] += m*(q[1]+q[2]); c.m_invwi[1][1] += m*(q[0]+q[2]); c.m_invwi[2][2] += m*(q[0]+q[1]); c.m_invwi[0][1] -= m*k[0]*k[1]; c.m_invwi[0][2] -= m*k[0]*k[2]; c.m_invwi[1][2] -= m*k[1]*k[2]; } c.m_invwi[1][0]=c.m_invwi[0][1]; c.m_invwi[2][0]=c.m_invwi[0][2]; c.m_invwi[2][1]=c.m_invwi[1][2]; c.m_invwi=c.m_invwi.inverse(); #endif #endif /* Velocities */ c.m_lv=btVector3(0,0,0); c.m_av=btVector3(0,0,0); { int i; for(i=0;i<n;++i) { const btVector3 v=c.m_nodes[i]->m_v*c.m_masses[i]; c.m_lv += v; c.m_av += btCross(c.m_nodes[i]->m_x-c.m_com,v); } } c.m_lv=c.m_imass*c.m_lv*(1-c.m_ldamping); c.m_av=c.m_invwi*c.m_av*(1-c.m_adamping); c.m_vimpulses[0] = c.m_vimpulses[1] = btVector3(0,0,0); c.m_dimpulses[0] = c.m_dimpulses[1] = btVector3(0,0,0); c.m_nvimpulses = 0; c.m_ndimpulses = 0; /* Matching */ if(c.m_matching>0) { for(int j=0;j<c.m_nodes.size();++j) { Node& n=*c.m_nodes[j]; const btVector3 x=c.m_framexform*c.m_framerefs[j]; n.m_x=Lerp(n.m_x,x,c.m_matching); } } /* Dbvt */ if(c.m_collide) { btVector3 mi=c.m_nodes[0]->m_x; btVector3 mx=mi; for(int j=1;j<n;++j) { mi.setMin(c.m_nodes[j]->m_x); mx.setMax(c.m_nodes[j]->m_x); } ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds=btDbvtVolume::FromMM(mi,mx); if(c.m_leaf) m_cdbvt.update(c.m_leaf,bounds,c.m_lv*m_sst.sdt*3,m_sst.radmrg); else c.m_leaf=m_cdbvt.insert(bounds,&c); } } } } // void btSoftBody::cleanupClusters() { for(int i=0;i<m_joints.size();++i) { m_joints[i]->Terminate(m_sst.sdt); if(m_joints[i]->m_delete) { btAlignedFree(m_joints[i]); m_joints.remove(m_joints[i--]); } } } // void btSoftBody::prepareClusters(int iterations) { for(int i=0;i<m_joints.size();++i) { m_joints[i]->Prepare(m_sst.sdt,iterations); } } // void btSoftBody::solveClusters(btScalar sor) { for(int i=0,ni=m_joints.size();i<ni;++i) { m_joints[i]->Solve(m_sst.sdt,sor); } } // void btSoftBody::applyClusters(bool drift) { BT_PROFILE("ApplyClusters"); // const btScalar f0=m_sst.sdt; //const btScalar f1=f0/2; btAlignedObjectArray<btVector3> deltas; btAlignedObjectArray<btScalar> weights; deltas.resize(m_nodes.size(),btVector3(0,0,0)); weights.resize(m_nodes.size(),0); int i; if(drift) { for(i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; if(c.m_ndimpulses) { c.m_dimpulses[0]/=(btScalar)c.m_ndimpulses; c.m_dimpulses[1]/=(btScalar)c.m_ndimpulses; } } } for(i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; if(0<(drift?c.m_ndimpulses:c.m_nvimpulses)) { const btVector3 v=(drift?c.m_dimpulses[0]:c.m_vimpulses[0])*m_sst.sdt; const btVector3 w=(drift?c.m_dimpulses[1]:c.m_vimpulses[1])*m_sst.sdt; for(int j=0;j<c.m_nodes.size();++j) { const int idx=int(c.m_nodes[j]-&m_nodes[0]); const btVector3& x=c.m_nodes[j]->m_x; const btScalar q=c.m_masses[j]; deltas[idx] += (v+btCross(w,x-c.m_com))*q; weights[idx] += q; } } } for(i=0;i<deltas.size();++i) { if(weights[i]>0) { m_nodes[i].m_x+=deltas[i]/weights[i]; } } } // void btSoftBody::dampClusters() { int i; for(i=0;i<m_clusters.size();++i) { Cluster& c=*m_clusters[i]; if(c.m_ndamping>0) { for(int j=0;j<c.m_nodes.size();++j) { Node& n=*c.m_nodes[j]; if(n.m_im>0) { const btVector3 vx=c.m_lv+btCross(c.m_av,c.m_nodes[j]->m_q-c.m_com); if(vx.length2()<=n.m_v.length2()) { n.m_v += c.m_ndamping*(vx-n.m_v); } } } } } } // void btSoftBody::Joint::Prepare(btScalar dt,int) { m_bodies[0].activate(); m_bodies[1].activate(); } // void btSoftBody::LJoint::Prepare(btScalar dt,int iterations) { static const btScalar maxdrift=4; Joint::Prepare(dt,iterations); m_rpos[0] = m_bodies[0].xform()*m_refs[0]; m_rpos[1] = m_bodies[1].xform()*m_refs[1]; m_drift = Clamp(m_rpos[0]-m_rpos[1],maxdrift)*m_erp/dt; m_rpos[0] -= m_bodies[0].xform().getOrigin(); m_rpos[1] -= m_bodies[1].xform().getOrigin(); m_massmatrix = ImpulseMatrix( m_bodies[0].invMass(),m_bodies[0].invWorldInertia(),m_rpos[0], m_bodies[1].invMass(),m_bodies[1].invWorldInertia(),m_rpos[1]); if(m_split>0) { m_sdrift = m_massmatrix*(m_drift*m_split); m_drift *= 1-m_split; } m_drift /=(btScalar)iterations; } // void btSoftBody::LJoint::Solve(btScalar dt,btScalar sor) { const btVector3 va=m_bodies[0].velocity(m_rpos[0]); const btVector3 vb=m_bodies[1].velocity(m_rpos[1]); const btVector3 vr=va-vb; btSoftBody::Impulse impulse; impulse.m_asVelocity = 1; impulse.m_velocity = m_massmatrix*(m_drift+vr*m_cfm)*sor; m_bodies[0].applyImpulse(-impulse,m_rpos[0]); m_bodies[1].applyImpulse( impulse,m_rpos[1]); } // void btSoftBody::LJoint::Terminate(btScalar dt) { if(m_split>0) { m_bodies[0].applyDImpulse(-m_sdrift,m_rpos[0]); m_bodies[1].applyDImpulse( m_sdrift,m_rpos[1]); } } // void btSoftBody::AJoint::Prepare(btScalar dt,int iterations) { static const btScalar maxdrift=SIMD_PI/16; m_icontrol->Prepare(this); Joint::Prepare(dt,iterations); m_axis[0] = m_bodies[0].xform().getBasis()*m_refs[0]; m_axis[1] = m_bodies[1].xform().getBasis()*m_refs[1]; m_drift = NormalizeAny(btCross(m_axis[1],m_axis[0])); m_drift *= btMin(maxdrift,btAcos(Clamp<btScalar>(btDot(m_axis[0],m_axis[1]),-1,+1))); m_drift *= m_erp/dt; m_massmatrix= AngularImpulseMatrix(m_bodies[0].invWorldInertia(),m_bodies[1].invWorldInertia()); if(m_split>0) { m_sdrift = m_massmatrix*(m_drift*m_split); m_drift *= 1-m_split; } m_drift /=(btScalar)iterations; } // void btSoftBody::AJoint::Solve(btScalar dt,btScalar sor) { const btVector3 va=m_bodies[0].angularVelocity(); const btVector3 vb=m_bodies[1].angularVelocity(); const btVector3 vr=va-vb; const btScalar sp=btDot(vr,m_axis[0]); const btVector3 vc=vr-m_axis[0]*m_icontrol->Speed(this,sp); btSoftBody::Impulse impulse; impulse.m_asVelocity = 1; impulse.m_velocity = m_massmatrix*(m_drift+vc*m_cfm)*sor; m_bodies[0].applyAImpulse(-impulse); m_bodies[1].applyAImpulse( impulse); } // void btSoftBody::AJoint::Terminate(btScalar dt) { if(m_split>0) { m_bodies[0].applyDAImpulse(-m_sdrift); m_bodies[1].applyDAImpulse( m_sdrift); } } // void btSoftBody::CJoint::Prepare(btScalar dt,int iterations) { Joint::Prepare(dt,iterations); const bool dodrift=(m_life==0); m_delete=(++m_life)>m_maxlife; if(dodrift) { m_drift=m_drift*m_erp/dt; if(m_split>0) { m_sdrift = m_massmatrix*(m_drift*m_split); m_drift *= 1-m_split; } m_drift/=(btScalar)iterations; } else { m_drift=m_sdrift=btVector3(0,0,0); } } // void btSoftBody::CJoint::Solve(btScalar dt,btScalar sor) { const btVector3 va=m_bodies[0].velocity(m_rpos[0]); const btVector3 vb=m_bodies[1].velocity(m_rpos[1]); const btVector3 vrel=va-vb; const btScalar rvac=btDot(vrel,m_normal); btSoftBody::Impulse impulse; impulse.m_asVelocity = 1; impulse.m_velocity = m_drift; if(rvac<0) { const btVector3 iv=m_normal*rvac; const btVector3 fv=vrel-iv; impulse.m_velocity += iv+fv*m_friction; } impulse.m_velocity=m_massmatrix*impulse.m_velocity*sor; if (m_bodies[0].m_soft==m_bodies[1].m_soft) { if ((impulse.m_velocity.getX() ==impulse.m_velocity.getX())&&(impulse.m_velocity.getY() ==impulse.m_velocity.getY())&& (impulse.m_velocity.getZ() ==impulse.m_velocity.getZ())) { if (impulse.m_asVelocity) { if (impulse.m_velocity.length() <m_bodies[0].m_soft->m_maxSelfCollisionImpulse) { } else { m_bodies[0].applyImpulse(-impulse*m_bodies[0].m_soft->m_selfCollisionImpulseFactor,m_rpos[0]); m_bodies[1].applyImpulse( impulse*m_bodies[0].m_soft->m_selfCollisionImpulseFactor,m_rpos[1]); } } } } else { m_bodies[0].applyImpulse(-impulse,m_rpos[0]); m_bodies[1].applyImpulse( impulse,m_rpos[1]); } } // void btSoftBody::CJoint::Terminate(btScalar dt) { if(m_split>0) { m_bodies[0].applyDImpulse(-m_sdrift,m_rpos[0]); m_bodies[1].applyDImpulse( m_sdrift,m_rpos[1]); } } // void btSoftBody::applyForces() { BT_PROFILE("SoftBody applyForces"); // const btScalar dt = m_sst.sdt; const btScalar kLF = m_cfg.kLF; const btScalar kDG = m_cfg.kDG; const btScalar kPR = m_cfg.kPR; const btScalar kVC = m_cfg.kVC; const bool as_lift = kLF>0; const bool as_drag = kDG>0; const bool as_pressure = kPR!=0; const bool as_volume = kVC>0; const bool as_aero = as_lift || as_drag ; //const bool as_vaero = as_aero && // (m_cfg.aeromodel < btSoftBody::eAeroModel::F_TwoSided); //const bool as_faero = as_aero && // (m_cfg.aeromodel >= btSoftBody::eAeroModel::F_TwoSided); const bool use_medium = as_aero; const bool use_volume = as_pressure || as_volume ; btScalar volume = 0; btScalar ivolumetp = 0; btScalar dvolumetv = 0; btSoftBody::sMedium medium; if(use_volume) { volume = getVolume(); ivolumetp = 1/btFabs(volume)*kPR; dvolumetv = (m_pose.m_volume-volume)*kVC; } /* Per vertex forces */ int i,ni; for(i=0,ni=m_nodes.size();i<ni;++i) { btSoftBody::Node& n=m_nodes[i]; if(n.m_im>0) { if(use_medium) { /* Aerodynamics */ addAeroForceToNode(m_windVelocity, i); } /* Pressure */ if(as_pressure) { n.m_f += n.m_n*(n.m_area*ivolumetp); } /* Volume */ if(as_volume) { n.m_f += n.m_n*(n.m_area*dvolumetv); } } } /* Per face forces */ for(i=0,ni=m_faces.size();i<ni;++i) { // btSoftBody::Face& f=m_faces[i]; /* Aerodynamics */ addAeroForceToFace(m_windVelocity, i); } } // void btSoftBody::PSolve_Anchors(btSoftBody* psb,btScalar kst,btScalar ti) { BT_PROFILE("PSolve_Anchors"); const btScalar kAHR=psb->m_cfg.kAHR*kst; const btScalar dt=psb->m_sst.sdt; for(int i=0,ni=psb->m_anchors.size();i<ni;++i) { const Anchor& a=psb->m_anchors[i]; const btTransform& t=a.m_body->getWorldTransform(); Node& n=*a.m_node; const btVector3 wa=t*a.m_local; const btVector3 va=a.m_body->getVelocityInLocalPoint(a.m_c1)*dt; const btVector3 vb=n.m_x-n.m_q; const btVector3 vr=(va-vb)+(wa-n.m_x)*kAHR; const btVector3 impulse=a.m_c0*vr*a.m_influence; n.m_x+=impulse*a.m_c2; a.m_body->applyImpulse(-impulse,a.m_c1); } } // void btSoftBody::PSolve_RContacts(btSoftBody* psb, btScalar kst, btScalar ti) { BT_PROFILE("PSolve_RContacts"); const btScalar dt = psb->m_sst.sdt; const btScalar mrg = psb->getCollisionShape()->getMargin(); btMultiBodyJacobianData jacobianData; for(int i=0,ni=psb->m_rcontacts.size();i<ni;++i) { const RContact& c = psb->m_rcontacts[i]; const sCti& cti = c.m_cti; if (cti.m_colObj->hasContactResponse()) { btVector3 va(0,0,0); btRigidBody* rigidCol=0; btMultiBodyLinkCollider* multibodyLinkCol=0; btScalar* deltaV; if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY) { rigidCol = (btRigidBody*)btRigidBody::upcast(cti.m_colObj); va = rigidCol ? rigidCol->getVelocityInLocalPoint(c.m_c1)*dt : btVector3(0,0,0); } else if (cti.m_colObj->getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK) { multibodyLinkCol = (btMultiBodyLinkCollider*)btMultiBodyLinkCollider::upcast(cti.m_colObj); if (multibodyLinkCol) { const int ndof = multibodyLinkCol->m_multiBody->getNumDofs() + 6; jacobianData.m_jacobians.resize(ndof); jacobianData.m_deltaVelocitiesUnitImpulse.resize(ndof); btScalar* jac=&jacobianData.m_jacobians[0]; multibodyLinkCol->m_multiBody->fillContactJacobianMultiDof(multibodyLinkCol->m_link, c.m_node->m_x, cti.m_normal, jac, jacobianData.scratch_r, jacobianData.scratch_v, jacobianData.scratch_m); deltaV = &jacobianData.m_deltaVelocitiesUnitImpulse[0]; multibodyLinkCol->m_multiBody->calcAccelerationDeltasMultiDof(&jacobianData.m_jacobians[0],deltaV,jacobianData.scratch_r, jacobianData.scratch_v); btScalar vel = 0.0; for (int j = 0; j < ndof ; ++j) { vel += multibodyLinkCol->m_multiBody->getVelocityVector()[j] * jac[j]; } va = cti.m_normal*vel*dt; } } const btVector3 vb = c.m_node->m_x-c.m_node->m_q; const btVector3 vr = vb-va; const btScalar dn = btDot(vr, cti.m_normal); if(dn<=SIMD_EPSILON) { const btScalar dp = btMin( (btDot(c.m_node->m_x, cti.m_normal) + cti.m_offset), mrg ); const btVector3 fv = vr - (cti.m_normal * dn); // c0 is the impulse matrix, c3 is 1 - the friction coefficient or 0, c4 is the contact hardness coefficient const btVector3 impulse = c.m_c0 * ( (vr - (fv * c.m_c3) + (cti.m_normal * (dp * c.m_c4))) * kst ); c.m_node->m_x -= impulse * c.m_c2; if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY) { if (rigidCol) rigidCol->applyImpulse(impulse,c.m_c1); } else if (cti.m_colObj->getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK) { if (multibodyLinkCol) { double multiplier = 0.5; multibodyLinkCol->m_multiBody->applyDeltaVeeMultiDof(deltaV,-impulse.length()*multiplier); } } } } } } // void btSoftBody::PSolve_SContacts(btSoftBody* psb,btScalar,btScalar ti) { BT_PROFILE("PSolve_SContacts"); for(int i=0,ni=psb->m_scontacts.size();i<ni;++i) { const SContact& c=psb->m_scontacts[i]; const btVector3& nr=c.m_normal; Node& n=*c.m_node; Face& f=*c.m_face; const btVector3 p=BaryEval( f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x, c.m_weights); const btVector3 q=BaryEval( f.m_n[0]->m_q, f.m_n[1]->m_q, f.m_n[2]->m_q, c.m_weights); const btVector3 vr=(n.m_x-n.m_q)-(p-q); btVector3 corr(0,0,0); btScalar dot = btDot(vr,nr); if(dot<0) { const btScalar j=c.m_margin-(btDot(nr,n.m_x)-btDot(nr,p)); corr+=c.m_normal*j; } corr -= ProjectOnPlane(vr,nr)*c.m_friction; n.m_x += corr*c.m_cfm[0]; f.m_n[0]->m_x -= corr*(c.m_cfm[1]*c.m_weights.x()); f.m_n[1]->m_x -= corr*(c.m_cfm[1]*c.m_weights.y()); f.m_n[2]->m_x -= corr*(c.m_cfm[1]*c.m_weights.z()); } } // void btSoftBody::PSolve_Links(btSoftBody* psb,btScalar kst,btScalar ti) { BT_PROFILE("PSolve_Links"); for(int i=0,ni=psb->m_links.size();i<ni;++i) { Link& l=psb->m_links[i]; if(l.m_c0>0) { Node& a=*l.m_n[0]; Node& b=*l.m_n[1]; const btVector3 del=b.m_x-a.m_x; const btScalar len=del.length2(); if (l.m_c1+len > SIMD_EPSILON) { const btScalar k=((l.m_c1-len)/(l.m_c0*(l.m_c1+len)))*kst; a.m_x-=del*(k*a.m_im); b.m_x+=del*(k*b.m_im); } } } } // void btSoftBody::VSolve_Links(btSoftBody* psb,btScalar kst) { BT_PROFILE("VSolve_Links"); for(int i=0,ni=psb->m_links.size();i<ni;++i) { Link& l=psb->m_links[i]; Node** n=l.m_n; const btScalar j=-btDot(l.m_c3,n[0]->m_v-n[1]->m_v)*l.m_c2*kst; n[0]->m_v+= l.m_c3*(j*n[0]->m_im); n[1]->m_v-= l.m_c3*(j*n[1]->m_im); } } // btSoftBody::psolver_t btSoftBody::getSolver(ePSolver::_ solver) { switch(solver) { case ePSolver::Anchors: return(&btSoftBody::PSolve_Anchors); case ePSolver::Linear: return(&btSoftBody::PSolve_Links); case ePSolver::RContacts: return(&btSoftBody::PSolve_RContacts); case ePSolver::SContacts: return(&btSoftBody::PSolve_SContacts); default: { } } return(0); } // btSoftBody::vsolver_t btSoftBody::getSolver(eVSolver::_ solver) { switch(solver) { case eVSolver::Linear: return(&btSoftBody::VSolve_Links); default: { } } return(0); } // void btSoftBody::defaultCollisionHandler(const btCollisionObjectWrapper* pcoWrap) { switch(m_cfg.collisions&fCollision::RVSmask) { case fCollision::SDF_RS: { btSoftColliders::CollideSDF_RS docollide; btRigidBody* prb1=(btRigidBody*) btRigidBody::upcast(pcoWrap->getCollisionObject()); btTransform wtr=pcoWrap->getWorldTransform(); const btTransform ctr=pcoWrap->getWorldTransform(); const btScalar timemargin=(wtr.getOrigin()-ctr.getOrigin()).length(); const btScalar basemargin=getCollisionShape()->getMargin(); btVector3 mins; btVector3 maxs; ATTRIBUTE_ALIGNED16(btDbvtVolume) volume; pcoWrap->getCollisionShape()->getAabb( pcoWrap->getWorldTransform(), mins, maxs); volume=btDbvtVolume::FromMM(mins,maxs); volume.Expand(btVector3(basemargin,basemargin,basemargin)); docollide.psb = this; docollide.m_colObj1Wrap = pcoWrap; docollide.m_rigidBody = prb1; docollide.dynmargin = basemargin+timemargin; docollide.stamargin = basemargin; m_ndbvt.collideTV(m_ndbvt.m_root,volume,docollide); } break; case fCollision::CL_RS: { btSoftColliders::CollideCL_RS collider; collider.ProcessColObj(this,pcoWrap); } break; } } // void btSoftBody::defaultCollisionHandler(btSoftBody* psb) { const int cf=m_cfg.collisions&psb->m_cfg.collisions; switch(cf&fCollision::SVSmask) { case fCollision::CL_SS: { //support self-collision if CL_SELF flag set if (this!=psb || psb->m_cfg.collisions&fCollision::CL_SELF) { btSoftColliders::CollideCL_SS docollide; docollide.ProcessSoftSoft(this,psb); } } break; case fCollision::VF_SS: { //only self-collision for Cluster, not Vertex-Face yet if (this!=psb) { btSoftColliders::CollideVF_SS docollide; /* common */ docollide.mrg= getCollisionShape()->getMargin()+ psb->getCollisionShape()->getMargin(); /* psb0 nodes vs psb1 faces */ docollide.psb[0]=this; docollide.psb[1]=psb; docollide.psb[0]->m_ndbvt.collideTT( docollide.psb[0]->m_ndbvt.m_root, docollide.psb[1]->m_fdbvt.m_root, docollide); /* psb1 nodes vs psb0 faces */ docollide.psb[0]=psb; docollide.psb[1]=this; docollide.psb[0]->m_ndbvt.collideTT( docollide.psb[0]->m_ndbvt.m_root, docollide.psb[1]->m_fdbvt.m_root, docollide); } } break; default: { } } } void btSoftBody::setWindVelocity( const btVector3 &velocity ) { m_windVelocity = velocity; } const btVector3& btSoftBody::getWindVelocity() { return m_windVelocity; } int btSoftBody::calculateSerializeBufferSize() const { int sz = sizeof(btSoftBodyData); return sz; } ///fills the dataBuffer and returns the struct name (and 0 on failure) const char* btSoftBody::serialize(void* dataBuffer, class btSerializer* serializer) const { btSoftBodyData* sbd = (btSoftBodyData*) dataBuffer; btCollisionObject::serialize(&sbd->m_collisionObjectData, serializer); btHashMap<btHashPtr,int> m_nodeIndexMap; sbd->m_numMaterials = m_materials.size(); sbd->m_materials = sbd->m_numMaterials? (SoftBodyMaterialData**) serializer->getUniquePointer((void*)&m_materials): 0; if (sbd->m_materials) { int sz = sizeof(SoftBodyMaterialData*); int numElem = sbd->m_numMaterials; btChunk* chunk = serializer->allocate(sz,numElem); //SoftBodyMaterialData** memPtr = chunk->m_oldPtr; SoftBodyMaterialData** memPtr = (SoftBodyMaterialData**)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { btSoftBody::Material* mat = m_materials[i]; *memPtr = mat ? (SoftBodyMaterialData*)serializer->getUniquePointer((void*)mat) : 0; if (!serializer->findPointer(mat)) { //serialize it here btChunk* chunk = serializer->allocate(sizeof(SoftBodyMaterialData),1); SoftBodyMaterialData* memPtr = (SoftBodyMaterialData*)chunk->m_oldPtr; memPtr->m_flags = mat->m_flags; memPtr->m_angularStiffness = mat->m_kAST; memPtr->m_linearStiffness = mat->m_kLST; memPtr->m_volumeStiffness = mat->m_kVST; serializer->finalizeChunk(chunk,"SoftBodyMaterialData",BT_SBMATERIAL_CODE,mat); } } serializer->finalizeChunk(chunk,"SoftBodyMaterialData",BT_ARRAY_CODE,(void*) &m_materials); } sbd->m_numNodes = m_nodes.size(); sbd->m_nodes = sbd->m_numNodes ? (SoftBodyNodeData*)serializer->getUniquePointer((void*)&m_nodes): 0; if (sbd->m_nodes) { int sz = sizeof(SoftBodyNodeData); int numElem = sbd->m_numNodes; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyNodeData* memPtr = (SoftBodyNodeData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { m_nodes[i].m_f.serializeFloat( memPtr->m_accumulatedForce); memPtr->m_area = m_nodes[i].m_area; memPtr->m_attach = m_nodes[i].m_battach; memPtr->m_inverseMass = m_nodes[i].m_im; memPtr->m_material = m_nodes[i].m_material? (SoftBodyMaterialData*)serializer->getUniquePointer((void*) m_nodes[i].m_material):0; m_nodes[i].m_n.serializeFloat(memPtr->m_normal); m_nodes[i].m_x.serializeFloat(memPtr->m_position); m_nodes[i].m_q.serializeFloat(memPtr->m_previousPosition); m_nodes[i].m_v.serializeFloat(memPtr->m_velocity); m_nodeIndexMap.insert(&m_nodes[i],i); } serializer->finalizeChunk(chunk,"SoftBodyNodeData",BT_SBNODE_CODE,(void*) &m_nodes); } sbd->m_numLinks = m_links.size(); sbd->m_links = sbd->m_numLinks? (SoftBodyLinkData*) serializer->getUniquePointer((void*)&m_links[0]):0; if (sbd->m_links) { int sz = sizeof(SoftBodyLinkData); int numElem = sbd->m_numLinks; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyLinkData* memPtr = (SoftBodyLinkData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_bbending = m_links[i].m_bbending; memPtr->m_material = m_links[i].m_material? (SoftBodyMaterialData*)serializer->getUniquePointer((void*) m_links[i].m_material):0; memPtr->m_nodeIndices[0] = m_links[i].m_n[0] ? m_links[i].m_n[0] - &m_nodes[0]: -1; memPtr->m_nodeIndices[1] = m_links[i].m_n[1] ? m_links[i].m_n[1] - &m_nodes[0]: -1; btAssert(memPtr->m_nodeIndices[0]<m_nodes.size()); btAssert(memPtr->m_nodeIndices[1]<m_nodes.size()); memPtr->m_restLength = m_links[i].m_rl; } serializer->finalizeChunk(chunk,"SoftBodyLinkData",BT_ARRAY_CODE,(void*) &m_links[0]); } sbd->m_numFaces = m_faces.size(); sbd->m_faces = sbd->m_numFaces? (SoftBodyFaceData*) serializer->getUniquePointer((void*)&m_faces[0]):0; if (sbd->m_faces) { int sz = sizeof(SoftBodyFaceData); int numElem = sbd->m_numFaces; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyFaceData* memPtr = (SoftBodyFaceData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_material = m_faces[i].m_material ? (SoftBodyMaterialData*) serializer->getUniquePointer((void*)m_faces[i].m_material): 0; m_faces[i].m_normal.serializeFloat( memPtr->m_normal); for (int j=0;j<3;j++) { memPtr->m_nodeIndices[j] = m_faces[i].m_n[j]? m_faces[i].m_n[j] - &m_nodes[0]: -1; } memPtr->m_restArea = m_faces[i].m_ra; } serializer->finalizeChunk(chunk,"SoftBodyFaceData",BT_ARRAY_CODE,(void*) &m_faces[0]); } sbd->m_numTetrahedra = m_tetras.size(); sbd->m_tetrahedra = sbd->m_numTetrahedra ? (SoftBodyTetraData*) serializer->getUniquePointer((void*)&m_tetras[0]):0; if (sbd->m_tetrahedra) { int sz = sizeof(SoftBodyTetraData); int numElem = sbd->m_numTetrahedra; btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyTetraData* memPtr = (SoftBodyTetraData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { for (int j=0;j<4;j++) { m_tetras[i].m_c0[j].serializeFloat( memPtr->m_c0[j] ); memPtr->m_nodeIndices[j] = m_tetras[j].m_n[j]? m_tetras[j].m_n[j]-&m_nodes[0] : -1; } memPtr->m_c1 = m_tetras[i].m_c1; memPtr->m_c2 = m_tetras[i].m_c2; memPtr->m_material = m_tetras[i].m_material ? (SoftBodyMaterialData*)serializer->getUniquePointer((void*) m_tetras[i].m_material): 0; memPtr->m_restVolume = m_tetras[i].m_rv; } serializer->finalizeChunk(chunk,"SoftBodyTetraData",BT_ARRAY_CODE,(void*) &m_tetras[0]); } sbd->m_numAnchors = m_anchors.size(); sbd->m_anchors = sbd->m_numAnchors ? (SoftRigidAnchorData*) serializer->getUniquePointer((void*)&m_anchors[0]):0; if (sbd->m_anchors) { int sz = sizeof(SoftRigidAnchorData); int numElem = sbd->m_numAnchors; btChunk* chunk = serializer->allocate(sz,numElem); SoftRigidAnchorData* memPtr = (SoftRigidAnchorData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { m_anchors[i].m_c0.serializeFloat(memPtr->m_c0); m_anchors[i].m_c1.serializeFloat(memPtr->m_c1); memPtr->m_c2 = m_anchors[i].m_c2; m_anchors[i].m_local.serializeFloat(memPtr->m_localFrame); memPtr->m_nodeIndex = m_anchors[i].m_node? m_anchors[i].m_node-&m_nodes[0]: -1; memPtr->m_rigidBody = m_anchors[i].m_body? (btRigidBodyData*) serializer->getUniquePointer((void*)m_anchors[i].m_body): 0; btAssert(memPtr->m_nodeIndex < m_nodes.size()); } serializer->finalizeChunk(chunk,"SoftRigidAnchorData",BT_ARRAY_CODE,(void*) &m_anchors[0]); } sbd->m_config.m_dynamicFriction = m_cfg.kDF; sbd->m_config.m_baumgarte = m_cfg.kVCF; sbd->m_config.m_pressure = m_cfg.kPR; sbd->m_config.m_aeroModel = this->m_cfg.aeromodel; sbd->m_config.m_lift = m_cfg.kLF; sbd->m_config.m_drag = m_cfg.kDG; sbd->m_config.m_positionIterations = m_cfg.piterations; sbd->m_config.m_driftIterations = m_cfg.diterations; sbd->m_config.m_clusterIterations = m_cfg.citerations; sbd->m_config.m_velocityIterations = m_cfg.viterations; sbd->m_config.m_maxVolume = m_cfg.maxvolume; sbd->m_config.m_damping = m_cfg.kDP; sbd->m_config.m_poseMatch = m_cfg.kMT; sbd->m_config.m_collisionFlags = m_cfg.collisions; sbd->m_config.m_volume = m_cfg.kVC; sbd->m_config.m_rigidContactHardness = m_cfg.kCHR; sbd->m_config.m_kineticContactHardness = m_cfg.kKHR; sbd->m_config.m_softContactHardness = m_cfg.kSHR; sbd->m_config.m_anchorHardness = m_cfg.kAHR; sbd->m_config.m_timeScale = m_cfg.timescale; sbd->m_config.m_maxVolume = m_cfg.maxvolume; sbd->m_config.m_softRigidClusterHardness = m_cfg.kSRHR_CL; sbd->m_config.m_softKineticClusterHardness = m_cfg.kSKHR_CL; sbd->m_config.m_softSoftClusterHardness = m_cfg.kSSHR_CL; sbd->m_config.m_softRigidClusterImpulseSplit = m_cfg.kSR_SPLT_CL; sbd->m_config.m_softKineticClusterImpulseSplit = m_cfg.kSK_SPLT_CL; sbd->m_config.m_softSoftClusterImpulseSplit = m_cfg.kSS_SPLT_CL; //pose for shape matching { sbd->m_pose = (SoftBodyPoseData*)serializer->getUniquePointer((void*)&m_pose); int sz = sizeof(SoftBodyPoseData); btChunk* chunk = serializer->allocate(sz,1); SoftBodyPoseData* memPtr = (SoftBodyPoseData*)chunk->m_oldPtr; m_pose.m_aqq.serializeFloat(memPtr->m_aqq); memPtr->m_bframe = m_pose.m_bframe; memPtr->m_bvolume = m_pose.m_bvolume; m_pose.m_com.serializeFloat(memPtr->m_com); memPtr->m_numPositions = m_pose.m_pos.size(); memPtr->m_positions = memPtr->m_numPositions ? (btVector3FloatData*)serializer->getUniquePointer((void*)&m_pose.m_pos[0]): 0; if (memPtr->m_numPositions) { int numElem = memPtr->m_numPositions; int sz = sizeof(btVector3Data); btChunk* chunk = serializer->allocate(sz,numElem); btVector3FloatData* memPtr = (btVector3FloatData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { m_pose.m_pos[i].serializeFloat(*memPtr); } serializer->finalizeChunk(chunk,"btVector3FloatData",BT_ARRAY_CODE,(void*)&m_pose.m_pos[0]); } memPtr->m_restVolume = m_pose.m_volume; m_pose.m_rot.serializeFloat(memPtr->m_rot); m_pose.m_scl.serializeFloat(memPtr->m_scale); memPtr->m_numWeigts = m_pose.m_wgh.size(); memPtr->m_weights = memPtr->m_numWeigts? (float*) serializer->getUniquePointer((void*) &m_pose.m_wgh[0]) : 0; if (memPtr->m_numWeigts) { int numElem = memPtr->m_numWeigts; int sz = sizeof(float); btChunk* chunk = serializer->allocate(sz,numElem); float* memPtr = (float*) chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { *memPtr = m_pose.m_wgh[i]; } serializer->finalizeChunk(chunk,"float",BT_ARRAY_CODE,(void*)&m_pose.m_wgh[0]); } serializer->finalizeChunk(chunk,"SoftBodyPoseData",BT_ARRAY_CODE,(void*)&m_pose); } //clusters for convex-cluster collision detection sbd->m_numClusters = m_clusters.size(); sbd->m_clusters = sbd->m_numClusters? (SoftBodyClusterData*) serializer->getUniquePointer((void*)m_clusters[0]) : 0; if (sbd->m_numClusters) { int numElem = sbd->m_numClusters; int sz = sizeof(SoftBodyClusterData); btChunk* chunk = serializer->allocate(sz,numElem); SoftBodyClusterData* memPtr = (SoftBodyClusterData*) chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_adamping= m_clusters[i]->m_adamping; m_clusters[i]->m_av.serializeFloat(memPtr->m_av); memPtr->m_clusterIndex = m_clusters[i]->m_clusterIndex; memPtr->m_collide = m_clusters[i]->m_collide; m_clusters[i]->m_com.serializeFloat(memPtr->m_com); memPtr->m_containsAnchor = m_clusters[i]->m_containsAnchor; m_clusters[i]->m_dimpulses[0].serializeFloat(memPtr->m_dimpulses[0]); m_clusters[i]->m_dimpulses[1].serializeFloat(memPtr->m_dimpulses[1]); m_clusters[i]->m_framexform.serializeFloat(memPtr->m_framexform); memPtr->m_idmass = m_clusters[i]->m_idmass; memPtr->m_imass = m_clusters[i]->m_imass; m_clusters[i]->m_invwi.serializeFloat(memPtr->m_invwi); memPtr->m_ldamping = m_clusters[i]->m_ldamping; m_clusters[i]->m_locii.serializeFloat(memPtr->m_locii); m_clusters[i]->m_lv.serializeFloat(memPtr->m_lv); memPtr->m_matching = m_clusters[i]->m_matching; memPtr->m_maxSelfCollisionImpulse = m_clusters[i]->m_maxSelfCollisionImpulse; memPtr->m_ndamping = m_clusters[i]->m_ndamping; memPtr->m_ldamping = m_clusters[i]->m_ldamping; memPtr->m_adamping = m_clusters[i]->m_adamping; memPtr->m_selfCollisionImpulseFactor = m_clusters[i]->m_selfCollisionImpulseFactor; memPtr->m_numFrameRefs = m_clusters[i]->m_framerefs.size(); memPtr->m_numMasses = m_clusters[i]->m_masses.size(); memPtr->m_numNodes = m_clusters[i]->m_nodes.size(); memPtr->m_nvimpulses = m_clusters[i]->m_nvimpulses; m_clusters[i]->m_vimpulses[0].serializeFloat(memPtr->m_vimpulses[0]); m_clusters[i]->m_vimpulses[1].serializeFloat(memPtr->m_vimpulses[1]); memPtr->m_ndimpulses = m_clusters[i]->m_ndimpulses; memPtr->m_framerefs = memPtr->m_numFrameRefs? (btVector3FloatData*)serializer->getUniquePointer((void*)&m_clusters[i]->m_framerefs[0]) : 0; if (memPtr->m_framerefs) { int numElem = memPtr->m_numFrameRefs; int sz = sizeof(btVector3FloatData); btChunk* chunk = serializer->allocate(sz,numElem); btVector3FloatData* memPtr = (btVector3FloatData*) chunk->m_oldPtr; for (int j=0;j<numElem;j++,memPtr++) { m_clusters[i]->m_framerefs[j].serializeFloat(*memPtr); } serializer->finalizeChunk(chunk,"btVector3FloatData",BT_ARRAY_CODE,(void*)&m_clusters[i]->m_framerefs[0]); } memPtr->m_masses = memPtr->m_numMasses ? (float*) serializer->getUniquePointer((void*)&m_clusters[i]->m_masses[0]): 0; if (memPtr->m_masses) { int numElem = memPtr->m_numMasses; int sz = sizeof(float); btChunk* chunk = serializer->allocate(sz,numElem); float* memPtr = (float*) chunk->m_oldPtr; for (int j=0;j<numElem;j++,memPtr++) { *memPtr = m_clusters[i]->m_masses[j]; } serializer->finalizeChunk(chunk,"float",BT_ARRAY_CODE,(void*)&m_clusters[i]->m_masses[0]); } memPtr->m_nodeIndices = memPtr->m_numNodes ? (int*) serializer->getUniquePointer((void*) &m_clusters[i]->m_nodes) : 0; if (memPtr->m_nodeIndices ) { int numElem = memPtr->m_numMasses; int sz = sizeof(int); btChunk* chunk = serializer->allocate(sz,numElem); int* memPtr = (int*) chunk->m_oldPtr; for (int j=0;j<numElem;j++,memPtr++) { int* indexPtr = m_nodeIndexMap.find(m_clusters[i]->m_nodes[j]); btAssert(indexPtr); *memPtr = *indexPtr; } serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*)&m_clusters[i]->m_nodes); } } serializer->finalizeChunk(chunk,"SoftBodyClusterData",BT_ARRAY_CODE,(void*)m_clusters[0]); } sbd->m_numJoints = m_joints.size(); sbd->m_joints = m_joints.size()? (btSoftBodyJointData*) serializer->getUniquePointer((void*)&m_joints[0]) : 0; if (sbd->m_joints) { int sz = sizeof(btSoftBodyJointData); int numElem = m_joints.size(); btChunk* chunk = serializer->allocate(sz,numElem); btSoftBodyJointData* memPtr = (btSoftBodyJointData*)chunk->m_oldPtr; for (int i=0;i<numElem;i++,memPtr++) { memPtr->m_jointType = (int)m_joints[i]->Type(); m_joints[i]->m_refs[0].serializeFloat(memPtr->m_refs[0]); m_joints[i]->m_refs[1].serializeFloat(memPtr->m_refs[1]); memPtr->m_cfm = m_joints[i]->m_cfm; memPtr->m_erp = float(m_joints[i]->m_erp); memPtr->m_split = float(m_joints[i]->m_split); memPtr->m_delete = m_joints[i]->m_delete; for (int j=0;j<4;j++) { memPtr->m_relPosition[0].m_floats[j] = 0.f; memPtr->m_relPosition[1].m_floats[j] = 0.f; } memPtr->m_bodyA = 0; memPtr->m_bodyB = 0; if (m_joints[i]->m_bodies[0].m_soft) { memPtr->m_bodyAtype = BT_JOINT_SOFT_BODY_CLUSTER; memPtr->m_bodyA = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[0].m_soft); } if (m_joints[i]->m_bodies[0].m_collisionObject) { memPtr->m_bodyAtype = BT_JOINT_COLLISION_OBJECT; memPtr->m_bodyA = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[0].m_collisionObject); } if (m_joints[i]->m_bodies[0].m_rigid) { memPtr->m_bodyAtype = BT_JOINT_RIGID_BODY; memPtr->m_bodyA = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[0].m_rigid); } if (m_joints[i]->m_bodies[1].m_soft) { memPtr->m_bodyBtype = BT_JOINT_SOFT_BODY_CLUSTER; memPtr->m_bodyB = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[1].m_soft); } if (m_joints[i]->m_bodies[1].m_collisionObject) { memPtr->m_bodyBtype = BT_JOINT_COLLISION_OBJECT; memPtr->m_bodyB = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[1].m_collisionObject); } if (m_joints[i]->m_bodies[1].m_rigid) { memPtr->m_bodyBtype = BT_JOINT_RIGID_BODY; memPtr->m_bodyB = serializer->getUniquePointer((void*)m_joints[i]->m_bodies[1].m_rigid); } } serializer->finalizeChunk(chunk,"btSoftBodyJointData",BT_ARRAY_CODE,(void*) &m_joints[0]); } return btSoftBodyDataName; }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/gles2/Shapes.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.gles2; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; public class Shapes { public static Mesh genCube () { Mesh mesh = new Mesh(true, 24, 36, new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute(Usage.Normal, 3, "a_normal"), new VertexAttribute(Usage.TextureCoordinates, 2, "a_texcoords")); float[] cubeVerts = {-0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f,}; float[] cubeNormals = {0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,}; float[] cubeTex = {0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f,}; float[] vertices = new float[24 * 8]; int pIdx = 0; int nIdx = 0; int tIdx = 0; for (int i = 0; i < vertices.length;) { vertices[i++] = cubeVerts[pIdx++]; vertices[i++] = cubeVerts[pIdx++]; vertices[i++] = cubeVerts[pIdx++]; vertices[i++] = cubeNormals[nIdx++]; vertices[i++] = cubeNormals[nIdx++]; vertices[i++] = cubeNormals[nIdx++]; vertices[i++] = cubeTex[tIdx++]; vertices[i++] = cubeTex[tIdx++]; } short[] indices = {0, 2, 1, 0, 3, 2, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 15, 14, 12, 14, 13, 16, 17, 18, 16, 18, 19, 20, 23, 22, 20, 22, 21}; mesh.setVertices(vertices); mesh.setIndices(indices); return mesh; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.gles2; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; public class Shapes { public static Mesh genCube () { Mesh mesh = new Mesh(true, 24, 36, new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute(Usage.Normal, 3, "a_normal"), new VertexAttribute(Usage.TextureCoordinates, 2, "a_texcoords")); float[] cubeVerts = {-0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, -0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, -0.5f, 0.5f, -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f,}; float[] cubeNormals = {0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,}; float[] cubeTex = {0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f,}; float[] vertices = new float[24 * 8]; int pIdx = 0; int nIdx = 0; int tIdx = 0; for (int i = 0; i < vertices.length;) { vertices[i++] = cubeVerts[pIdx++]; vertices[i++] = cubeVerts[pIdx++]; vertices[i++] = cubeVerts[pIdx++]; vertices[i++] = cubeNormals[nIdx++]; vertices[i++] = cubeNormals[nIdx++]; vertices[i++] = cubeNormals[nIdx++]; vertices[i++] = cubeTex[tIdx++]; vertices[i++] = cubeTex[tIdx++]; } short[] indices = {0, 2, 1, 0, 3, 2, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 15, 14, 12, 14, 13, 16, 17, 18, 16, 18, 19, 20, 23, 22, 20, 22, 21}; mesh.setVertices(vertices); mesh.setIndices(indices); return mesh; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-box2d/gdx-box2d/jni/Box2D/Dynamics/Contacts/b2Contact.cpp
/* * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #include <Box2D/Dynamics/Contacts/b2Contact.h> #include <Box2D/Dynamics/Contacts/b2CircleContact.h> #include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2PolygonContact.h> #include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h> #include <Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h> #include <Box2D/Dynamics/Contacts/b2ContactSolver.h> #include <Box2D/Collision/b2Collision.h> #include <Box2D/Collision/b2TimeOfImpact.h> #include <Box2D/Collision/Shapes/b2Shape.h> #include <Box2D/Common/b2BlockAllocator.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2Fixture.h> #include <Box2D/Dynamics/b2World.h> b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; bool b2Contact::s_initialized = false; void b2Contact::InitializeRegisters() { AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); } void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, b2Shape::Type type1, b2Shape::Type type2) { b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); s_registers[type1][type2].createFcn = createFcn; s_registers[type1][type2].destroyFcn = destoryFcn; s_registers[type1][type2].primary = true; if (type1 != type2) { s_registers[type2][type1].createFcn = createFcn; s_registers[type2][type1].destroyFcn = destoryFcn; s_registers[type2][type1].primary = false; } } b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) { if (s_initialized == false) { InitializeRegisters(); s_initialized = true; } b2Shape::Type type1 = fixtureA->GetType(); b2Shape::Type type2 = fixtureB->GetType(); b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; if (createFcn) { if (s_registers[type1][type2].primary) { return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); } else { return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); } } else { return NULL; } } void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) { b2Assert(s_initialized == true); b2Fixture* fixtureA = contact->m_fixtureA; b2Fixture* fixtureB = contact->m_fixtureB; if (contact->m_manifold.pointCount > 0 && fixtureA->IsSensor() == false && fixtureB->IsSensor() == false) { fixtureA->GetBody()->SetAwake(true); fixtureB->GetBody()->SetAwake(true); } b2Shape::Type typeA = fixtureA->GetType(); b2Shape::Type typeB = fixtureB->GetType(); b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; destroyFcn(contact, allocator); } b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) { m_flags = e_enabledFlag; m_fixtureA = fA; m_fixtureB = fB; m_indexA = indexA; m_indexB = indexB; m_manifold.pointCount = 0; m_prev = NULL; m_next = NULL; m_nodeA.contact = NULL; m_nodeA.prev = NULL; m_nodeA.next = NULL; m_nodeA.other = NULL; m_nodeB.contact = NULL; m_nodeB.prev = NULL; m_nodeB.next = NULL; m_nodeB.other = NULL; m_toiCount = 0; m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); m_tangentSpeed = 0.0f; } // Update the contact manifold and touching status. // Note: do not assume the fixture AABBs are overlapping or are valid. void b2Contact::Update(b2ContactListener* listener) { b2Manifold oldManifold = m_manifold; // Re-enable this contact. m_flags |= e_enabledFlag; bool touching = false; bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; bool sensorA = m_fixtureA->IsSensor(); bool sensorB = m_fixtureB->IsSensor(); bool sensor = sensorA || sensorB; b2Body* bodyA = m_fixtureA->GetBody(); b2Body* bodyB = m_fixtureB->GetBody(); const b2Transform& xfA = bodyA->GetTransform(); const b2Transform& xfB = bodyB->GetTransform(); // Is this contact a sensor? if (sensor) { const b2Shape* shapeA = m_fixtureA->GetShape(); const b2Shape* shapeB = m_fixtureB->GetShape(); touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); // Sensors don't generate manifolds. m_manifold.pointCount = 0; } else { Evaluate(&m_manifold, xfA, xfB); touching = m_manifold.pointCount > 0; // Match old contact ids to new contact ids and copy the // stored impulses to warm start the solver. for (int32 i = 0; i < m_manifold.pointCount; ++i) { b2ManifoldPoint* mp2 = m_manifold.points + i; mp2->normalImpulse = 0.0f; mp2->tangentImpulse = 0.0f; b2ContactID id2 = mp2->id; for (int32 j = 0; j < oldManifold.pointCount; ++j) { b2ManifoldPoint* mp1 = oldManifold.points + j; if (mp1->id.key == id2.key) { mp2->normalImpulse = mp1->normalImpulse; mp2->tangentImpulse = mp1->tangentImpulse; break; } } } if (touching != wasTouching) { bodyA->SetAwake(true); bodyB->SetAwake(true); } } if (touching) { m_flags |= e_touchingFlag; } else { m_flags &= ~e_touchingFlag; } if (wasTouching == false && touching == true && listener) { listener->BeginContact(this); } if (wasTouching == true && touching == false && listener) { listener->EndContact(this); } if (sensor == false && touching && listener) { listener->PreSolve(this, &oldManifold); } }
/* * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #include <Box2D/Dynamics/Contacts/b2Contact.h> #include <Box2D/Dynamics/Contacts/b2CircleContact.h> #include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2PolygonContact.h> #include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h> #include <Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h> #include <Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h> #include <Box2D/Dynamics/Contacts/b2ContactSolver.h> #include <Box2D/Collision/b2Collision.h> #include <Box2D/Collision/b2TimeOfImpact.h> #include <Box2D/Collision/Shapes/b2Shape.h> #include <Box2D/Common/b2BlockAllocator.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2Fixture.h> #include <Box2D/Dynamics/b2World.h> b2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; bool b2Contact::s_initialized = false; void b2Contact::InitializeRegisters() { AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle); AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle); AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon); AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle); AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon); AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle); AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon); } void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn, b2Shape::Type type1, b2Shape::Type type2) { b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); s_registers[type1][type2].createFcn = createFcn; s_registers[type1][type2].destroyFcn = destoryFcn; s_registers[type1][type2].primary = true; if (type1 != type2) { s_registers[type2][type1].createFcn = createFcn; s_registers[type2][type1].destroyFcn = destoryFcn; s_registers[type2][type1].primary = false; } } b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) { if (s_initialized == false) { InitializeRegisters(); s_initialized = true; } b2Shape::Type type1 = fixtureA->GetType(); b2Shape::Type type2 = fixtureB->GetType(); b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; if (createFcn) { if (s_registers[type1][type2].primary) { return createFcn(fixtureA, indexA, fixtureB, indexB, allocator); } else { return createFcn(fixtureB, indexB, fixtureA, indexA, allocator); } } else { return NULL; } } void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) { b2Assert(s_initialized == true); b2Fixture* fixtureA = contact->m_fixtureA; b2Fixture* fixtureB = contact->m_fixtureB; if (contact->m_manifold.pointCount > 0 && fixtureA->IsSensor() == false && fixtureB->IsSensor() == false) { fixtureA->GetBody()->SetAwake(true); fixtureB->GetBody()->SetAwake(true); } b2Shape::Type typeA = fixtureA->GetType(); b2Shape::Type typeB = fixtureB->GetType(); b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); b2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn; destroyFcn(contact, allocator); } b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) { m_flags = e_enabledFlag; m_fixtureA = fA; m_fixtureB = fB; m_indexA = indexA; m_indexB = indexB; m_manifold.pointCount = 0; m_prev = NULL; m_next = NULL; m_nodeA.contact = NULL; m_nodeA.prev = NULL; m_nodeA.next = NULL; m_nodeA.other = NULL; m_nodeB.contact = NULL; m_nodeB.prev = NULL; m_nodeB.next = NULL; m_nodeB.other = NULL; m_toiCount = 0; m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); m_tangentSpeed = 0.0f; } // Update the contact manifold and touching status. // Note: do not assume the fixture AABBs are overlapping or are valid. void b2Contact::Update(b2ContactListener* listener) { b2Manifold oldManifold = m_manifold; // Re-enable this contact. m_flags |= e_enabledFlag; bool touching = false; bool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag; bool sensorA = m_fixtureA->IsSensor(); bool sensorB = m_fixtureB->IsSensor(); bool sensor = sensorA || sensorB; b2Body* bodyA = m_fixtureA->GetBody(); b2Body* bodyB = m_fixtureB->GetBody(); const b2Transform& xfA = bodyA->GetTransform(); const b2Transform& xfB = bodyB->GetTransform(); // Is this contact a sensor? if (sensor) { const b2Shape* shapeA = m_fixtureA->GetShape(); const b2Shape* shapeB = m_fixtureB->GetShape(); touching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB); // Sensors don't generate manifolds. m_manifold.pointCount = 0; } else { Evaluate(&m_manifold, xfA, xfB); touching = m_manifold.pointCount > 0; // Match old contact ids to new contact ids and copy the // stored impulses to warm start the solver. for (int32 i = 0; i < m_manifold.pointCount; ++i) { b2ManifoldPoint* mp2 = m_manifold.points + i; mp2->normalImpulse = 0.0f; mp2->tangentImpulse = 0.0f; b2ContactID id2 = mp2->id; for (int32 j = 0; j < oldManifold.pointCount; ++j) { b2ManifoldPoint* mp1 = oldManifold.points + j; if (mp1->id.key == id2.key) { mp2->normalImpulse = mp1->normalImpulse; mp2->tangentImpulse = mp1->tangentImpulse; break; } } } if (touching != wasTouching) { bodyA->SetAwake(true); bodyB->SetAwake(true); } } if (touching) { m_flags |= e_touchingFlag; } else { m_flags &= ~e_touchingFlag; } if (wasTouching == false && touching == true && listener) { listener->BeginContact(this); } if (wasTouching == true && touching == false && listener) { listener->EndContact(this); } if (sensor == false && touching && listener) { listener->PreSolve(this, &oldManifold); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/OcclusionBuffer.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.*; import com.badlogic.gdx.utils.BufferUtils; import com.badlogic.gdx.utils.Disposable; import java.nio.Buffer; import java.nio.FloatBuffer; /** Software rasterizer used for depth rendering and testing of bounding box triangles. Stores depth values inside a * {@link FloatBuffer}. CPU rendering is used in order to avoid the frequent GPU to CPU synchronization which would be needed if * hardware rendering were to be used for occlusion culling queries. * <p> * Based on the algorithm from the Bullet CDTestFramework, BulletSAPCompleteBoxPruningTest.cpp, written by Erwin Coumans. * * @author jsjolund */ public class OcclusionBuffer implements Disposable { static class GridPoint3 extends com.badlogic.gdx.math.GridPoint3 { public GridPoint3 add (GridPoint3 other) { return (GridPoint3)set(x + other.x, y + other.y, z + other.z); } } /** Determines actions and return values for triangle rasterization policies. */ private enum Policy { DRAW, QUERY; /** Evaluate the positions of the vertices depending on policy. * * @param vertices Vertices in camera space * @return True if in query mode and any of the vertices are behind camera frustum near plane. */ boolean evaluate (Quaternion[] vertices) { switch (this) { case DRAW: return false; case QUERY: // If we are querying and any of the vertices are behind the camera, return true. // This means a bounding box will not be considered occluded when any of its vertices // are behind the camera frustum near plane. for (Quaternion vertex : vertices) { if (vertex.z + vertex.w <= 0) return true; } return false; } return false; } /** Compare the current value in the depth buffer with a new value. If draw policy is used, write the new value if it is * larger than current depth (closer to camera). If query is used, return true if new depth not occluded by old depth. * * @param depthBuffer The depth buffer * @param bufferIndex Index in buffer at which to compare depth * @param newDepth New value to compare with * @return True if in query mode and new value closer to the camera, false otherwise */ boolean process (FloatBuffer depthBuffer, int bufferIndex, float newDepth) { float oldDepth = depthBuffer.get(bufferIndex); switch (this) { case DRAW: if (newDepth > oldDepth) depthBuffer.put(bufferIndex, newDepth); return false; case QUERY: return (newDepth >= oldDepth); } return false; } } static class Quaternion extends com.badlogic.gdx.math.Quaternion { /** Left-multiplies the quaternion by the given matrix. * @param matrix The matrix * @return This vector for chaining */ public Quaternion mul (final Matrix4 matrix) { final float[] val = matrix.val; return this.set(x * val[Matrix4.M00] + y * val[Matrix4.M01] + z * val[Matrix4.M02] + w * val[Matrix4.M03], x * val[Matrix4.M10] + y * val[Matrix4.M11] + z * val[Matrix4.M12] + w * val[Matrix4.M13], x * val[Matrix4.M20] + y * val[Matrix4.M21] + z * val[Matrix4.M22] + w * val[Matrix4.M23], x * val[Matrix4.M30] + y * val[Matrix4.M31] + z * val[Matrix4.M32] + w * val[Matrix4.M33]); } /** Multiply the x,y,z,w components of the passed in quaternion with the scalar and add them to the components of this * quaternion */ public Quaternion mulAdd (final Quaternion quaternion, float scalar) { this.x += quaternion.x * scalar; this.y += quaternion.y * scalar; this.z += quaternion.z * scalar; this.w += quaternion.w * scalar; return this; } @Override public Quaternion set (float x, float y, float z, float w) { return (Quaternion)super.set(x, y, z, w); } public Quaternion set (Quaternion quaternion) { return (Quaternion)super.set(quaternion); } /** Subtract the x,y,z,w components of the passed in quaternion to the ones of this quaternion */ public Quaternion sub (float qx, float qy, float qz, float qw) { this.x -= qx; this.y -= qy; this.z -= qz; this.w -= qw; return this; } /** Subtract the x,y,z,w components of the passed in quaternion to the ones of this quaternion */ public Quaternion sub (Quaternion quaternion) { this.x -= quaternion.x; this.y -= quaternion.y; this.z -= quaternion.z; this.w -= quaternion.w; return this; } } /** Face winding order of {@link #setAABBVertices} */ private static final int[] WINDING = {1, 0, 3, 2, 4, 5, 6, 7, 4, 7, 3, 0, 6, 5, 1, 2, 7, 6, 2, 3, 5, 4, 0, 1}; /** Depth buffer */ private final FloatBuffer buffer; /** Half extents of depth buffer in pixels */ private final Vector2 bufferHalfExt; /** Half extents of depth buffer offset by half a pixel */ private final Vector2 bufferOffset; /** Width of depth buffer image in pixels */ public final int bufferWidth; /** Height of depth buffer image in pixels */ public final int bufferHeight; // Temporary storage private final Vector3[] box = new Vector3[8]; private final Quaternion[] tmpVertices = new Quaternion[8]; private final Quaternion[] clippedQuad = new Quaternion[8]; private final Quaternion[] quad = new Quaternion[4]; private final Quaternion tmpQ1 = new Quaternion(); private final Quaternion tmpQ2 = new Quaternion(); private final Vector3 tmpV1 = new Vector3(); private final Vector3 tmpV2 = new Vector3(); private final GridPoint3 triX = new GridPoint3(); private final GridPoint3 triY = new GridPoint3(); private final GridPoint3 triDX = new GridPoint3(); private final GridPoint3 triDY = new GridPoint3(); private final GridPoint3 cursor = new GridPoint3(); // Debug drawing private Pixmap debugPixmap; private Texture debugTexture; private TextureRegion debugTextureRegion; private Matrix4 projectionMatrix = new Matrix4(); /** Creates a new {@link OcclusionBuffer} * * @param width Width of the buffer image * @param height Height of the buffer image */ public OcclusionBuffer (int width, int height) { bufferWidth = width; bufferHeight = height; bufferHalfExt = new Vector2(width * 0.5f, height * 0.5f); bufferOffset = new Vector2(bufferHalfExt.x + 0.5f, bufferHalfExt.y + 0.5f); buffer = BufferUtils.newFloatBuffer(width * height); for (int i = 0; i < 8; i++) { box[i] = new Vector3(); tmpVertices[i] = new Quaternion(); clippedQuad[i] = new Quaternion(); } for (int i = 0; i < 4; i++) quad[i] = new Quaternion(); } /** Clears the depth buffer by setting the depth to -1. */ public void clear () { ((Buffer)buffer).clear(); while (buffer.position() < buffer.capacity()) buffer.put(-1); } /** Clip a polygon with camera near plane if necessary. * * @param verticesIn Input * @param verticesOut Output * @return Number of vertices needed to draw the (clipped) face */ private int clipQuad (Quaternion[] verticesIn, Quaternion[] verticesOut) { int numVerts = verticesIn.length; int numVertsBehind = 0; float[] s = new float[4]; for (int i = 0; i < numVerts; i++) { s[i] = verticesIn[i].z + verticesIn[i].w; if (s[i] < 0) numVertsBehind++; } if (numVertsBehind == numVerts) { // All vertices outside frustum return 0; } else if (numVertsBehind > 0) { // Some vertices are behind the camera, so perform clipping. int newNumVerts = 0; for (int i = numVerts - 1, j = 0; j < numVerts; i = j++) { Quaternion a = tmpQ1.set(verticesIn[i]); Quaternion b = tmpQ2.set(verticesIn[j]); float t = s[i] / (a.w + a.z - b.w - b.z); if ((t > 0) && (t < 1)) verticesOut[newNumVerts++].set(a).mulAdd(b.sub(a), t); if (s[j] > 0) verticesOut[newNumVerts++].set(verticesIn[j]); } return newNumVerts; } else { // No clipping needed. for (int i = 0; i < numVerts; i++) verticesOut[i].set(verticesIn[i]); return numVerts; } } @Override public void dispose () { if (debugPixmap != null) { debugPixmap.dispose(); debugTexture.dispose(); debugPixmap = null; debugTexture = null; } } /** Renders an AABB (axis aligned bounding box) to the depth buffer. * * @param center Center of AABB in world coordinates * @param halfExt Half extents of AABB */ public void drawAABB (Vector3 center, Vector3 halfExt) { setAABBVertices(center, halfExt, box); drawBox(box, Policy.DRAW); } /** Renders a bounding box to the depth buffer. Does not need to be axis aligned, but will use the translation, rotation and * scale from the matrix parameter. * * @param worldTransform World transform of the box to render. * @param halfExt Half extents of the box. */ public void drawBB (Matrix4 worldTransform, Vector3 halfExt) { Vector3 center = tmpV1.setZero(); setAABBVertices(center, halfExt, box); worldTransform.getTranslation(center); for (Vector3 vertex : box) { vertex.rot(worldTransform); vertex.add(center); } drawBox(box, Policy.DRAW); } /** Draws a bounding box to the depth buffer, or queries the depth buffer at the pixels the box occupies, depending on policy. * * @param vertices Vertices of box * @param policy Rasterization policy to use * @return True if query policy is used, and any part of the box passes a depth test. False otherwise. */ private boolean drawBox (Vector3[] vertices, Policy policy) { for (int i = 0; i < 8; i++) { // Multiply the world coordinates by the camera combined matrix, but do not divide by w component yet. Vector3 v = vertices[i]; tmpVertices[i].set(v.x, v.y, v.z, 1).mul(projectionMatrix); } if (policy.evaluate(tmpVertices)) return true; // Loop over each box quad in the predefined winding order. for (int i = 0; i < WINDING.length;) { quad[0].set(tmpVertices[WINDING[i++]]); quad[1].set(tmpVertices[WINDING[i++]]); quad[2].set(tmpVertices[WINDING[i++]]); quad[3].set(tmpVertices[WINDING[i++]]); // Clip the quad with near frustum plane if needed int numVertices = clipQuad(quad, clippedQuad); // Divide by w to project vertices to camera space for (int j = 0; j < numVertices; j++) { Quaternion q = clippedQuad[j]; q.z = 1 / q.w; vertices[j].set(q.x * q.z, q.y * q.z, q.z); } // Perform draw/query for (int j = 2; j < numVertices; j++) { // If we are querying and depth test passes, there is no need to continue the rasterization, // since part of the AABB must be visible then. if (drawTriangle(vertices[0], vertices[j - 1], vertices[j], policy)) return true; } } return false; } /** Draw the depth buffer to a texture. Slow, should only be used for debugging purposes. * * @return Region of debug texture */ public TextureRegion drawDebugTexture () { if (debugPixmap == null) { debugPixmap = new Pixmap(bufferWidth, bufferHeight, Pixmap.Format.RGBA8888); debugTexture = new Texture(debugPixmap); debugTextureRegion = new TextureRegion(debugTexture); debugTextureRegion.flip(false, true); } debugPixmap.setColor(Color.BLACK); debugPixmap.fill(); // Find min/max depth values in buffer float minDepth = Float.POSITIVE_INFINITY; float maxDepth = Float.NEGATIVE_INFINITY; ((Buffer)buffer).clear(); while (buffer.position() < buffer.capacity()) { float depth = MathUtils.clamp(buffer.get(), 0, Float.POSITIVE_INFINITY); minDepth = Math.min(depth, minDepth); maxDepth = Math.max(depth, maxDepth); } float extent = 1 / (maxDepth - minDepth); ((Buffer)buffer).clear(); // Draw to pixmap for (int x = 0; x < bufferWidth; x++) { for (int y = 0; y < bufferHeight; y++) { float depth = MathUtils.clamp(buffer.get(x + y * bufferWidth), 0, Float.POSITIVE_INFINITY); float c = depth * extent; debugPixmap.drawPixel(x, y, Color.rgba8888(c, c, c, 1)); } } debugTexture.draw(debugPixmap, 0, 0); return debugTextureRegion; } /** Rasterizes a triangle with linearly interpolated depth values. * <p> * If used with {@link Policy#DRAW} the triangle will be drawn to the depth buffer wherever it passes a depth test. * <p> * If {@link Policy#QUERY} is used, the depth values in the triangle will be compared with existing depth buffer values. If any * pixel passes a depth test the rasterization will be aborted and the method will return true. * * @param a Triangle vertex in camera space * @param b Triangle vertex in camera space * @param c Triangle vertex in camera space * @param policy Draw or query policy * @return With query policy, true if any pixel in the triangle passes a depth test. False otherwise. */ private boolean drawTriangle (Vector3 a, Vector3 b, Vector3 c, Policy policy) { // Check if triangle faces away from the camera (back-face culling). if (((tmpV1.set(b).sub(a)).crs(tmpV2.set(c).sub(a))).z <= 0) return false; // Triangle coordinates and size. // Note that x, y, z in e.g. triX corresponds to x components of vertices a, b, c, // which means triX.x is the x coordinate of a. triX.set((int)(a.x * bufferHalfExt.x + bufferOffset.x), (int)(b.x * bufferHalfExt.x + bufferOffset.x), (int)(c.x * bufferHalfExt.x + bufferOffset.x)); triY.set((int)(a.y * bufferHalfExt.y + bufferOffset.y), (int)(b.y * bufferHalfExt.y + bufferOffset.y), (int)(c.y * bufferHalfExt.y + bufferOffset.y)); // X/Y extents int xMin = Math.max(0, Math.min(triX.x, Math.min(triX.y, triX.z))); int xMax = Math.min(bufferWidth, 1 + Math.max(triX.x, Math.max(triX.y, triX.z))); int yMin = Math.max(0, Math.min(triY.x, Math.min(triY.y, triY.z))); int yMax = Math.min(bufferWidth, 1 + Math.max(triY.x, Math.max(triY.y, triY.z))); int width = xMax - xMin; int height = yMax - yMin; if (width * height <= 0) return false; // Cursor triDX.set(triY.x - triY.y, triY.y - triY.z, triY.z - triY.x); triDY.set(triX.y - triX.x - triDX.x * width, triX.z - triX.y - triDX.y * width, triX.x - triX.z - triDX.z * width); cursor.set(yMin * (triX.y - triX.x) + xMin * (triY.x - triY.y) + triX.x * triY.y - triX.y * triY.x, yMin * (triX.z - triX.y) + xMin * (triY.y - triY.z) + triX.y * triY.z - triX.z * triY.y, yMin * (triX.x - triX.z) + xMin * (triY.z - triY.x) + triX.z * triY.x - triX.x * triY.z); // Depth interpolation float ia = 1f / (float)(triX.x * triY.y - triX.y * triY.x + triX.z * triY.x - triX.x * triY.z + triX.y * triY.z - triX.z * triY.y); float dzx = ia * (triY.x * (c.z - b.z) + triY.y * (a.z - c.z) + triY.z * (b.z - a.z)); float dzy = ia * (triX.x * (b.z - c.z) + triX.y * (c.z - a.z) + triX.z * (a.z - b.z)) - (dzx * width); float drawDepth = ia * (a.z * cursor.y + b.z * cursor.z + c.z * cursor.x); int bufferRow = (yMin * bufferHeight); // Loop over pixels and process the triangle pixel depth versus the existing value in buffer. for (int iy = yMin; iy < yMax; iy++) { for (int ix = xMin; ix < xMax; ix++) { int bufferIndex = bufferRow + ix; if (cursor.x >= 0 && cursor.y >= 0 && cursor.z >= 0 && policy.process(buffer, bufferIndex, drawDepth)) return true; cursor.add(triDX); drawDepth += dzx; } cursor.add(triDY); drawDepth += dzy; bufferRow += bufferWidth; } return false; } /** Queries the depth buffer as to whether an AABB (axis aligned bounding box) is completely occluded by a previously rendered * object. If any part of the AABB is visible (not occluded), the method returns true. * * @param center Center of AABB in world coordinates * @param halfExt Half extents of AABB * @return True if any part of the AABB is visible, false otherwise. */ public boolean queryAABB (Vector3 center, Vector3 halfExt) { setAABBVertices(center, halfExt, box); return drawBox(box, Policy.QUERY); } /** Calculates the eight vertices of an AABB. * * @param center Center point * @param halfExt Half extents * @param vertices Vertices output */ private static void setAABBVertices (Vector3 center, Vector3 halfExt, Vector3[] vertices) { vertices[0].set(center.x - halfExt.x, center.y - halfExt.y, center.z - halfExt.z); vertices[1].set(center.x + halfExt.x, center.y - halfExt.y, center.z - halfExt.z); vertices[2].set(center.x + halfExt.x, center.y + halfExt.y, center.z - halfExt.z); vertices[3].set(center.x - halfExt.x, center.y + halfExt.y, center.z - halfExt.z); vertices[4].set(center.x - halfExt.x, center.y - halfExt.y, center.z + halfExt.z); vertices[5].set(center.x + halfExt.x, center.y - halfExt.y, center.z + halfExt.z); vertices[6].set(center.x + halfExt.x, center.y + halfExt.y, center.z + halfExt.z); vertices[7].set(center.x - halfExt.x, center.y + halfExt.y, center.z + halfExt.z); } /** Sets the projection matrix to be used for rendering. Usually this will be set to Camera.combined. * @param matrix */ public void setProjectionMatrix (Matrix4 matrix) { projectionMatrix.set(matrix); } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.*; import com.badlogic.gdx.utils.BufferUtils; import com.badlogic.gdx.utils.Disposable; import java.nio.Buffer; import java.nio.FloatBuffer; /** Software rasterizer used for depth rendering and testing of bounding box triangles. Stores depth values inside a * {@link FloatBuffer}. CPU rendering is used in order to avoid the frequent GPU to CPU synchronization which would be needed if * hardware rendering were to be used for occlusion culling queries. * <p> * Based on the algorithm from the Bullet CDTestFramework, BulletSAPCompleteBoxPruningTest.cpp, written by Erwin Coumans. * * @author jsjolund */ public class OcclusionBuffer implements Disposable { static class GridPoint3 extends com.badlogic.gdx.math.GridPoint3 { public GridPoint3 add (GridPoint3 other) { return (GridPoint3)set(x + other.x, y + other.y, z + other.z); } } /** Determines actions and return values for triangle rasterization policies. */ private enum Policy { DRAW, QUERY; /** Evaluate the positions of the vertices depending on policy. * * @param vertices Vertices in camera space * @return True if in query mode and any of the vertices are behind camera frustum near plane. */ boolean evaluate (Quaternion[] vertices) { switch (this) { case DRAW: return false; case QUERY: // If we are querying and any of the vertices are behind the camera, return true. // This means a bounding box will not be considered occluded when any of its vertices // are behind the camera frustum near plane. for (Quaternion vertex : vertices) { if (vertex.z + vertex.w <= 0) return true; } return false; } return false; } /** Compare the current value in the depth buffer with a new value. If draw policy is used, write the new value if it is * larger than current depth (closer to camera). If query is used, return true if new depth not occluded by old depth. * * @param depthBuffer The depth buffer * @param bufferIndex Index in buffer at which to compare depth * @param newDepth New value to compare with * @return True if in query mode and new value closer to the camera, false otherwise */ boolean process (FloatBuffer depthBuffer, int bufferIndex, float newDepth) { float oldDepth = depthBuffer.get(bufferIndex); switch (this) { case DRAW: if (newDepth > oldDepth) depthBuffer.put(bufferIndex, newDepth); return false; case QUERY: return (newDepth >= oldDepth); } return false; } } static class Quaternion extends com.badlogic.gdx.math.Quaternion { /** Left-multiplies the quaternion by the given matrix. * @param matrix The matrix * @return This vector for chaining */ public Quaternion mul (final Matrix4 matrix) { final float[] val = matrix.val; return this.set(x * val[Matrix4.M00] + y * val[Matrix4.M01] + z * val[Matrix4.M02] + w * val[Matrix4.M03], x * val[Matrix4.M10] + y * val[Matrix4.M11] + z * val[Matrix4.M12] + w * val[Matrix4.M13], x * val[Matrix4.M20] + y * val[Matrix4.M21] + z * val[Matrix4.M22] + w * val[Matrix4.M23], x * val[Matrix4.M30] + y * val[Matrix4.M31] + z * val[Matrix4.M32] + w * val[Matrix4.M33]); } /** Multiply the x,y,z,w components of the passed in quaternion with the scalar and add them to the components of this * quaternion */ public Quaternion mulAdd (final Quaternion quaternion, float scalar) { this.x += quaternion.x * scalar; this.y += quaternion.y * scalar; this.z += quaternion.z * scalar; this.w += quaternion.w * scalar; return this; } @Override public Quaternion set (float x, float y, float z, float w) { return (Quaternion)super.set(x, y, z, w); } public Quaternion set (Quaternion quaternion) { return (Quaternion)super.set(quaternion); } /** Subtract the x,y,z,w components of the passed in quaternion to the ones of this quaternion */ public Quaternion sub (float qx, float qy, float qz, float qw) { this.x -= qx; this.y -= qy; this.z -= qz; this.w -= qw; return this; } /** Subtract the x,y,z,w components of the passed in quaternion to the ones of this quaternion */ public Quaternion sub (Quaternion quaternion) { this.x -= quaternion.x; this.y -= quaternion.y; this.z -= quaternion.z; this.w -= quaternion.w; return this; } } /** Face winding order of {@link #setAABBVertices} */ private static final int[] WINDING = {1, 0, 3, 2, 4, 5, 6, 7, 4, 7, 3, 0, 6, 5, 1, 2, 7, 6, 2, 3, 5, 4, 0, 1}; /** Depth buffer */ private final FloatBuffer buffer; /** Half extents of depth buffer in pixels */ private final Vector2 bufferHalfExt; /** Half extents of depth buffer offset by half a pixel */ private final Vector2 bufferOffset; /** Width of depth buffer image in pixels */ public final int bufferWidth; /** Height of depth buffer image in pixels */ public final int bufferHeight; // Temporary storage private final Vector3[] box = new Vector3[8]; private final Quaternion[] tmpVertices = new Quaternion[8]; private final Quaternion[] clippedQuad = new Quaternion[8]; private final Quaternion[] quad = new Quaternion[4]; private final Quaternion tmpQ1 = new Quaternion(); private final Quaternion tmpQ2 = new Quaternion(); private final Vector3 tmpV1 = new Vector3(); private final Vector3 tmpV2 = new Vector3(); private final GridPoint3 triX = new GridPoint3(); private final GridPoint3 triY = new GridPoint3(); private final GridPoint3 triDX = new GridPoint3(); private final GridPoint3 triDY = new GridPoint3(); private final GridPoint3 cursor = new GridPoint3(); // Debug drawing private Pixmap debugPixmap; private Texture debugTexture; private TextureRegion debugTextureRegion; private Matrix4 projectionMatrix = new Matrix4(); /** Creates a new {@link OcclusionBuffer} * * @param width Width of the buffer image * @param height Height of the buffer image */ public OcclusionBuffer (int width, int height) { bufferWidth = width; bufferHeight = height; bufferHalfExt = new Vector2(width * 0.5f, height * 0.5f); bufferOffset = new Vector2(bufferHalfExt.x + 0.5f, bufferHalfExt.y + 0.5f); buffer = BufferUtils.newFloatBuffer(width * height); for (int i = 0; i < 8; i++) { box[i] = new Vector3(); tmpVertices[i] = new Quaternion(); clippedQuad[i] = new Quaternion(); } for (int i = 0; i < 4; i++) quad[i] = new Quaternion(); } /** Clears the depth buffer by setting the depth to -1. */ public void clear () { ((Buffer)buffer).clear(); while (buffer.position() < buffer.capacity()) buffer.put(-1); } /** Clip a polygon with camera near plane if necessary. * * @param verticesIn Input * @param verticesOut Output * @return Number of vertices needed to draw the (clipped) face */ private int clipQuad (Quaternion[] verticesIn, Quaternion[] verticesOut) { int numVerts = verticesIn.length; int numVertsBehind = 0; float[] s = new float[4]; for (int i = 0; i < numVerts; i++) { s[i] = verticesIn[i].z + verticesIn[i].w; if (s[i] < 0) numVertsBehind++; } if (numVertsBehind == numVerts) { // All vertices outside frustum return 0; } else if (numVertsBehind > 0) { // Some vertices are behind the camera, so perform clipping. int newNumVerts = 0; for (int i = numVerts - 1, j = 0; j < numVerts; i = j++) { Quaternion a = tmpQ1.set(verticesIn[i]); Quaternion b = tmpQ2.set(verticesIn[j]); float t = s[i] / (a.w + a.z - b.w - b.z); if ((t > 0) && (t < 1)) verticesOut[newNumVerts++].set(a).mulAdd(b.sub(a), t); if (s[j] > 0) verticesOut[newNumVerts++].set(verticesIn[j]); } return newNumVerts; } else { // No clipping needed. for (int i = 0; i < numVerts; i++) verticesOut[i].set(verticesIn[i]); return numVerts; } } @Override public void dispose () { if (debugPixmap != null) { debugPixmap.dispose(); debugTexture.dispose(); debugPixmap = null; debugTexture = null; } } /** Renders an AABB (axis aligned bounding box) to the depth buffer. * * @param center Center of AABB in world coordinates * @param halfExt Half extents of AABB */ public void drawAABB (Vector3 center, Vector3 halfExt) { setAABBVertices(center, halfExt, box); drawBox(box, Policy.DRAW); } /** Renders a bounding box to the depth buffer. Does not need to be axis aligned, but will use the translation, rotation and * scale from the matrix parameter. * * @param worldTransform World transform of the box to render. * @param halfExt Half extents of the box. */ public void drawBB (Matrix4 worldTransform, Vector3 halfExt) { Vector3 center = tmpV1.setZero(); setAABBVertices(center, halfExt, box); worldTransform.getTranslation(center); for (Vector3 vertex : box) { vertex.rot(worldTransform); vertex.add(center); } drawBox(box, Policy.DRAW); } /** Draws a bounding box to the depth buffer, or queries the depth buffer at the pixels the box occupies, depending on policy. * * @param vertices Vertices of box * @param policy Rasterization policy to use * @return True if query policy is used, and any part of the box passes a depth test. False otherwise. */ private boolean drawBox (Vector3[] vertices, Policy policy) { for (int i = 0; i < 8; i++) { // Multiply the world coordinates by the camera combined matrix, but do not divide by w component yet. Vector3 v = vertices[i]; tmpVertices[i].set(v.x, v.y, v.z, 1).mul(projectionMatrix); } if (policy.evaluate(tmpVertices)) return true; // Loop over each box quad in the predefined winding order. for (int i = 0; i < WINDING.length;) { quad[0].set(tmpVertices[WINDING[i++]]); quad[1].set(tmpVertices[WINDING[i++]]); quad[2].set(tmpVertices[WINDING[i++]]); quad[3].set(tmpVertices[WINDING[i++]]); // Clip the quad with near frustum plane if needed int numVertices = clipQuad(quad, clippedQuad); // Divide by w to project vertices to camera space for (int j = 0; j < numVertices; j++) { Quaternion q = clippedQuad[j]; q.z = 1 / q.w; vertices[j].set(q.x * q.z, q.y * q.z, q.z); } // Perform draw/query for (int j = 2; j < numVertices; j++) { // If we are querying and depth test passes, there is no need to continue the rasterization, // since part of the AABB must be visible then. if (drawTriangle(vertices[0], vertices[j - 1], vertices[j], policy)) return true; } } return false; } /** Draw the depth buffer to a texture. Slow, should only be used for debugging purposes. * * @return Region of debug texture */ public TextureRegion drawDebugTexture () { if (debugPixmap == null) { debugPixmap = new Pixmap(bufferWidth, bufferHeight, Pixmap.Format.RGBA8888); debugTexture = new Texture(debugPixmap); debugTextureRegion = new TextureRegion(debugTexture); debugTextureRegion.flip(false, true); } debugPixmap.setColor(Color.BLACK); debugPixmap.fill(); // Find min/max depth values in buffer float minDepth = Float.POSITIVE_INFINITY; float maxDepth = Float.NEGATIVE_INFINITY; ((Buffer)buffer).clear(); while (buffer.position() < buffer.capacity()) { float depth = MathUtils.clamp(buffer.get(), 0, Float.POSITIVE_INFINITY); minDepth = Math.min(depth, minDepth); maxDepth = Math.max(depth, maxDepth); } float extent = 1 / (maxDepth - minDepth); ((Buffer)buffer).clear(); // Draw to pixmap for (int x = 0; x < bufferWidth; x++) { for (int y = 0; y < bufferHeight; y++) { float depth = MathUtils.clamp(buffer.get(x + y * bufferWidth), 0, Float.POSITIVE_INFINITY); float c = depth * extent; debugPixmap.drawPixel(x, y, Color.rgba8888(c, c, c, 1)); } } debugTexture.draw(debugPixmap, 0, 0); return debugTextureRegion; } /** Rasterizes a triangle with linearly interpolated depth values. * <p> * If used with {@link Policy#DRAW} the triangle will be drawn to the depth buffer wherever it passes a depth test. * <p> * If {@link Policy#QUERY} is used, the depth values in the triangle will be compared with existing depth buffer values. If any * pixel passes a depth test the rasterization will be aborted and the method will return true. * * @param a Triangle vertex in camera space * @param b Triangle vertex in camera space * @param c Triangle vertex in camera space * @param policy Draw or query policy * @return With query policy, true if any pixel in the triangle passes a depth test. False otherwise. */ private boolean drawTriangle (Vector3 a, Vector3 b, Vector3 c, Policy policy) { // Check if triangle faces away from the camera (back-face culling). if (((tmpV1.set(b).sub(a)).crs(tmpV2.set(c).sub(a))).z <= 0) return false; // Triangle coordinates and size. // Note that x, y, z in e.g. triX corresponds to x components of vertices a, b, c, // which means triX.x is the x coordinate of a. triX.set((int)(a.x * bufferHalfExt.x + bufferOffset.x), (int)(b.x * bufferHalfExt.x + bufferOffset.x), (int)(c.x * bufferHalfExt.x + bufferOffset.x)); triY.set((int)(a.y * bufferHalfExt.y + bufferOffset.y), (int)(b.y * bufferHalfExt.y + bufferOffset.y), (int)(c.y * bufferHalfExt.y + bufferOffset.y)); // X/Y extents int xMin = Math.max(0, Math.min(triX.x, Math.min(triX.y, triX.z))); int xMax = Math.min(bufferWidth, 1 + Math.max(triX.x, Math.max(triX.y, triX.z))); int yMin = Math.max(0, Math.min(triY.x, Math.min(triY.y, triY.z))); int yMax = Math.min(bufferWidth, 1 + Math.max(triY.x, Math.max(triY.y, triY.z))); int width = xMax - xMin; int height = yMax - yMin; if (width * height <= 0) return false; // Cursor triDX.set(triY.x - triY.y, triY.y - triY.z, triY.z - triY.x); triDY.set(triX.y - triX.x - triDX.x * width, triX.z - triX.y - triDX.y * width, triX.x - triX.z - triDX.z * width); cursor.set(yMin * (triX.y - triX.x) + xMin * (triY.x - triY.y) + triX.x * triY.y - triX.y * triY.x, yMin * (triX.z - triX.y) + xMin * (triY.y - triY.z) + triX.y * triY.z - triX.z * triY.y, yMin * (triX.x - triX.z) + xMin * (triY.z - triY.x) + triX.z * triY.x - triX.x * triY.z); // Depth interpolation float ia = 1f / (float)(triX.x * triY.y - triX.y * triY.x + triX.z * triY.x - triX.x * triY.z + triX.y * triY.z - triX.z * triY.y); float dzx = ia * (triY.x * (c.z - b.z) + triY.y * (a.z - c.z) + triY.z * (b.z - a.z)); float dzy = ia * (triX.x * (b.z - c.z) + triX.y * (c.z - a.z) + triX.z * (a.z - b.z)) - (dzx * width); float drawDepth = ia * (a.z * cursor.y + b.z * cursor.z + c.z * cursor.x); int bufferRow = (yMin * bufferHeight); // Loop over pixels and process the triangle pixel depth versus the existing value in buffer. for (int iy = yMin; iy < yMax; iy++) { for (int ix = xMin; ix < xMax; ix++) { int bufferIndex = bufferRow + ix; if (cursor.x >= 0 && cursor.y >= 0 && cursor.z >= 0 && policy.process(buffer, bufferIndex, drawDepth)) return true; cursor.add(triDX); drawDepth += dzx; } cursor.add(triDY); drawDepth += dzy; bufferRow += bufferWidth; } return false; } /** Queries the depth buffer as to whether an AABB (axis aligned bounding box) is completely occluded by a previously rendered * object. If any part of the AABB is visible (not occluded), the method returns true. * * @param center Center of AABB in world coordinates * @param halfExt Half extents of AABB * @return True if any part of the AABB is visible, false otherwise. */ public boolean queryAABB (Vector3 center, Vector3 halfExt) { setAABBVertices(center, halfExt, box); return drawBox(box, Policy.QUERY); } /** Calculates the eight vertices of an AABB. * * @param center Center point * @param halfExt Half extents * @param vertices Vertices output */ private static void setAABBVertices (Vector3 center, Vector3 halfExt, Vector3[] vertices) { vertices[0].set(center.x - halfExt.x, center.y - halfExt.y, center.z - halfExt.z); vertices[1].set(center.x + halfExt.x, center.y - halfExt.y, center.z - halfExt.z); vertices[2].set(center.x + halfExt.x, center.y + halfExt.y, center.z - halfExt.z); vertices[3].set(center.x - halfExt.x, center.y + halfExt.y, center.z - halfExt.z); vertices[4].set(center.x - halfExt.x, center.y - halfExt.y, center.z + halfExt.z); vertices[5].set(center.x + halfExt.x, center.y - halfExt.y, center.z + halfExt.z); vertices[6].set(center.x + halfExt.x, center.y + halfExt.y, center.z + halfExt.z); vertices[7].set(center.x - halfExt.x, center.y + halfExt.y, center.z + halfExt.z); } /** Sets the projection matrix to be used for rendering. Usually this will be set to Camera.combined. * @param matrix */ public void setProjectionMatrix (Matrix4 matrix) { projectionMatrix.set(matrix); } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./tests/gdx-tests-iosrobovm/data/Media.xcassets/AppIcon.appiconset/[email protected]
PNG  IHDR !sBIT|d pHYs ~AtEXtSoftwarewww.inkscape.org<IDATx}lwϝ8C֩[umچjhJH(""MВʺѭ)ahS6PRIN,MAudeiДҢ&N;ƛ{lyWwg[1 u7Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$(Fb`$mwjjjLKKKq jkkMz{{زeiO_6|O"6xkr׍ (aaΡ\Pe*+QtP~19NšZx\ĉ~ ih]jd;0]100`Zl qϟ7+++{Hf~o_ #S %'8 gy S)(jGא&:ØBWwd6_"COcWލү?l;.`]"!X\s!11 #ݖ5cGqW`{q8~K0dbk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`]"!X\s!11 #ݖ5cGqW`{q8~K0dbk}&hdq(KՙF eG" ̮rttt{<J1}zWy9n4͑y5kSr#ˈ ]7m<OUury&=ؐ=YQ0ߓ!.@ g,c!m`J aTT&:+WLTdY%R^ݷޚɝrO[}e`/_ƾ}L^/:hllLYxrJl߾ibg)x9<-L|wM kjQ.'@)݃1cG1F/bݏPq<P(v`0h+)Yn۳gp\H9;[c6=o}()ۦ<hzMk O==rָލO:.h---ر#Ç92b1Ltv`ٟulع\Zqr<-O>#G}zy7+͂ <8'zN+t0GaLN:z<߃󡧧ىVӸ> bYͣh( L "/6ECb*` IzO,O{݇'7rݨJ.WWWΝ3:0( Vݞvsw`/#=b/Bg%By;oYSoc{H]D,ECL aL[?wB<>Jẘf}VsY7@UՔ9ywg?¥K_y&P}~$B1fo}cO!1>fYEwZĴ.f\ @3GEzjeҥXn]rٳq&co=bӁȉnDNt;6/h7,g׌=|Kd:;w/=-eIE۶a] ML. U[F翐vHXUUvޝ(~Ky@tKn7|ܝr$‘-6oތSNY~kbg2m}%O4U^/'?vr4$r~4MêULKKKm q+V5wQQV^:ե\S( JFGܝw2ܴ3Xp-XsXRUAhPŭ)?k}3}\ .W}į^xsC1E5Ps I #Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10H#Q D10?| ,IENDB`
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-box2d/gdx-box2d/res/com/badlogic/gdx/physics/box2d.gwt.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd"> <module> <source path="box2d"> </source> </module>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd"> <module> <source path="box2d"> </source> </module>
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./gdx/src/com/badlogic/gdx/graphics/glutils/ETC1TextureData.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.glutils; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.TextureData; import com.badlogic.gdx.graphics.glutils.ETC1.ETC1Data; import com.badlogic.gdx.utils.GdxRuntimeException; public class ETC1TextureData implements TextureData { FileHandle file; ETC1Data data; boolean useMipMaps; int width = 0; int height = 0; boolean isPrepared = false; public ETC1TextureData (FileHandle file) { this(file, false); } public ETC1TextureData (FileHandle file, boolean useMipMaps) { this.file = file; this.useMipMaps = useMipMaps; } public ETC1TextureData (ETC1Data encodedImage, boolean useMipMaps) { this.data = encodedImage; this.useMipMaps = useMipMaps; } @Override public TextureDataType getType () { return TextureDataType.Custom; } @Override public boolean isPrepared () { return isPrepared; } @Override public void prepare () { if (isPrepared) throw new GdxRuntimeException("Already prepared"); if (file == null && data == null) throw new GdxRuntimeException("Can only load once from ETC1Data"); if (file != null) { data = new ETC1Data(file); } width = data.width; height = data.height; isPrepared = true; } @Override public void consumeCustomData (int target) { if (!isPrepared) throw new GdxRuntimeException("Call prepare() before calling consumeCompressedData()"); if (!Gdx.graphics.supportsExtension("GL_OES_compressed_ETC1_RGB8_texture")) { Pixmap pixmap = ETC1.decodeImage(data, Format.RGB565); Gdx.gl.glTexImage2D(target, 0, pixmap.getGLInternalFormat(), pixmap.getWidth(), pixmap.getHeight(), 0, pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels()); if (useMipMaps) MipMapGenerator.generateMipMap(target, pixmap, pixmap.getWidth(), pixmap.getHeight()); pixmap.dispose(); useMipMaps = false; } else { Gdx.gl.glCompressedTexImage2D(target, 0, ETC1.ETC1_RGB8_OES, width, height, 0, data.compressedData.capacity() - data.dataOffset, data.compressedData); if (useMipMaps()) Gdx.gl20.glGenerateMipmap(GL20.GL_TEXTURE_2D); } data.dispose(); data = null; isPrepared = false; } @Override public Pixmap consumePixmap () { throw new GdxRuntimeException("This TextureData implementation does not return a Pixmap"); } @Override public boolean disposePixmap () { throw new GdxRuntimeException("This TextureData implementation does not return a Pixmap"); } @Override public int getWidth () { return width; } @Override public int getHeight () { return height; } @Override public Format getFormat () { return Format.RGB565; } @Override public boolean useMipMaps () { return useMipMaps; } @Override public boolean isManaged () { return true; } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.glutils; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.TextureData; import com.badlogic.gdx.graphics.glutils.ETC1.ETC1Data; import com.badlogic.gdx.utils.GdxRuntimeException; public class ETC1TextureData implements TextureData { FileHandle file; ETC1Data data; boolean useMipMaps; int width = 0; int height = 0; boolean isPrepared = false; public ETC1TextureData (FileHandle file) { this(file, false); } public ETC1TextureData (FileHandle file, boolean useMipMaps) { this.file = file; this.useMipMaps = useMipMaps; } public ETC1TextureData (ETC1Data encodedImage, boolean useMipMaps) { this.data = encodedImage; this.useMipMaps = useMipMaps; } @Override public TextureDataType getType () { return TextureDataType.Custom; } @Override public boolean isPrepared () { return isPrepared; } @Override public void prepare () { if (isPrepared) throw new GdxRuntimeException("Already prepared"); if (file == null && data == null) throw new GdxRuntimeException("Can only load once from ETC1Data"); if (file != null) { data = new ETC1Data(file); } width = data.width; height = data.height; isPrepared = true; } @Override public void consumeCustomData (int target) { if (!isPrepared) throw new GdxRuntimeException("Call prepare() before calling consumeCompressedData()"); if (!Gdx.graphics.supportsExtension("GL_OES_compressed_ETC1_RGB8_texture")) { Pixmap pixmap = ETC1.decodeImage(data, Format.RGB565); Gdx.gl.glTexImage2D(target, 0, pixmap.getGLInternalFormat(), pixmap.getWidth(), pixmap.getHeight(), 0, pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels()); if (useMipMaps) MipMapGenerator.generateMipMap(target, pixmap, pixmap.getWidth(), pixmap.getHeight()); pixmap.dispose(); useMipMaps = false; } else { Gdx.gl.glCompressedTexImage2D(target, 0, ETC1.ETC1_RGB8_OES, width, height, 0, data.compressedData.capacity() - data.dataOffset, data.compressedData); if (useMipMaps()) Gdx.gl20.glGenerateMipmap(GL20.GL_TEXTURE_2D); } data.dispose(); data = null; isPrepared = false; } @Override public Pixmap consumePixmap () { throw new GdxRuntimeException("This TextureData implementation does not return a Pixmap"); } @Override public boolean disposePixmap () { throw new GdxRuntimeException("This TextureData implementation does not return a Pixmap"); } @Override public int getWidth () { return width; } @Override public int getHeight () { return height; } @Override public Format getFormat () { return Format.RGB565; } @Override public boolean useMipMaps () { return useMipMaps; } @Override public boolean isManaged () { return true; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/dynamics/com/badlogic/gdx/physics/bullet/dynamics/SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.dynamics; public class SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t { private transient long swigCPtr; protected SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t (long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t () { swigCPtr = 0; } protected static long getCPtr (SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.dynamics; public class SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t { private transient long swigCPtr; protected SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t (long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t () { swigCPtr = 0; } protected static long getCPtr (SWIGTYPE_p_btAlignedObjectArrayT_btSolverBody_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/src/bullet/BulletCollision/Gimpact/btContactProcessing.cpp
/* This source file is part of GIMPACT Library. For the latest info, see http://gimpact.sourceforge.net/ Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371. email: [email protected] This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btContactProcessing.h" #define MAX_COINCIDENT 8 struct CONTACT_KEY_TOKEN { unsigned int m_key; int m_value; CONTACT_KEY_TOKEN() { } CONTACT_KEY_TOKEN(unsigned int key,int token) { m_key = key; m_value = token; } CONTACT_KEY_TOKEN(const CONTACT_KEY_TOKEN& rtoken) { m_key = rtoken.m_key; m_value = rtoken.m_value; } inline bool operator <(const CONTACT_KEY_TOKEN& other) const { return (m_key < other.m_key); } inline bool operator >(const CONTACT_KEY_TOKEN& other) const { return (m_key > other.m_key); } }; class CONTACT_KEY_TOKEN_COMP { public: bool operator() ( const CONTACT_KEY_TOKEN& a, const CONTACT_KEY_TOKEN& b ) const { return ( a < b ); } }; void btContactArray::merge_contacts( const btContactArray & contacts, bool normal_contact_average) { clear(); int i; if(contacts.size()==0) return; if(contacts.size()==1) { push_back(contacts[0]); return; } btAlignedObjectArray<CONTACT_KEY_TOKEN> keycontacts; keycontacts.reserve(contacts.size()); //fill key contacts for ( i = 0;i<contacts.size() ;i++ ) { keycontacts.push_back(CONTACT_KEY_TOKEN(contacts[i].calc_key_contact(),i)); } //sort keys keycontacts.quickSort(CONTACT_KEY_TOKEN_COMP()); // Merge contacts int coincident_count=0; btVector3 coincident_normals[MAX_COINCIDENT]; unsigned int last_key = keycontacts[0].m_key; unsigned int key = 0; push_back(contacts[keycontacts[0].m_value]); GIM_CONTACT * pcontact = &(*this)[0]; for( i=1;i<keycontacts.size();i++) { key = keycontacts[i].m_key; const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value]; if(last_key == key)//same points { //merge contact if(pcontact->m_depth - CONTACT_DIFF_EPSILON > scontact->m_depth)//) { *pcontact = *scontact; coincident_count = 0; } else if(normal_contact_average) { if(btFabs(pcontact->m_depth - scontact->m_depth)<CONTACT_DIFF_EPSILON) { if(coincident_count<MAX_COINCIDENT) { coincident_normals[coincident_count] = scontact->m_normal; coincident_count++; } } } } else {//add new contact if(normal_contact_average && coincident_count>0) { pcontact->interpolate_normals(coincident_normals,coincident_count); coincident_count = 0; } push_back(*scontact); pcontact = &(*this)[this->size()-1]; } last_key = key; } } void btContactArray::merge_contacts_unique(const btContactArray & contacts) { clear(); if(contacts.size()==0) return; if(contacts.size()==1) { push_back(contacts[0]); return; } GIM_CONTACT average_contact = contacts[0]; for (int i=1;i<contacts.size() ;i++ ) { average_contact.m_point += contacts[i].m_point; average_contact.m_normal += contacts[i].m_normal * contacts[i].m_depth; } //divide btScalar divide_average = 1.0f/((btScalar)contacts.size()); average_contact.m_point *= divide_average; average_contact.m_normal *= divide_average; average_contact.m_depth = average_contact.m_normal.length(); average_contact.m_normal /= average_contact.m_depth; }
/* This source file is part of GIMPACT Library. For the latest info, see http://gimpact.sourceforge.net/ Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371. email: [email protected] This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "btContactProcessing.h" #define MAX_COINCIDENT 8 struct CONTACT_KEY_TOKEN { unsigned int m_key; int m_value; CONTACT_KEY_TOKEN() { } CONTACT_KEY_TOKEN(unsigned int key,int token) { m_key = key; m_value = token; } CONTACT_KEY_TOKEN(const CONTACT_KEY_TOKEN& rtoken) { m_key = rtoken.m_key; m_value = rtoken.m_value; } inline bool operator <(const CONTACT_KEY_TOKEN& other) const { return (m_key < other.m_key); } inline bool operator >(const CONTACT_KEY_TOKEN& other) const { return (m_key > other.m_key); } }; class CONTACT_KEY_TOKEN_COMP { public: bool operator() ( const CONTACT_KEY_TOKEN& a, const CONTACT_KEY_TOKEN& b ) const { return ( a < b ); } }; void btContactArray::merge_contacts( const btContactArray & contacts, bool normal_contact_average) { clear(); int i; if(contacts.size()==0) return; if(contacts.size()==1) { push_back(contacts[0]); return; } btAlignedObjectArray<CONTACT_KEY_TOKEN> keycontacts; keycontacts.reserve(contacts.size()); //fill key contacts for ( i = 0;i<contacts.size() ;i++ ) { keycontacts.push_back(CONTACT_KEY_TOKEN(contacts[i].calc_key_contact(),i)); } //sort keys keycontacts.quickSort(CONTACT_KEY_TOKEN_COMP()); // Merge contacts int coincident_count=0; btVector3 coincident_normals[MAX_COINCIDENT]; unsigned int last_key = keycontacts[0].m_key; unsigned int key = 0; push_back(contacts[keycontacts[0].m_value]); GIM_CONTACT * pcontact = &(*this)[0]; for( i=1;i<keycontacts.size();i++) { key = keycontacts[i].m_key; const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value]; if(last_key == key)//same points { //merge contact if(pcontact->m_depth - CONTACT_DIFF_EPSILON > scontact->m_depth)//) { *pcontact = *scontact; coincident_count = 0; } else if(normal_contact_average) { if(btFabs(pcontact->m_depth - scontact->m_depth)<CONTACT_DIFF_EPSILON) { if(coincident_count<MAX_COINCIDENT) { coincident_normals[coincident_count] = scontact->m_normal; coincident_count++; } } } } else {//add new contact if(normal_contact_average && coincident_count>0) { pcontact->interpolate_normals(coincident_normals,coincident_count); coincident_count = 0; } push_back(*scontact); pcontact = &(*this)[this->size()-1]; } last_key = key; } } void btContactArray::merge_contacts_unique(const btContactArray & contacts) { clear(); if(contacts.size()==0) return; if(contacts.size()==1) { push_back(contacts[0]); return; } GIM_CONTACT average_contact = contacts[0]; for (int i=1;i<contacts.size() ;i++ ) { average_contact.m_point += contacts[i].m_point; average_contact.m_normal += contacts[i].m_normal * contacts[i].m_depth; } //divide btScalar divide_average = 1.0f/((btScalar)contacts.size()); average_contact.m_point *= divide_average; average_contact.m_normal *= divide_average; average_contact.m_depth = average_contact.m_normal.length(); average_contact.m_normal /= average_contact.m_depth; }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/softbody/com/badlogic/gdx/physics/bullet/softbody/SWIGTYPE_p_int.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.softbody; public class SWIGTYPE_p_int { private transient long swigCPtr; protected SWIGTYPE_p_int (long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_int () { swigCPtr = 0; } protected static long getCPtr (SWIGTYPE_p_int obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.softbody; public class SWIGTYPE_p_int { private transient long swigCPtr; protected SWIGTYPE_p_int (long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_int () { swigCPtr = 0; } protected static long getCPtr (SWIGTYPE_p_int obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
-1
libgdx/libgdx
7,229
6901 - Support Tiled "Object" Type Map Property
EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
JohnLavender474
2023-09-20T18:32:57Z
2023-10-05T13:27:44Z
ce9e6922519a7232dbefc8dd41694a9a923e9415
02202a37f4030b085769e0f4beee46b4571b229b
6901 - Support Tiled "Object" Type Map Property. EDIT: Instead of loading MapProperties, I'm opting now to load the MapObjects instead ------ This PR is in response to issue [6901 Support Tiled "object" type MapProperty](https://github.com/libgdx/libgdx/issues/6901). The request is that the "object" property type in Tiled be supported in LibGDX. Here, my solution is to use the ~~MapProperties of the object~~ MapObject being pointed to as the value of the "object" type property. In the [BaseTmxMapLoader](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/gdx/src/com/badlogic/gdx/maps/tiled/BaseTmxMapLoader.java) class, the properties of objects are loaded as normal except for a few differences. The first difference is that mappings are added to an ObjectMap instance where the key is the id of the object and the value is the ~~MapProperties of the object~~ MapObject. The second difference is that when the type of a property is "object", then a Runnable instance is created where in the run method the MapProperties of the object being pointed to is added as a property. The Runnable is added to a queue, and the Runnables are not run until the end of the loadTiledMap method. Doing it this way ensures that all MapProperties are loaded before attempting to fetch them. The [TiledMapObjectPropertyTest](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests/src/com/badlogic/gdx/tests/TiledMapObjectPropertyTest.java) class tests that "object" properties are successfully loaded. The test includes ensuring that a circular graph does not lead to infinite recursion. Feel free to open [the tmx file](https://github.com/JohnLavender474/LibGDX--Support-Tiled-object-type-MapProperty-6901/blob/6901_Support-Tiled-object-type-MapProperty/tests/gdx-tests-android/assets/data/maps/tiled-objects/test-object-properties.tmx) to ensure proper testing.
./extensions/gdx-bullet/jni/swig-src/collision/com/badlogic/gdx/physics/bullet/collision/btCapsuleShape.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btCapsuleShape extends btConvexInternalShape { private long swigCPtr; protected btCapsuleShape (final String className, long cPtr, boolean cMemoryOwn) { super(className, CollisionJNI.btCapsuleShape_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btCapsuleShape, normally you should not need this constructor it's intended for low-level usage. */ public btCapsuleShape (long cPtr, boolean cMemoryOwn) { this("btCapsuleShape", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(CollisionJNI.btCapsuleShape_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (btCapsuleShape obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btCapsuleShape(swigCPtr); } swigCPtr = 0; } super.delete(); } public long operatorNew (long sizeInBytes) { return CollisionJNI.btCapsuleShape_operatorNew__SWIG_0(swigCPtr, this, sizeInBytes); } public void operatorDelete (long ptr) { CollisionJNI.btCapsuleShape_operatorDelete__SWIG_0(swigCPtr, this, ptr); } public long operatorNew (long arg0, long ptr) { return CollisionJNI.btCapsuleShape_operatorNew__SWIG_1(swigCPtr, this, arg0, ptr); } public void operatorDelete (long arg0, long arg1) { CollisionJNI.btCapsuleShape_operatorDelete__SWIG_1(swigCPtr, this, arg0, arg1); } public long operatorNewArray (long sizeInBytes) { return CollisionJNI.btCapsuleShape_operatorNewArray__SWIG_0(swigCPtr, this, sizeInBytes); } public void operatorDeleteArray (long ptr) { CollisionJNI.btCapsuleShape_operatorDeleteArray__SWIG_0(swigCPtr, this, ptr); } public long operatorNewArray (long arg0, long ptr) { return CollisionJNI.btCapsuleShape_operatorNewArray__SWIG_1(swigCPtr, this, arg0, ptr); } public void operatorDeleteArray (long arg0, long arg1) { CollisionJNI.btCapsuleShape_operatorDeleteArray__SWIG_1(swigCPtr, this, arg0, arg1); } public btCapsuleShape (float radius, float height) { this(CollisionJNI.new_btCapsuleShape__SWIG_1(radius, height), true); } public int getUpAxis () { return CollisionJNI.btCapsuleShape_getUpAxis(swigCPtr, this); } public float getRadius () { return CollisionJNI.btCapsuleShape_getRadius(swigCPtr, this); } public float getHalfHeight () { return CollisionJNI.btCapsuleShape_getHalfHeight(swigCPtr, this); } public void deSerializeFloat (btCapsuleShapeData dataBuffer) { CollisionJNI.btCapsuleShape_deSerializeFloat(swigCPtr, this, btCapsuleShapeData.getCPtr(dataBuffer), dataBuffer); } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btCapsuleShape extends btConvexInternalShape { private long swigCPtr; protected btCapsuleShape (final String className, long cPtr, boolean cMemoryOwn) { super(className, CollisionJNI.btCapsuleShape_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btCapsuleShape, normally you should not need this constructor it's intended for low-level usage. */ public btCapsuleShape (long cPtr, boolean cMemoryOwn) { this("btCapsuleShape", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(CollisionJNI.btCapsuleShape_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); } public static long getCPtr (btCapsuleShape obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btCapsuleShape(swigCPtr); } swigCPtr = 0; } super.delete(); } public long operatorNew (long sizeInBytes) { return CollisionJNI.btCapsuleShape_operatorNew__SWIG_0(swigCPtr, this, sizeInBytes); } public void operatorDelete (long ptr) { CollisionJNI.btCapsuleShape_operatorDelete__SWIG_0(swigCPtr, this, ptr); } public long operatorNew (long arg0, long ptr) { return CollisionJNI.btCapsuleShape_operatorNew__SWIG_1(swigCPtr, this, arg0, ptr); } public void operatorDelete (long arg0, long arg1) { CollisionJNI.btCapsuleShape_operatorDelete__SWIG_1(swigCPtr, this, arg0, arg1); } public long operatorNewArray (long sizeInBytes) { return CollisionJNI.btCapsuleShape_operatorNewArray__SWIG_0(swigCPtr, this, sizeInBytes); } public void operatorDeleteArray (long ptr) { CollisionJNI.btCapsuleShape_operatorDeleteArray__SWIG_0(swigCPtr, this, ptr); } public long operatorNewArray (long arg0, long ptr) { return CollisionJNI.btCapsuleShape_operatorNewArray__SWIG_1(swigCPtr, this, arg0, ptr); } public void operatorDeleteArray (long arg0, long arg1) { CollisionJNI.btCapsuleShape_operatorDeleteArray__SWIG_1(swigCPtr, this, arg0, arg1); } public btCapsuleShape (float radius, float height) { this(CollisionJNI.new_btCapsuleShape__SWIG_1(radius, height), true); } public int getUpAxis () { return CollisionJNI.btCapsuleShape_getUpAxis(swigCPtr, this); } public float getRadius () { return CollisionJNI.btCapsuleShape_getRadius(swigCPtr, this); } public float getHalfHeight () { return CollisionJNI.btCapsuleShape_getHalfHeight(swigCPtr, this); } public void deSerializeFloat (btCapsuleShapeData dataBuffer) { CollisionJNI.btCapsuleShape_deSerializeFloat(swigCPtr, this, btCapsuleShapeData.getCPtr(dataBuffer), dataBuffer); } }
-1
libgdx/libgdx
7,215
Revert #6821
obigu
2023-08-22T10:02:37Z
2023-08-25T03:27:36Z
c9ed23f0371f1ece2942ccff2086893f2c08e1c9
ed811688c42a3eeb32427e56b47988e7ac4a6539
Revert #6821.
./CHANGES
[1.12.1] - LWJGL3 Improvement: Audio device is automatically switched if it was changed in the operating system. - Tiled Fix: TiledLayer parallax default values fix [1.12.0] - [BREAKING CHANGE] Added #touchCancelled to InputProcessor interface, see #6871. - [BREAKING CHANGE] Android: Immersive mode is now true by default. Set `useImmersiveMode` config to `false` to disable it. - [BREAKING CHANGE] iOS: Increased min supported iOS version to 11.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] iOS: `hideHomeIndicator` set to `false` by default (was `true`). - [BREAKING CHANGE] iOS: `screenEdgesDeferringSystemGestures` set to `UIRectEdge.All` by default (was `UIRectEdge.None`). - [BREAKING CHANGE] iOS: preferred FPS is now uncapped by default, see #6717 - [BREAKING CHANGE] iOS: `ApplicationListener.create` and first `resize` are now called within `UIApplicationDelegate.didFinishLaunching`. Allows for earlier rendering and prevents black screen frames after launch screen. NOTE: App will get terminated if this method is blocked for more than 10-20 sec. - [BREAKING CHANGE] Actor#localToAscendantCoordinates throws an exception if the specified actor is not an ascendant. - [BREAKING CHANGE] WidgetGroup#hit first validates the layout. - [BREAKING CHANGE] Cell getters return object wrapper instead of primitives. - [BREAKING CHANGE] MeshPartBuilder#lastIndex now returns int instead of short. - [BREAKING CHANGE] 3D API - max bone weights is now configurable and limited to 4 by default. Change this value if you need less or more. See #6522. - [BREAKING CHANGE] Mesh#getVerticesBuffer, Mesh#getIndicesBuffer, VertexData#getBuffer, and IndexData#getBuffer are deprecated in favor to new methods with boolean parameter. If you subclassed some of these classes, you need to implement the new methods. - [BREAKING CHANGE] Desktop: The return value of AudioDevice#getLatency() is now in samples, and not milliseconds - [BREAKING CHANGE] iOS: 32 bit (armv7) builds are no longer supported. Builds must be 64 bit (arm64) only. - [BREAKING CHANGE] iOS: Use dynamic frameworks instead of static libs - [BREAKING CHANGE] optimized Mesh#bind and Mesh#unbind have a new parameter for instanced attribute locations. If you use these methods without instancing, you can pass a null value. - [BREAKING CHANGE] Dropped support for older libc versions since libGDX is now built on Ubuntu 20.04 (#7005) - Update to jnigen 2.4.1 - LWJGL Fix: setPosision() for MP3 files. - iOS: Add new MobiVM MetalANGLE backend - iOS: Update to MobiVM 2.3.19 - Update to LWJGL 3.3.2 - API Addition: Added Audio#switchOutputDevice and Audio#getAvailableOutputDevices to specify output devices. Only works for LWJGL3 - Fix LWJGL3: Audio doesn't die anymore, if a device gets disconnected - API Addition: Added Haptics API with 4 different Input#vibrate() methods with complete Android and iOS implementations. - Fix: Fixed Android and iOS touch cancelled related issues, see #6871. - Javadoc: Add "-use" flag to javadoc generation - Android: gdx-setup now uses AGP 7.2.2 and SDK 32, requiring Android Studio Chipmunk or IntelliJ IDEA 2022.2 and JDK 11. - libGDX is now built using Java 11 due to new Android requirements. The rest of libGDX can still be built with JDK 8 and runtime compatibility of libGDX projects should be unaffected. - Fixed glViewport when using HdpiMode.Logical with the LWJGL3 backend. - Added Stage#actorRemoved to fire exit events just before an actor is removed. - ScrollPane#setScrollingDisabled avoids invalidate() if nothing changed. - Fixed incorrect ScrollPane#scrollTo. - API Addition: Added Texture3D support - Fix: Throw an exception when maximum Attribute count is reached to prevent silent failure. - API Fix: The cursor can now be catched on Android. - LWJGL3 Fix: Stereo audio can now be played on mono output devices. This may also improve downmixing to stereo and upmixing to surround. - API Addition: Added CheckBox#getImageDrawable. - FIX: HexagonalTiledMapRenderer now displays maps with the correct stagger index. - API Addition: Added I18NBundle#keys() method. - TOOLS Features: Save mode can be changed in Flame particle 3D editor. - API Addition: added WebGL 2.0 implementation to Gwt backend : you can enable it by GwtApplicationConfiguration#useGL30 - Added GLES31 and GLES32 support with Lwjgl3 backend implementation - API Addition: JsonReader#stop() to stop parsing. - API Change: TextureAtlas now uses FileHandle#reader so outside code can control the charset - API Fix: Intersector#isPointInTriangle - API Addition: The Skin serializer now supports useIntegerPositions - API Change: The skin serializer now treats scaledSize as a float - API Change: DataInput throws an EOF-Exception - API Fix: RenderBuffer leak in GLFrameBuffer class - API Change: Pixmap#setPixels will now verify it has been given a direct ByteBuffer - API Addition: glTexImage2D and glTexSubImage2D with offset parameter - API Addition: OrientedBoundingBox - API Addition: Tiled parallax factor support - API Fix: LWJGL 3’s borderless fullscreen works with negative monitor coords - API Fix: Update mouse x and y values immediately after calling #setCursorPosition - API Change: Never stall with AssetManager on GWT - API Change: Allow packed depth stencil buffer creation when not using GL30 - API Fix: Fixed DataInput#readString for non-ASCII - API Fix: LwjglGraphics.setupDisplay() is no longer choosing the wrong display mode - API Fix: MathUtils.lerpAngle() fixed for extreme inputs - MathUtils trigonometry improvements - Various Scene2D fixes and improvements [1.11.0] - [BREAKING CHANGE] iOS: Increased min supported iOS version to 9.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] Removed Maven and Ant build systems. libGDX is now solely built with Gradle. See https://libgdx.com/dev/from-source/ for updated build instructions. - [BREAKING CHANGE] Android Moved natives loading out of static init block, see #5795 - [BREAKING CHANGE] Linux: Shared libraries are now built on Ubuntu 18.04 (up from Ubuntu 16.04) - [BREAKING CHANGE] The built-in font files arial-15.fnt and arial-15.png have been replaced with lsans-15.fnt and lsans-15.png; this may change some text layout that uses the built-in font, and code that expects arial-15 assets to be present must change to lsans-15. - [BREAKING CHANGE] Legacy LWJGL3 projects must update the sourceCompatibility to 1.8 or higher. - [BREAKING CHANGE] Android Removed hideStatusBar configuration, see #6683 - [BREAKING CHANGE] Lwjgl3ApplicationConfiguration#useOpenGL3 was replaced by #setOpenGLEmulation - Gradle build now takes -PjavaVersion=7|8|9... to specify the Java version against which to compile libGDX. Default is Java 7 for everything, except the LWJGL3 backend, which is compiled for Java 8. - LWJGL3 extension: Added gdx-lwjgl3-glfw-awt-macos extension. Fixes GLFW in such a way, that the LWJGL3/libGDX must no longer run on the main thread in macOS, which allows AWT to work in parallel, i.e. file dialogs, JFrames, ImageIO, etc. You no longer need to pass `-XstartOnFirstThread` when starting an LWJGL3 app on macOS. See `AwtTestLWJGL` in gdx-tests-lwjgl3. For more information, see https://github.com/libgdx/libgdx/pull/6772 - API Addition: Added LWJGL3 ANGLE support for x86_64 Windows, Linux, and macOS. Emulates OpenGL ES 2.0 through DirectX (Windows), desktop OpenGL (Linux), and Metal (macOS). May become the preferred method of rendering on macOS if Apple removes OpenGL support entirely. May fix some OpenGL driver issues. More information here: https://github.com/libgdx/libgdx/pull/6672 - iOS: Update to MobiVM 2.3.16 - Update to LWJGL 3.3.1 - API Addition: ObjLoader now supports ambientColor, ambientTexture, transparencyTexture, specularTexture and shininessTexture - API Addition: PointSpriteParticleBatch blending is now configurable. - TOOLS Features: Blending mode and sort mode can be changed in Flame particle 3D editor. - API Addition: Polygon methods setVertex, getVertex, getVertexCount, getCentroid. - API Addition: TMX built-in tile property "type" is now supported. - API Addition: Octree structure. - API Addition: Added StringBuilder#toStringAndClear() method. - FirstPersonCameraController keys mapping is now configurable - Fix: GlyphLayout: Several fixes for color markup runs with multi-line or wrapping texts - API change: GlyphLayout#GlyphRun is now one GlyphRun per line. "color" was removed from GlyphRun and is now handled by GlyphLayout. - Gdx Setup Tool: Target Android API 30 and update AGP plugin to 4.1.3 - API Fix: Sound IDs are now properly removed; this prevents changes to music instances with the same ID - API Fix: LWJGL3Net#openURI does now work on macOS & JDK >= 16 - API Fix: Fixed a possible deadlock with AssetManager#dispose() and #clear() - API Change: Enable the AL_DIRECT_CHANNELS_SOFT option for Sounds and AudioDevices as well to fix stereo sound - API Addition: CameraInputController#setInvertedControls(boolean) - API Removal: AnimatedTiledMapTile#frameCount - LWJGL 3 is now the default desktop backend. If you want to port your existing applications, take a look here: https://gist.github.com/crykn/eb37cb4f7a03d006b3a0ecad27292a2d - Brought the official and third-party extensions in gdx-setup up to date. Removed some unmaintained ones and added gdx-websockets & jbump. - API Fix: Escaped characters in XML attributes are now properly un-escaped - Bug Fix: AssetManager backslash conversion removed - fixes use of filenames containing backslashes - gdx-setup now places the assets directory in project root instead of android or core. See advanced settings (UI) or arguments (command line) if you don't want it in root. - API Fix: Resolved issues with LWJGL 3 and borderless fullscreen - API Addition: GeometryUtils,polygons isCCW, ensureClockwise, reverseVertices - API Addition: Added FreeTypeFontGenerator#hasCharGlyph method. - API Fix: Pool discard method now resets object by default. This fixes the known issue about Pool in libGDX 1.10.0. - API Addition: Split GWT reflection cache into two generated classes - API Fix: Fix Box2D memory leak with ropes on GWT - API Fix: Fix NPE in Type#getDeclaredAnnotation - API Addition: Add pause/resume methods to AudioDevice - API Fix: Protection against NullPointerException in World#destroyBody() - API Fix: Prevent repeated mipmap generation in FileTextureArrayData - API Fix: Fix issue with camera reference in CameraGroupStrategy’s default sorter - API Fix: Move vertex array index buffer limit to backends to fix issue with numIndices parameter - API Fix: TexturePacker: Fix wrong Y value when using padding - API Fix: Lwjgl3Net: Add fallback to xdg-open on Linux if Desktop.BROWSE is unavailable - API Addition: Add NWSEResize, NESWResize, AllResize, NotAllowed and None SystemCursors - API Addition: GWTApplication#getJavaHeap and getNativeHeap are now supported - API Addition: Box2D Shape now implements Disposable - API Addition: Added ChainShape#clear method - API Addition: Added Tooltip#setTouchIndependent; see #6758 - API Addition: Emulate Timer#isEmpty on GWT - API Addition: Bits add copy constructor public Bits (Bits bitsToCpy) - API Addition: Added List#drawSelection(). - API Addition: GwtApplicationConfiguration#xrCompatible - API Fix: setSystemCursor() now works on Android - API Fix: getDisplayMode() is now more accurate on Android and GWT. - API Addition: JsonValue#iterator(String) to more easily iterate a child that may not exist. - API Addition: Added ExtendViewport#setScaling, eg for use with Scaling.contain. - API Addition: Added application lifecycle methods to IOSAudio for custom audio implementations. - API Addition: Added getBoundingRectangle() to Polyline - API Addition: ShapeRenderer#check() has now protected visibility - API Addition: Add ability to host GWT module on a different domain than the site, see #6851 - API Addition: Addes Tooltip#setTouchIndependent; see #6758 - API ADDITION: Emulate Timer#isEmpty on GWT - API Addition: OrientedBoundingBox. [1.10.0] - [BREAKING CHANGE] Android armeabi support has been removed. To migrate your projects: remove any dependency with natives-armeabi qualifier from your gradle build file, this apply to gdx-platform, gdx-bullet-platform, gdx-freetype-platform and gdx-box2d-platform. - [BREAKING CHANGE] tvOS libraries have been removed. No migration steps required. - [BREAKING CHANGE] Linux x86 (32-bit) support has been removed. No migration steps required. - [BREAKING CHANGE] Requires Java 7 or above. - [BREAKING CHANGE] API Change: Scaling is now an object instead of an enum. This may change behavior when used with serialization. - [BREAKING CHANGE] Group#clear() and #clearChildren() now unfocus the children. Added clear(boolean) and clearChildren(boolean) for when this isn't wanted. Code that overrides clear()/clearChildren() probably should change to override the (boolean) method. #6423 - [BREAKING CHANGE] Lwjgl3WindowConfiguration#autoIconify is enabled by default. - [KNOWN ISSUE] Pool no longer reset freed objects when pool size is above its retention limit. Pool will discard objects instead. If you want to keep the old behavior, you should override Pool#discard method to reset discarded objects. - Scene2d.ui: Added new ParticleEffectActor to use particle effects on Stage - API addition: iOS: Added HdpiMode option to IOSApplicationConfiguration to allow users to set whether they want to work in logical or raw pixels (default logical). - Fix for #6377 Gdx.net.openURI not working with targetSdk 30 - Api Addition: Added a Pool#discard(T) method. - Architecture support: Linux ARM and AARCH64 support has been added. The gdx-xxx-natives.jar files now contain native libraries of these architectures as well. - API Addition: Desktop Sound now returns number of channels and sample rate. [1.9.14] - [BREAKING CHANGE] iOS: IOSUIViewController has been moved to its own separate class - [BREAKING CHANGE] API Change: G3D AnimationDesc#update now returns -1 (instead of 0) if animation not finished. - [BREAKING CHANGE] InputEventQueue no longer implements InputProcessor, pass InputProcessor to #drain. - [BREAKING CHANGE] HeadlessApplicationConfiguration#renderInterval was changed to #updatesPerSecond - API addition: Added Pixmap#setPixels(ByteBuffer). - API change: ScreenUtils#getFrameBufferPixmap is deprecated in favor to new method Pixmap#createFromFrameBuffer. - API Addition: Added overridable createFiles() methods to backend application classes to allow initializing custom module implementations. - API Addition: Add a Graphics#setForegroundFPS() method. [1.9.13] - [BREAKING CHANGE] Fixed keycode representations for ESCAPE, END, INSERT and F1 to F12. These keys are working on Android now, but if you hardcoded or saved the values you might need to migrate. - [BREAKING CHANGE] TextureAtlas.AtlasRegion and Region splits and pads fields have been removed and moved to name/value pairs, use #findValue("split") and #findValue("pad") instead. - iOS: Update to MobiVM 2.3.12 - GWT: Key codes set with Gdx.input.setCatchKey prevent default browser behaviour - Added Scaling.contain mode: Scales the source to fit the target while keeping the same aspect ratio, but the source is not scaled at all if smaller in both directions. - API Addition: Added hasContents() to Clipboard interface, to reduce clipboard notifications on iOS 14 - TOOLS Features: Blending mode can be changed in Flame particle 3D editor. - Input Keycodes added: CAPS_LOCK, PAUSE (aka Break), PRINT_SCREEN, SCROLL_LOCK, F13 to F24, NUMPAD_DIVIDE, NUMPAD_MULTIPLY, NUMPAD_SUBTRACT, NUMPAD_ADD, NUMPAD_DOT, NUMPAD_COMMA, NUMPAD_ENTER, NUMPAD_EQUALS, NUMPAD_LEFT_PAREN, NUMPAD_RIGHT_PAREN, NUM_LOCK. Following changes might be done depending on platform: Keys.STAR to Keys.NUMPAD_MULTIPLY, Keys.SLASH to Keys.NUMPAD_DIVIDE, Keys.NUM to Keys.NUM_LOCK, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.PERIOD to Keys.NUMPAD_DOT, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.ENTER to Keys.NUMPAD_ENTER, Keys.PLUS to Keys.NUMPAD_ADD, Keys.MINUS to Keys.NUMPAD_SUBTRACT - Added a QuadFloatTree class. - Desktop: Cubemap Seamless feature is now enabled by default when supported, can be changed via backend specific methods, see supportsCubeMapSeamless and enableCubeMapSeamless in both LwjglGraphics and Lwjgl3Graphics. - API Addition: TextureAtlas reads arbitrary name/value pairs for each region. See #6316. - TexturePacker writes using a new format when legacyOutput is false (default is true). TextureAtlas can read both old and new formats. See #6316. [1.9.12] - [BREAKING CHANGE] iOS: Changed how Retina/hdpi handled on iOS. See #3709. - [BREAKING CHANGE] API Change: InputProcessor scrolled method now receives scroll amount for X and Y. Changed type to float to support devices which report fractional scroll amounts. Updated InputEvent in scene2d accordingly: added scrollAmountX, scrollAmountY attributes and corresponding setters and getters. See #6154. - [BREAKING CHANGE] API Change: Vector2 angleRad(Vector2) now correctly returns counter-clockwise angles. See #5428 - [BREAKING CHANGE] Android: getDeltaTime() now returns the raw delta time instead of a smoothed one. See #6228. - Fixed vertices returned by Decal.getVertices() not being updated - Fixes Issue #5048. The function Intersector.overlapConvexPolygons now should return the right minimum translation vector values. - Update to MobiVM 2.3.11 - API Change: Removed Pool constructor with preFill parameter in favor of using Pool#fill() method. See #6117 - API Addition: Slider can now be configured to only trigger on certain mouse button clicks (Slider#setButton(int)). - Fixed GlyphLayout not laying out correctly with color markup. - Fixed TileDrawable not applying its scale correctly. - API Addition: Added epsilon methods to maps with float values. - API Addition: Added an insertRange method to array collections. - Fixed GestureDetector maxFlingDelay. - API Change: Changed default GestureDetector maxFlingDelay to Integer.MAX_VALUE (didn't work before, this matches that). - Gdx.files.external on Android now uses app external storage - see wiki article File handling for more information - Improved text, cursor and selection rendering in TextArea. - API Addition: Added setProgrammaticChangeEvents, updateVisualValue, round methods to ProgressBar/Slider. - iOS: Keyboard events working on RoboVM on iOS 13.5 and up, uses same API as on other platforms - API Addition: Added AndroidLiveWallpaper.notifyColorsChanged() to communicate visually significant colors back to the wallpaper engine. - API Change: AssetManager invokes the loaded callback when an asset is unloaded from the load queue if the asset is already loaded. - GWT: changed audio backend to WebAudio API. Now working on mobiles, pitch implemented. Configuration change: preferFlash removed. When updating existing projects, you can remove the soundmanager js files from your webapp folder and the references to it from index.html - GWT: added possibility to lazy load assets via AssetManager instead of preload them before game start. See GWT specifics wiki article for more information. - GWT: New configuration setting usePhysicalPixels to use native resolution on mobile / Retina / HDPI screens. When using this option, make sure to update your code in index.html and HTMLLauncher from setup template. - GWT: GwtApplicationConfiguration and GWT backend now support an application to be resizable or fixed size. You can remove your own resizing code from your HTMLLaunchers. - GWT: Assets in distribute build are renamed with md5 hash suffix to bypass browser cache on changes - GWT: Fixed GwtFileHandle that was only returning text assets when listing a directory, now returns all children - API Addition: Pixmap.downloadFromUrl() downloads an image from http(s) URLs and passes it back as a Pixmap on all platforms - Added support for Linux ARM builds. - 32-bit: ARMv7/armhf - 64-bit: ARMv8/AArch64 - API Change: Removed arm abi from SharedLibraryLoader - API Addition: Added a Lwjgl3ApplicationConfiguration#foregroundFPS option. - API Change: Utility classes are now final and have a private constructor to prevent instantiation. - API Change: ScrollPane now supports all combinations of scrollBarsOnTop and fadeScrollBars. - API Addition: Added new methods with a "deg" suffix in the method's name for all Vector2 degrees-based methods and deprecated the old ones. - API Addition: Added Slider#setVisualPercent. - API Change: Enabling fullscreen mode on the lwjgl3 backend now automatically sets the vsync setting again. - API Addition: Added put(key, value, defaultValue) for maps with primitive keys, so the old value can be returned. - API Addition: Added ObjectLongMap. - Added Intersector#intersectRayOrientedBoundsFast to detect if a ray intersects an oriented bounding box, see https://github.com/libgdx/libgdx/pull/6139 - API Addition: Added Table#clip() and Container#clip() methods. - API Addition: Added getBackgroundDrawable() to Button. - API Addition: Added imageCheckedDown and getImageDrawable() to ImageButton and ImageTextButton. - API Addition: Added focusedFontColor, checkedFocusedFontColor, and getFontColor() to TextButton and ImageTextButton. - API Addition: Added wrapReverse setting to HorizontalGroup. - API Addition: Added Slider style drawables for over and down: background, knobBefore, and knobAfter. - Fixed LwjglFrame not hiding the canvas in some situations. - API Change: Table#round uses ceil/floor and is applied during layout, rather than afterward. - Fixed blurry NinePatch rendering when using a single center region. - API Change: Upon changing the window size with the lwjgl3 backend, the window is centered on the monitor. - Fixed DepthShaderProvider no longer creates one DepthShader per bones count. Now it creates only one skinned variant and one non-skinned variant based on DepthShader/Config numBones. - API Addition: Added Intersector#intersectPlanes to calculate the point intersected by three planes, see https://github.com/libgdx/libgdx/pull/6217 - API Addition: Added alternative Android Audio implementation for performant sound. See https://github.com/libgdx/libgdx/pull/6243. - API Addition: Expose SpriteBatch and PolygonSpriteBatch setupMatrices() as protected. - API Addition: New parameter OnscreenKeyboardType for Input.setOnscreenKeyboardVisible and Input.getTextInput [1.9.11] - Update to MobiVM 2.3.8 - Update to LWJGL 3.2.3 - Fixed AndroidInput crashes due to missing array resize (pressure array). - API Change: Ray#set methods and Ray#mul(Matrix4) normalize direction vector. Use public field to set and avoid nor() - API Change: New internal implementation of all Map and Set classes (except ArrayMap) to avoid OutOfMemoryErrors when too many keys collide. This also helps resistance against malicious users who can choose problematic names. - API Addition: OrderedMap#alter(Object,Object) and OrderedMap#alterIndex(int,Object) allow swapping out a key in-place without changing its value; OrderedSet also has this. - API Addition: Json can now read/write: ObjectIntMap, ObjectFloatMap, IntMap, LongMap. - API Addition: Added @Null annotation for IDE null analysis. All parameters and return values should be considered non-null unless annotated (or javadoc'ed if not yet annotated). - API Addition: Added ParticleEmitter#preAllocateParticles() and ParticleEffect#preAllocateParticles() to avoid particle allocations during updates. - Fixed changing looping state of already playing sounds on Android by first pausing the sound before setting the looping state (see #5822). - API Change: scene2d: Table#getRow now returns -1 when over the table but not over a row (used to return the last row). - API Change: scene2d: Tree#addToTree and #removeFromTree now have an "int actorIndex" parameter. - API Addition: scene2d: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: scene2d: In TextField, only revert the text if the change event was cancelled. This allows the text to be manipulated in the change listener. - API Change: scene2d: Tree.Node#removeAll renamed to clearChildren. - API Addition: scene2d: Added SelectBox#setSelectedPrefWidth to make the pref width based on the selected item and SelectBoxStyle#overFontColor. - API Change: DefaultTextureBinder WEIGHTED strategy replaced by LRU strategy. - API Change: ShaderProgram begin and end methods are deprecated in favor to bind method. - API Addition: Added a OpenALAudio#getSourceId(long) method. - API Addition: Added a ShaderProgram#getHandle() method. - API Change: Replaced deprecated android support libraries with androidx. AndroidFragmentApplication is only affected. - API Addition: Created interfaces AndroidAudio and AndroidInput and added AndroidApplication#createAudio and AndroidApplication#createInput to allow initializing custom module implementations. - Allows up to 64k (65536) vertices in a Mesh instead of 32k before. Indices can use unsigned short range, so index above 32767 should be converted to int using bitwise mask, eg. int unsigneShortIndex = (shortIndex & 0xFFFF). - API Change: DragAndDrop only removes actors that were not already in the stage. This is to better support using a source actor as the drag actor, see #5675 and #5403. - API Change: Changed TiledMapTileLayer#tileWidth & #tileHeight from float to int - API Addition: convenient Matrix4 rotate methods: rotateTowardDirection and rotateTowardTarget - API Addition: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: Correction of TextField#ENTER_ANDROID renamed to NEWLINE and TextField#ENTER_DESKTOP renamed to CARRIAGE_RETURN. - API Change: Changed the visibility of TextField#BULLET, TextField#DELETE, TextField#TAB and TextField#BACKSPACE to protected. - API Addition: TextField and TextArea are providing the protected method TextField#checkFocusTraverse(char) to handle the focus traversal. - API Addition: UIUtils provides the constants UIUtils#isAndroid and UIUtils#isIos now. - Fixed: The behaving of TextFields and TextAreas new line and focus traversal works like intended on all platforms now. - API Change: Changed Base64Coder#encodeString() to use UTF-8 instead of the platform default encoding. See #6061 - Fixed: SphereShapeBuilder poles are now merged which removes lighting artifacts, see #6068 for more information. - API Change: Matrix3#setToRotation(Vector3, float float) now rotates counter-clockwise about the axis provided. This also changes Matrix3:setToRotation(Vector3, float) and the 3d particles will rotate counter-clockwise as well. - API Change: TexturePacker uses a dash when naming atlas page image files if the name ends with a digit or a digit + 'x'. - API Addition: Added Skin#setScale to control the size of drawables from the skin. This enables scaling a UI and using different sized images to match, without affecting layout. - API Change: Moved adding touch focus from Actor#notify to InputListener#handle (see #6082). Code that overrides InputListener#handle or otherwise handles InputEvent.Type.touchDown events must now call Stage#addTouchFocus to get touchDragged and touchUp events. - API Addition: Added AsynchronousAssetLoader#unloadAsync to fix memory leaks when an asset is unloaded during loading. - Fixed Label text wrapping when it shouldn't (#6098). - Fixed ShapeRenderer not being able to render alpha 0xff (was max 0xfe). - API Change: glGetActiveUniform and glGetActiveAttrib parameter changed from Buffer to IntBuffer. [1.9.10] - API Addition: Allow target display for maximization LWJGL3 backend - API Addition: Accelerometer support on GWT - API Change: Set default behaviour of iOS audio to allow use of iPod - API Change: IOSDevice is no longer an enum to allow users to add their own new devices when LibGDX is not up to date - API Addition: Add statusBarVisible configuration to IOSApplicationConfiguration - Update GWT Backend to GWT 2.8.2 - Update Android backend to build against API 28 (Android 9.0) - API Addition: Input.isButtonJustPressed - Update to LWJGL 2 backend to 2.9.3 - Update to MobiVM 2.3.6 release - Update to LWJGL 3.2.1 - API Addition: Input allows getting the maximum number of pointers supported by the backend - API Addition: Configuration option added to allow setting a max number of threads to use for net requests - API Change: NetJavaImpl now uses a cached thread pool to allow concurrent requests (by default, the thread pool is unbounded - use maxNetThreads in backend configurations to set a limit - set to 1 for previous behavior) - API Addition: New MathUtils norm and map methods - API Change: Pixmap blending was incorrect. Generated fonts may change for the better, but may require adjusting font settings. - API Change: Particle effects obtained from a ParticleEffectPool are now automatically started - Removed OSX 32-bit support - API Change: By default LWJGL2 backend no longer does pause/resume when becoming background/foreground window. New app config setting was added to enable the old behavior. - API Change: By default LWJGL2 backend now does pause/resume when window is minimized/restored. New app config setting was added to disable this behavior. - LWJGL3: Fixed window creation ignoring refresh rate of fullscreen mode. - TmxMapLoader and AtlasTmxMapLoader refactoring: Shared functionality was moved to BaseTmxMapLoader, duplicate code was removed. - AtlasTmxMapLoader supports group layers now (a positive side effect of the BaseTmxMapLoader refactoring). - API Change: TmxMapLoader and AtlasTmxMapLoader: load/loadAsync methods work exactly as before, but many methods of these classes had to change. This makes it possible implement new Tiled features. - API Addition: TextField#drawMessageText. - Fixed TextField rendering text outside the widget at small sizes. - API Addition: Group#getChild(int) - API Addition: notEmpty() for collections. - API Change: scene2d.ui Tree methods renamed for node set/getObject to set/getValue. - API Change: scene2d.ui Tree and Tree.Node require generics for the type of node, values, and actors. - API Change: For Selection in scene2d.utils "toggle" is now respected when !required and selected.size == 1. - API Addition: new InstanceBufferObject and InstanceBufferObjectSubData classes to enable instanced rendering. - API Addition: Support for InstancedRendering via Mesh - API Change: Cell#setLayout renamed to setTable. - API Addition: Added Collections#allocateIterators. When true, iterators are allocated. When false (default), iterators cannot be used nested. - API Addition: Added Group#removeActorAt(int,boolean) to avoid looking up the actor index. Subclasses intending to take action when an actor is removed may need to override this new method. - API Change: If Group#addActorAfter is called with an afterActor not in the group, the actor is added as the last child (not the first). [1.9.9] - API Addition: Add support for stripping whitespace in PixmapPacker - API Addition: Add support for 9 patch packing in PixmapPacker - API Addition: Pressure support for ios/android. https://github.com/libgdx/libgdx/pull/5270 - Update to Lwjgl 3.2.0 - Update android level we build against to 7.1 (API 25) - API Change: gdx-tools no longer bundles dependencies to be compatible with java 9 - Skin JSON files can now use the simple names of classes, i.e. "BitmapFont" rather than "com.badlogic.gdx.graphics.g2d.BitmapFont". Custom classes can be added by overriding Skin.getJsonLoader() and calling json.setClassTag(). - Skin supports cascading styles in JSON. Use the "parent" property to tag another style by name to use its values as defaults. See https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests-android/assets/data/uiskin.json for example. - SkinLoader can be used on subclasses of Skin by overriding generateSkin(). - API addition: Tree indentation can be customized. - Fixed GlyphLayout not respecting BitmapFontData#down. - API Addition: Added faceIndex paramter to #FreeTypeFontGenerator(FileHandle, int). - API Change: BitmapFont#getSpaceWidth changed to BitmapFont#getSpaceXadvance. - Many GlyphLayout fixes. - API Addition: Added FileHandle#map(), can be used to memory map a file - API Change: BitmapFontData#getGlyphs changed for better glyph layout. See https://github.com/libgdx/libgdx/commit/9a7dfdff3c6374a5ebd2f33a819982aceb287dfa - API Change: Actor#hit is now responsible for returning null if invisible. #5264 - API Addition: Added [Collection]#isEmpty() method to all 22 custom LibGDX-collections (e.g. Array, ObjectMap, ObjectSet, Queue, ...) - API Addition: StringBuilder#clear() - API Addition: Color#WHITE_FLOAT_BITS - Table layout fixed when expand is used and the layout width is less than the table's min width. - InputMultiplexer#setProcessors(Array) now copies the items instead of using the specified array instance. - API Change: A wrapped HorizontalGroup or VerticalGroup will now size children down to their min size if the group is smaller than their pref size. - LWJGL3: useVSync() is now a per-window setting. Any additional windows should disable vsync to avoid frames dropping to (refresh rate / # of windows). - Batch and sprite implementations and SpriteCache store Color separately from the float packed color, since converting to/from float is lossy. - API Change: NumberUtils floatToIntColor expands the alpha from 0-254 to 0-255, so 255 doesn't become 254 from conversion from int to float to int. - API Change: Batch and Decal setColor(float) renamed to setPackedColor for differentiation, since the conversion from float to Color is lossy. - API Change: PolygonSprite getVertexColor renamed to getPackedColor to match other classes. - API Change: FreeTypeFontGenerator only generates a missing glyph if \0 is in the characters. - API Change: DragScrollListener no longer requires the touch/mouse cursor to be directly above/below the scroll pane. - API Change: List#toString(Object) changed from protected to public. Subclasses overriding this need to change to public. - API Change: List now handles more key presses. - API Change: TexturePacker ImageProcessor#addImage(File, String) now returns the Rect. [1.9.8] - Add iPhoneX images - Fix MacOS issue with GL_ARB_texture_float extension check - Fix AtlasTmxMapLoader tileset tile id offset - Bullet: updated to 2.87, see: http://bulletphysics.org/wordpress/?p=485 - API Addition: Possibility to specify TexturePacker settings for resampling when scaling. - API Addition: Support for customizing render buffer attachments in GLFrameBuffers - API Change: Revert to constructors for GLFrameBuffers for easier customization [1.9.7] - Update to MobiVM(RoboVM) 2.3.3 - Add iOS 11 support - Update to Lwjgl 3.1.3 - Update to MOE 1.4.0 - API Change: GLFrameBuffer has been refactored https://github.com/libgdx/libgdx/pull/4882. Create standard FrameBuffers with static methods. Customized FBOS with FrameBufferBuilder - API addition: Tiled group layer support - Fix Tiled properties, offset parsing for image layers - API addition: Added utility methods for Vector equals with epsilon - Fix Animation backing array type - Fix Mesh copying with 0 indices - Fix restoration of pooled particle effects scale - Fix loss of controller listeners on reconnect - Added basic kotlin project generation support in the setup tool - API addition: Allow APK expansion to be used in fragments and activities - API addition: Added color properties support from tiled maps - API Change: Added rotation vector sensor support on Android - API Change: GLProfiler refactored for OOP and lwjgl3 multi windows - LWJGL3: The creation of additional windows via Lwjgl3Application.newWindow() is now deferred, with postRunnable(), until all existing windows have been updated. This fixes a potential native crash with NVidia GL drivers on Windows, presumably caused by a GL context conflict. - API addition: Lwjgl3WindowListener.created() is called after a new window has been created. It's unsafe to call Lwjgl3Window functions in between Lwjgl3Application.newWindow() and this callback. - Updated LWJGL3 backend to 3.1.3. - Lwjgl3Graphics.setUndecorated() and Lwjgl3Graphics.setResizable() now delegate their work to the respective GLFW functions. - API addition: ProgressBar.isVertical() - returns whether a progress bar is vertical or horizontal. - API Change: SplitPane now by default does not allow the split amount to shrink children below their minimum sizes (cropping them). This behavior can be reverted by overriding clampSplitAmount or wrapping the children in Containers set to minSize(0) and fill(). SplitPane also now correctly includes the handle min size in its own min size calculations. - API Change: SplitPane.getSplit() renamed to SplitPane.getSplitAmount() to match other getter and setter names. - Improved internal Timer synchronization. - API Change: List#drawItem, added float width parameter. - API Addition: Make it possible to disable sound on the GWT-Backend with disableSound=true. - API Change: ScrollPane setWidget deprecated in favor of setActor to match other APIs. - API Change: removed JGLFW backend - Fixed mixed up use of TexturePacker.Settings.stripWhitespaceX|Y. - Added joystick POV support to LWJGL3 controller backend. - Added support for 2d particles sprite animation. - API Change: ParticleEmitter getSprite, setSprite, getImagePath, setImagePath are now getSprites, setSprites, getImagePaths, setImagePaths. - Added support for 2d particles independant scale X and Y. - API Change: ParticleEmitter getScale, matchSize are now getScaleX/getScaleY, matchSizeX/matchSizeY. Added scaleSize(float scaleX, float scaleY) - API Change: Added iconDropped() callback to AndroidWallpaperListener. [1.9.6] - Fix performance regression in LWJGL3 backend, use java.nio instead of BufferUtils. Those are intrinsics and quite a bit faster than BufferUtils on HotSpot. - Updated to latest Sound Manager 2 - Added mappings for Xbox 360 controller for Linux - Separated error log for vertex/fragment shaders for easier debugging - Minimum Android API level is now level 9 (Android 2.3) - API addition: Configurable TexturePacker bleed iterations - Updated IOS Multi-OS Engine backend to 1.3.6 - API Change: Pixmap.setBlending, Pixmap.setFilter are now instance methods - VertexAttribute expert constructors exposed. Short types can now be used for attributes. [1.9.5] - Fix NPE swallowing "video driver unsupported" error on LWJGL 2 backend. - Allow window icons to be set in Lwjgl3ApplicationConfiguration or Lwjgl3WindowConfiguration. - Allow window icon and title to be changed in Lwjgl3Window - API Addition: ApplicationLogger interface, allowing easier access to custom logging - DefaultRenderableSorter accounts for center of Renderable mesh, see https://github.com/libgdx/libgdx/pull/4319 - Bullet: added FilterableVehicleRaycaster, see https://github.com/libgdx/libgdx/pull/4361 - Bullet: updated to 2.85, see: http://bulletphysics.org/wordpress/?p=456 - Updated iOS native build scripts to iOS 10.1 and TVOS 10.0 - API Addition: BitmapFont#blankLineScale. - Fixed rounding of Drawables in ProgressBar. Allow rounding to be disabled with setRound(). - Updated LWJGL3 backend to LWJGL 3.1.0, see https://blog.lwjgl.org/lwjgl-3-1-0-released/ - LWJGL3 backend now supports non-continuous rendering, see https://github.com/libgdx/libgdx/pull/3772 - API Change: Lwjgl3WindowListener.refreshRequested() is called when the windowing system (GLFW) reports contents of a window are dirty and need to be redrawn. - API Change: Lwjgl3WindowListener.maximized() is called when a window enters or exits a maximized state. - API Change: Lwjgl3WindowListener.deiconified() removed, combined with .iconified(). - API Change: Lwjgl3Window.deiconify() renamed to .restore() since it can also be used to de-maximize a window. - Lwjgl3Window now has a maximize() method, and windows can be started maximized using the window or app configuration's setMaximized() method. - NinePatch can now be drawn rotated or scaled. - NinepatchDrawable is now a TransformDrawable. - API Change: Group add* methods no longer remove and re-add the actor if it is already in the group, instead they do nothing. - API Change: g2d.Animation is now generic so it can support Drawables, PolygonRegions, NinePatches, etc. To fix existing code, specify the TextureRegion type in animation declarations (and instantiations in Java 6), i.e. Animation<TextureRegion> myAnimation = new Animation<TextureRegion>(...); - TiledDrawable throws unsupported operation if trying to draw rotated/scaled. #4005 - API Change: DragAndDrop now puts default position of drag actor at pointer location. The original default offset from the pointer was (14, -20). - Added ShaderProgramLoader for AssetManager. - BoundingBox#isValid now returns also true when min==max, see: https://github.com/libgdx/libgdx/pull/4460 [1.9.4] - Moved snapping from ProgressBar to Slider to prevent snapping when setting the value programmatically. - Bullet: added btSoftBody#getLinkCount() and btSoftBody#getLink(int), see https://github.com/libgdx/libgdx/issues/4152 - API Change: Wrapping for scene2d's HorizontalGroup and VerticalGroup. - Fix hiero problem with certain unicode characters. See https://github.com/libgdx/libgdx/issues/4202 - Switched to RoboVM fork 2.2.0, fixes incompatibility with Android Gradle plugin and iOS 9.3.4 [1.9.3] - Switched to MobiDevelop's RoboVM fork (http://robovm.mobidevelop.com) - Addition of Intel Multi-OS Engine backend for deploying to iOS - Updated iOS native build scripts to iOS 9.3 and TVOS 9.2 - API Addition: GestureDetector#pinchStop() called when no longer pinching - API Addition: Gdx.graphics.setUndecorated/setResizable API added to Graphics https://github.com/libgdx/libgdx/pull/3847 - API Addition: Gdx.graphics.getGLVersion(), grab the GL version and implementation type. https://github.com/libgdx/libgdx/pull/3788 - API Change: Lwjgl3WindowListener -> filesDropped(String[] files) adds drag'n drop support for the lwjgl3 backend - Added isComplete() to ParticleEffect to make it easier to know when all the emitters are done, behaves the same as in the 2D API. - API Change: renamed Lwjgl3WindowListener.windowIsClosing() to closeRequested() to better communicate its intent. - Add IndexData.updateIndices method to increase performance when used with IndexBufferObjectSubData. - Added FlushablePool - Added ShapeCache see https://github.com/libgdx/libgdx/pull/3953 - API Change: moved shape builder logic out of MeshBuilder, see: https://github.com/libgdx/libgdx/pull/3996 - API Change: changed copy constructor OrderedMap(ObjectMap) to OrderedMap(OrderedMap) - API Change: Table reset now calls clearChildren, not clear. - Fixed crashes in AndroidMusic.java when isPlaying is called. Errors are now logged only rather than crashing the app. - Added emulation of ScreenUtils for GWT - Improved performance of glReadPixels() on GWT. New method is 20-30 times faster - Fixed crash on Mac when using LWJGL2, custom cursors and embedding the game in an AWT window - Fixed getDisplayModes(Monitor monitor) returning wrong data on LWJGL2 backend - Fixed Gdx.input.getCurrentEventTime() not being set on LWJGL3, fixes GestureDetector and flick scroll not working - Fixed not being able to select non-latin characters in TextFields - Bullet: added CustomActionInterface, see https://github.com/libgdx/libgdx/pull/4025 - Add window size limits option to LWJGL3 app and window configurations - Add handling of tag "<objectgroup>" within tags "<tile>" in TmxMap loaders. [1.9.2] - Added TextureArray wrapper see https://github.com/libgdx/libgdx/pull/3807 - Fixed bug in AndroidGL20.cpp which cast a pointer to a 32-bit int. Crash on 64-bit ARM, but only for a specific code path and address... - Fixed multiple controllers registering on same index with LWJGL3, see https://github.com/libgdx/libgdx/issues/3774 - Fixed the FreeTypeFontGenerator texture bleeding, see https://github.com/libgdx/libgdx/issues/3521 [1.9.1] - API Change: Override GwtApplication#createApplicationListener() to create your ApplicationListener on GWT, overriding GwtApplication#getApplicationListener() isn't needed anymore, see https://github.com/libgdx/libgdx/issues/3628 - Fixed ARM64 and x86_64 binaries for Android [1.9.0] - API Change: Lwjgl3ApplicationConfiguration#setBackbufferConfig -> setBackBufferConfig - Fixed HexagonalTiledMapRenderer, see https://github.com/libgdx/libgdx/pull/3654 - Added support for locking the screen orientation in GWT, see https://github.com/libgdx/libgdx/pull/3633 - Added Gdx-Kiwi and gdx-lml to extensions, see https://github.com/libgdx/libgdx/pull/3597 - Added Gyroscope support in Input, implemented for Android, see https://github.com/libgdx/libgdx/pull/3594 - Fixed touch mapping on iOS, see https://github.com/libgdx/libgdx/pull/3590 - Added orientation to Box2D Transform class, see https://github.com/libgdx/libgdx/pull/3308 - Added system cursors to GWT, fix 'Ibeam' system cursor not working on LWJGL3. - Added experimental AndroidApplicationConfiguration#useGL30 and IOSApplicationConfiguration#useGL30 for testing OpenGL ES 3.0 support on mobile devices, do not use in production. - Fix broken kerning for FreeType fonts, see https://github.com/libgdx/libgdx/pull/3756 - Added ARM64 and x86_64 binaries for Android - API Addition: FreeTypeFontParameter has an additional field for tweaking hinting, see https://github.com/libgdx/libgdx/pull/3757 [1.8.0] - API Change: Rewrote FreeType shadow rendering (much better). - Added spaceX/Y to FreeType fonts. - Higher quality FreeType font rendering. - Hiero updated to v5, now with FreeType support and other new features! - GlyphLayout now allocates much, much less memory when processing long text that wraps. - Added LWJGL 3 backend, see https://github.com/libgdx/libgdx/issues/3673 for more info. - Added Graphics#getBackBufferWidth and Graphics#getBackBufferHeight for HDPI handling - API Change: Added HdpiUtils. Instead of calling GL20#glViewport and GL20#glScissor yourself please use HdpiUtils instead. It will ensure that you handle HDPI monitors correctly when using those OpenGL functions. On HDPI monitors, the size reported by Gdx.graphics getWidth/getHeight is in logical coordinates as dictated by the operating system, usually half the HDPI resolution. The OpenGL drawing surface works in backbuffer coordinates at the full HDPI resolution. If you pass logical coordinates to glViewport and glScissor, you only affect a quarter of the real backbuffer size. Use HdpiUtils instead, it will do the right thing, while letting you continue to work in logical (aka returned by Gdx.graphics.getWidth/getHeight) coordinates. - API Change: Graphis#getDesktopDisplayMode() has been renamed to Graphics#getDisplayMode() and returns the current display mode of the monitor the window is shown on (primary monitor on all backends except LWJGL3, which supports real multi-monitor setups). - API Change: Graphics#getDisplayModes() return the display modes of the monitor the monitor the window is shown on (primary monitor on all backends except LWJGL3 which supports real multi-monitor setups). - API Change: Graphics#setDisplayMode(DisplayMode) has been renamed to Graphics#setFullscreenMode(). If the window is in windowed mode, it will be switched to fullscreen mode on the monitor from which the DisplayMode stems from. - API Change: Graphics#setDisplayMode(int, int, boolean) has been renamed to Graphics#setWindowedMode(int, int). This will NOT allow you to switch to fullscreen anymore, use Graphics#setFullscreenMode() instead. If the window is in fullscreen mode, it will be switched to windowed mode on the monitor the window was in fullscreen mode on. - API Addition: Graphics#Monitor, represents a monitor connected to the machine the app is running on. A monitor is defined by a name and it's position relative to other connected monitors. All backends except the LWJGL3 backend will report only the primary monitor - API Addition: Graphics#getPrimaryMonitor() returns the primary monitor you usually want to work with. - API Addition: Graphics#getMonitor() returns the monitor your app's window is shown on, which may not be the primary monitor in >= 2 monitor systems. All backends except the LWJGL3 backend will report only the primary monitor. - API Addition: Graphics#getMonitors() returns all monitors connected to the system. All backends except the LWJGL3 backend will only report the primary monitor. - API Addition: Graphics#getDisplayMode(Monitor) returns the display mode of the monitor the app's window is shown on. All backends except the LWJGL3 backend will report the primary monitor display mode instead of the actual monitor's display mode. Not a problem as all other backends run on systems with only a single monitor so far (primary monitor). - Added option to include credentials on cross-origin http requests (used only for GWT backend). - Added option to specify crossorigin attribute when loading images with AssetDownloader (GWT), see #3216. - API Change: removed Sound#setPriority, this was only implemented for the Android backend. However, Android itself never honored priority settings. - API Change: cursor API has been cleaned up. To create a custom cursor, call Graphics#newCursor(), to set the custom cursor call Graphics#setCursor(), to set a system cursor call Graphics#setSystemCursor(). The Cursor#setSystemCursor method has been removed as that was not the right place. Note that cursors only work on the LWJGL, LWJGL3 and GWT backends. Note that system cursors only fully work on LWJGL3 as the other two backends lack a means to set a specific system cursor. These backends fall back to displaying an arrow cursor when setting any system cursor. - API Addition: Added Lwjgl3WindowListener, allows you to hook into per-window iconficiation, focus and close events. Also allows you to prevent closing the window when a close event arrives. [1.7.2] - Added AndroidAudio#newMusic(FileDescriptor) to allow loading music from a file descriptor, see #2970 - Added GLOnlyTextureData, which is now the default for FrameBuffer and FrameBufferCubemap, see #3539 - Added rotationChanged() for Actor class, called when rotation changes, see https://github.com/libgdx/libgdx/pull/3563 - Fixed crash on MacOS when enumerating connected gamepads. - ParticleEmitter no longer says it's complete when it's set to continuous, see #3516 - Improved JSON parsing and object mapping error messages. - Updated FreeType from version 2.5.5 to 2.6.2. - Fixed corrupt FreeType rendering for some font sizes. - API Change: FreeTypeFontParameter has new fields for rendering borders and shadows. - FreeTypeFontParameter can render much better fonts at small sizes using gamma settings. - BitmapFont can now render missing (tofu) glyph for glyphs not in the font. - FreeTypeFontGenerator depreacted methods removed. - Fixed BitmapFont color tags changing glyph spacing versus not using color tags. BitmapFont#getGlyphs has a new paramter. See #3455. - Skin's TintedDrawable now works with TiledDrawable. #3627 - Updated jnigen to Java Parser 2.3.0 (http://javaparser.github.io/javaparser/). - FreeType fonts no longer look terrible at small size. This is a big deal! - Updated to RoboVM 1.12.0, includes tvOS support! [1.7.1] - Fixes AtlasTmxMapLoader region name loading to tileset name instead of filename - Changes TiledMapPacker output, region names are tileset names, adjusts gid, defaults to one atlas per map - API Change: members of Renderable and MeshPart are changed, see https://github.com/libgdx/libgdx/pull/3483 - Added Vector#setToRandomDirection(), see #3222 - Updated to stb_image v2.08 - Added Node#copy(), used when creating a ModelInstance from a Model to allow using custom nodes - Add ModelCache, see https://github.com/libgdx/libgdx/wiki/ModelCache - Updated bullet to v2.83.6 - Updated to RoboVM 1.9, for free life-time license read http://www.badlogicgames.com/wordpress/?p=3762 [1.7.0] - Gdx.input.setCursorImage removed, replaced with Gdx.graphics.setCursor and Gdx.graphics.newCursor see https://github.com/libgdx/libgdx/pull/2841/ - Fixed an issue with UTF8 decoding in GWT emulation of InputStreamReader - Updated to RoboVM 1.8 for iOS 9 support. [1.6.5] - Objects from animated tiles in TMX maps are now supported. - Made possible to use any actor for tooltips. - Improved cross-platform reflection api for annotations. - NinePatch#scale now also scales middle patch size. - GLFrameBuffer is now abstract, renamed setupTexture to createColorTexture, added disposeColorTexture - Added LwjglApplicationConfiguration#gles30Context*Version, see https://github.com/libgdx/libgdx/pull/2941 - Added OpenGL error checking to GLProfiler, see https://github.com/libgdx/libgdx/pull/2889 - Updated to RoboVM 1.6 [1.6.4] - TextField cursor and selection size changed. https://github.com/libgdx/libgdx/commit/2a830dea348948d2a37bd8f6338af2023fec9b09 - FreeTypeFontGenerator setting to improve shadows and borders. - ScrollPane scrolls smoothly when the scrolled area is much larger than the scrollbars. - TexturePacker sorts page regions by name. - GlyphLayout text wrapping changed to not trim whitespace. https://github.com/libgdx/libgdx/commit/ee42693da067da7c5ddd747f051c1423d262cb96 - Fixed BitmapFont computing space width incorrectly when padding is used and no space glyph is in the font. - Fixed TextArea cursor and selection drawing positions. - Fixed ActorGestureListener pan and zoom when the actor is rotated or scaled. - Fixed TextField for non-pixel display. - Allow ellipsis string to be set on Label. - AssetManager gets hook for handling loading failure. - TextField now fires a ChangeEvent when the text change. Can be cancelled too! - Added tooltips to scene2d.ui. - Updated to RoboVM 1.5 [1.6.3] - Updated to RoboVM 1.4 [1.6.2] - API Change: TiledMapImageLayer now uses floats instead of ints for positioning - API Change: Added GLFrameBuffer and FrameBufferCubemap: Framebuffer now extends GLFramebuffer, see #2933 [1.6.1] - Added optional hostname argument to Net.newServerSocket method to allow specific ip bindings for server applications made with gdx. - Changed the way iOS native libs are handled. Removed updateRoboVMXML and copyNatives task from ios/build.gradle. Instead natives are now packaged in jars, within the META-INF/robovm/ios folder. Additionally, a robovm.xml file is stored there that gets merged with the project's robovm.xml file by RoboVM. [1.6.0] - API Change: GlyphLayout xAdvances now have an additional entry at the beginning. This was required to implement tighter text bounds. #3034 - API Change: Label#getTextBounds changed to getGlyphLayout. This exposes all the runs, not just the width and height. - In the 2D ParticleEditor, all chart points can be dragged at once by holding ctrl. They can be dragged proportionally by holding ctrl-shift. - Added Merge button to the 2D ParticleEditor, for merging a loaded particle effect file with the currently open particle effect. - Added ability to retrieve method annotations to reflection api - Added PixmapPacker.updateTextureRegions() method. - Added ability to pack "anonymous" pixmaps into PixmapPacker, which will appear in the generated texture but not a generated or updated TextureAtlas - Added PixmapPacker.packDirectToTexture() methods. - API Change: PixmapPacker.generateTextureAtlas(...) now returns an atlas which can be updated with subsequent calls to PixmapPacker.updateTextureAtlas(...) - API Change: FreeTypeFontGenerator.generateFont(...) now works with a user-provided PixmapPacker. - Added DirectionalLightsAttribute, PointLightsAttribute and SpotLightsAttribute, removed Environment#directionalLights/pointLights/spotLights, added Environment#remove, lights are now just like any other attribute. See also https://github.com/libgdx/libgdx/wiki/Material-and-environment#lights - API Change: BitmapFont metrics now respect padding. #3074 - Update bullet wrapper to v2.83 - Added AnimatedTiledMapTile.getFrameTiles() method [1.5.6] - API Change: Refactored Window. https://github.com/libgdx/libgdx/commit/7d372b3c67d4fcfe4e82546b0ad6891d14d03242 - Added VertexBufferObjectWithVAO, see https://github.com/libgdx/libgdx/pull/2527 - API Change: Removed Mesh.create(...), use MeshBuilder instead - API Change: BitmapFontData, BitmapFont, and BitmapFontCache have been refactored. http://www.badlogicgames.com/wordpress/?p=3658 - FreeTypeFontGenerator can now render glyphs on the fly. - Attribute now implements Comparable, custom attributes might need to be updated, see: https://github.com/libgdx/libgdx/wiki/Material-and-environment#custom-attributes - API Change: Removed (previously deprecated) GLTexture#createTextureData/createGLHandle, Ray#getEndPoint(float), Color#tmp, Node#parent/children, VertexAttribute#Color(), Usage#Color, ModelBuilder#createFromMesh, BoundingBox#getCenter()/updateCorners()/getCorners(), Matrix4.tmp [1.5.5] - Added iOS ARM-64 bit support for Bullet physics - 3D Animation, NodeAnimation keyframes are separated into translation, rotation and scaling - Added capability to enable color markup from inside skin json file. - Exposed method ControllerManager#clearListeners on Controllers class - Net#openURI now returns a boolean to indicate whether the uri was actually opened. - DefaultShader now always combines material and environment attributes - Added ShapeRenderer constructor to pass a custom shader program to ImmediateModeRenderer20. - API Change: Group#toString now returns actor hierarchy. Group#print is gone. - Added SpotLight class, see https://github.com/libgdx/libgdx/pull/2907 - Added support for resolving file handles using classpaths (ClasspathFileHandleResolver) [1.5.4] - Added support for image layers in Tiled maps (TiledMapImageLayer) - Added support for loading texture objects from TMX Maps (TextureMapObject) - Added support for border and shadow with FreeTypeFontGenerator - see https://github.com/libgdx/libgdx/pull/2774 - Now unknown markup colors are silently ignored and considered as normal text. - Updated freetype from version 2.4.10 to 2.5.5 - Added 3rd party extensions to setup application, see - Updated to RoboVM 1.0.0-beta-04 - Updated to GWT 2.6.1, sadly GWT 2.7.0 isn't production ready yet. [1.5.3] - API Change: TextField#setRightAlign -> TextField#setAlignment - I18NBundle is now compatible with Android 2.2 - Fixed GWT reflection includes for 3D particles - 3D ParticleEffectLoader registered by default - Added HttpRequestBuilder, see https://github.com/libgdx/libgdx/pull/2698 - Added LwjglApplicationConfiguration.useHDPI for Mac OS X with retina displays. Allows you to get "real" pixel coordinates for mouse and display coordinates. - Updated RoboVM to 1.0.0-beta-03 [1.5.2] - Fixed issue #2433 with color markup and alpha animation. - Fixed natives loading for LWJGL on Mac OS X [1.5.1] - Gradle updated to 2.2 - Android Gradle tooling updated to 1.0.0 - API Change: Switched from Timer to AnimationScheduler for driving main loop on GWT. Removed fps field from GwtApplicationConfiguration to instead let the browser choose the most optimal rate. - API Change: Added pause and resume handling on GWT backend. When the browser supports the page visibility api, pause and resume will be called when the tab or window loses and gains visibility. - API Change: Added concept of target actor, separate from the actor the action is added to. This allows an action to be added to one actor but affect another. This is useful to create a sequence of actions that affect many different actors. Previously this would require adding actions to each actor and using delays to get them to play in the correct order. - Added 64-bit support for iOS sim and device - Deprecated Node#children and Node#parent, added inheritTransform flag and methods to add/get/remove children - API Change: By default keyframes are no longer copied from Model to ModelInstance but shared instead, can be changed using the `ModelInstance.defaultShareKeyframes` flag or `shareKeyframes` constructor argument. - JSON minimal format now makes commas optional: newline can be used in place of any comma. - JSON minimal format is now more lenient with unquoted strings: spaces and more are allowed. - API Change: Added support for KTX/ZKTX file format, https://github.com/libgdx/libgdx/pull/2431 - Update stb_image from v1.33 to v1.48, see https://github.com/libgdx/libgdx/pull/2668 - Bullet Wrapper: added Gimpact, see https://github.com/libgdx/libgdx/issues/2619 - API Addition: Added MeshPartBuilder#addMesh(...), can be used to more easily combine meshes/models - Update to LWJGL 2.9.2, fixes fullscreen mode on "retina" displays - Fixes to RoboVM backend which would crash if accelerometer is used. [1.5.0] - API Addition: IOSInput now uses CMCoreMotion for accelerometer and magnetometer - API Addition: Added getter for UITextField on IOS for keyboard customization - API Addition: Added ability to save PixmapPackers to atlas files. See PixmapPackerIO. - API Addition: Added HttpRequestHeader and HttpResponseHeader with constants for HTTP headers. - API Addition: HttpRequest is now poolable. - New PNG encoder that supports compression, more efficient vertical flipping, and minimal allocation when encoding multiple PNGs. - API Change: Label#setEllipse -> Label#setEllipsis. - API Change: BatchTiledMapRenderer *SpriteBatch fields and methods renamed to *Batch - API Change: ScrollPane#scrollToCenter -> ScrollPane#scrollTo; see optional boolean arguments centerHorizontal and centerVertical (scrollToCenter centered vertically only). - API Change: Changed Input#getTextInput to accept both text and hint, removed Input#getPlaceholderTextInput. - Bug Fix: Fixed potential NPE with immersive mode in the Android fragment backend. - iOS backend now supports sound ids, thanks Tomski! [1.4.1] - Update to the Gradle Integration plugin nightly build if you are on Eclipse 4.4.x! - Update Intellij IDEA to 13.1.5+, because Gradle! - Updated to Gradle 2.1 and Android build tools 20, default Android version to 20. You need to install the latest Android build tools via the SDK manager - API Change: deprecation of bounding box methods, see https://github.com/libgdx/libgdx/pull/2408 - Added non-continuous rendering to iOS backend, thanks Dominik! - Setup now uses Gradle 2.1 with default Android API level 20, build tools 20.0.0 - Non-continuous renderering implemented for iOS - Added color markup support for scene2d label and window title. - API Change: removed default constructor of DecalBatch, removed DefaultGroupStrategy - Updated to latests RoboVM release, 1.0.0-alpha-04, please update your RoboVM plugins/installations - Reduced I18NBundle loading times on Android and bypassed unclosed stream on iOS. - Removed the gdx-ai extension from the libGDX repository. Now it lives in its own repository under the libGDX umbrella, see https://github.com/libgdx/gdx-ai - API Addition: Added randomSign and randomTriangular methods to MathUtils. - API Addition: Decal has now a getter for the Color. - API Addition: now I18NBundle can be set so that no exception is thrown when the key can not be found. - API Addition: added annotation support in reflection layer, thanks code-disaster! https://github.com/libgdx/libgdx/pull/2215 - API Addition: shapes like Rect, Circle etc. now implement Shape2D interface so you can put them all into a single collection https://github.com/libgdx/libgdx/pull/2178 - API Addition: bitmap fonts can now be loaded from an atlas via AssetManager/BitmapFontLoader, see https://github.com/libgdx/libgdx/pull/2110 - API Change: updated to RoboVM 1.0.0-SNAPSHOT for now until the next alpha is released. - API Change: Table now uses padding from its background drawable by default. https://github.com/libgdx/libgdx/issues/2322 - Drawables now know their names, making debugging easier. - API Change: Table fill now respects the widget's minimum size. - Texture packer, fixed image size written to atlas file. - API Change: Cell no longer uses primitive wrappers in public API and boxing is minimized. - API Addition: TextureAttribute now supports uv transform (texture regions). - API Change: Added parameters to Elastic Interpolation. - API Change: Removed Actor#setCenterPosition, added setPosition(x,y,align). - API Change: JsonReader, forward slash added to characters an unquoted strings cannot start with. - API Change: Stage#cancelTouchFocus(EventListener,Actor) changed to cancelTouchFocusExcept. - API Change: Json/JsonWriter.setQuoteLongValues() quotes Long, BigDecimal and BigInteger types to prevent truncation in languages like JavaScript and PHP. [1.3.1] - API change: Viewport refactoring. https://github.com/libgdx/libgdx/pull/2220 - Fixed GWT issues [1.3.0] - Added Input.isKeyJustPressed. - API Addition: multiple recipients are now supported by MessageDispatcher, see https://github.com/libgdx/libgdx/wiki/Message-Handling#multiple-recipients - API Change: State#onMessage now takes the message receiver as argument. - API Addition: added StackStateMachine to the gdx-ai extension. - API change: ShapeRenderer: rect methods accept scale, more methods can work under both line and fill types, auto shape type changing. - API change: Built-in ShapeRenderer debugging for Stage, see https://github.com/libgdx/libgdx/pull/2011 - Files#getLocalStoragePath now returns the actual path instead of the empty string synonym on desktop (LWJGL and JGLFW). - Fixed and improved xorshift128+ PRNG implementation. - Added support for Tiled's animated tiles, and varying frame duration tile animations. - Fixed an issue with time granularity in MessageDispatcher. - Updated to Android API level 19 and build tools 19.1.0 which will require the latest Eclipse ADT 23.02, see http://stackoverflow.com/questions/24437564/update-eclipse-with-android-development-tools-23 for how things are broken this time... - Updated to RoboVM 0.0.14 and RoboVM Gradle plugin version 0.0.10 - API Addition: added FreeTypeFontLoader so you can transparently load BitmapFonts generated through gdx-freetype via AssetManager, see https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/FreeTypeFontLoaderTest.java - Preferences put methods now return "this" for chaining - Fixed issue 2048 where MessageDispatcher was dispatching delayed messages immediately. - API Addition: 3d particle system and accompanying editor, contributed by lordjone, see https://github.com/libgdx/libgdx/pull/2005 - API Addition: extended shape classes like Circle, Ellipse etc. with hashcode/equals and other helper methods, see https://github.com/libgdx/libgdx/pull/2018 - minor API change (will not increase minor revision number): fixed a bug in handling of atlasPrefixes, https://github.com/libgdx/libgdx/pull/2023 - Bullet: btManifoldPoint member getters/setters changed from btVector3 to Vector3, also it is no longer pooled, instead static instances are used for callback methods - Added Intersector#intersectRayRay to detect if two 2D rays intersect, see https://github.com/libgdx/libgdx/pull/2132 - Bullet: ClosestRayResultCallback, AllHitsRayResultCallback, LocalConvexResult, ClosestConvexResultCallback and subclasses now use getter/setters taking a Vector3 instead of btVector3, see https://github.com/libgdx/libgdx/pull/2176 - 2d particle system supports pre-multiplied alpha. - Bullet: btIDebugDrawer/DebugDrawer now use pooled Vector3 instances instead of btVector3, see https://github.com/libgdx/libgdx/issues/2174 [1.2.0] - API Addition: Some OpenGL profiling utilities have been added, see https://github.com/libgdx/libgdx/wiki/Profiling - API Addition: A FreeTypeFontGeneratorLoader has been added to the gdx-freetype extension - API change: Animation#frameDuration and #animationDuration are now hidden behind a getter/setter and dynamic - API Addition: Vector#setZero - API Addition: gdx-ai, extension for AI algorithms. Currently supports FSMs, see https://github.com/libgdx/libgdx/wiki/Artificial-Intelligence - API change: TableLayout has been forked and integrated into libgdx more tightly, see http://www.badlogicgames.com/wordpress/?p=3458 - API Addition: added equals/hashCode methods to Rectangle, may break old code (very, very unlikely) - API Addition: scene2D Actors now have a setCenterPosition method, see https://github.com/libgdx/libgdx/pull/2000 [1.1.0] - Updated to RoboVM 0.0.13 and RoboVM Gradle plugin 0.0.9 - Big improvements to setup-ui and build times in Intellij IDEA https://github.com/libgdx/libgdx/pull/1865 - Setup now uses android build tools version: 19.1.0 - BitmapFontCache now supports in-string colored text through a simple markup language, see https://github.com/libgdx/libgdx/wiki/Color-Markup-Language - Added i18n localization/internationalization support, thanks davebaol, see https://github.com/libgdx/libgdx/wiki/Internationalization-and-Localization - Possibility to override density on desktop to simulate mobile devices, see https://github.com/libgdx/libgdx/pull/1825 - Progressive JPEG support through JPGD (https://code.google.com/p/jpeg-compressor/). - Mavenized JGLFW backend - Box2D: Added MotorJoint and ghost vertices on EdgeShape - Updated GWT Box2D to latest version - Updated native Box2D to latest version 2.3.1, no API changes - API change: Matrix4.set(x,y,z, translation) changed, z axis is no more flipped - API addition: Matrix4.avg(Matrix4[],float[]) that lets weighted averaging multiple matrices, Quaternion.slerp(Quaternion[],float[]) that lets weighted slerping multiple Quaternions - fixed the long standing issue of the alpha=1 not actually being fully opaque, thanks kalle! https://github.com/libgdx/libgdx/issues/1815 - down to 25 issues on the tracker, 8 bugs, 17 enhancement requests :) [1.0.1] - updated to RoboVM 0.12 (and so should you!) - fixed GC issues on iOS with regards to touch (thanks Niklas!), see https://github.com/libgdx/libgdx/pull/1758 - updated gwt gradle plugin to 0.4, android build tools to 0.10, gradle version to 1.11 - Tiled maps are now always y-up - Tiled maps now support drawing offsets for tiles - FileHandle#list is now supported in GWT! - FileHandle#list now supports FileFilters - Controllers now reinitialize on the desktop when switching between windowed/fullscreen - added a Texture unpacker that will extract all images from a texture atlas, see https://github.com/libgdx/libgdx/pull/1774 - updates to gdx-setup - CustomCollisionDispatcher in bullet, see https://github.com/libgdx/libgdx/commit/916fc85cecf433c3461b458e00f8afc516ad21e3 [1.0.0] - Box2D is no longer in the core, it has been moved to an extension. See http://www.badlogicgames.com/wordpress/?p=3404 - Merged gdx-openal project into gdx-backend-lwjgl - Now LoadedCallback in AssetLoaderParameters is always called after loading an asset from AssetManager, even if the asset is already loaded - Added Payload as a new parameter to Source.dragStop, see https://github.com/libgdx/libgdx/pull/1666 - You can now load PolygonRegions via AssetLoader, see https://github.com/libgdx/libgdx/pull/1602 - implemented software keyboard support in RoboVM iOS backend - Fixed an issue where key event timestamp is not set by the android backend. - scene2d.ui, added to TextArea the preferred number of rows used to calculate the preferred height. - scene2d.actions, fixed infinite recursion for event listener's handle(event). - Various Quaternion changes. - scene2d.ui, fixed a drawing issue with knobBefore when there's no knob (typical progress bar). - Various MeshBuilder fixes and additions. - Math package: added cumulative distribution. - Fixed Music isPlaying() on iOS when is paused. - Added support for C-style comments to JsonReader (mainly used for json skin files). - Support for resource removal from Skin objects. - Added fling gesture to generate fling in scrollpane. - Vector classes now have mulAdd method for adding pre-multiplied values - Vector implementations no longer use squared value for margin comparisons, see: isZero(float margin), isUnit(float margin). - Vector2 now has isUnit and isZero methods (copied from Vector3) - Removed deprecated methods from Vector classes. - Added new headless backend for server applications - Support 'scaledSize' as a json skin data value for BitmapFont - Added setAlpha(float a) method to Sprite class - Added Input.Keys.toString(int keycode) and Input.Keys.valueOf(String keyname) methods - Added Immersive Mode support to Android backend - Added userObject to Actor in scene2d, allowing for custom data storage - Altered Android's hide status bar behavior - Changed the way wakelocks are implemented. You no longer need any special permissions for the libgdx wakelock - BitmapFontCache setColor changes to match SpriteBatch and friends. http://www.badlogicgames.com/forum/viewtopic.php?f=23&t=12112 - Changed ParticleEffect: the ParticleEffect.save method now takes a Writer instead of a File - TexturePacker2 renamed to TexturePacker, added grid and scaling settings. - Added support for custom prefrences on the desktop backends. - Fixed double resume calls on iOS. - Android Music no longer throws exceptions if MediaPlayer is null. - PolygonSpriteBatch implements Batch. - New scene2d actions: EventAction, CountdownEventAction. - Adds cancelHttpRequest() method to Net interface - Updated GWT/HTML5 Backend to GWT 2.6.0 - Minimal Android version is 2.2, see http://www.badlogicgames.com/wordpress/?p=3297 - Updated to LWJGL 2.9.1 - Can now embed your libgdx app as a fragment, more info on the wiki - scene2d.ui, renamed Actor methods translate, rotate, scale, size to moveBy, rotateBy, scaleBy, sizeBy. May have conflicts with Actions static import, eg you'll need to use "Actions.moveBy" - scene2d.ui, Table background is now drawn usign the table's transform - scene2d.ui, added Container which is similar to a Table with one cell, but more lightweight - Added texture filters and mip map generation to BitMapFontLoader and FreeTypeFontGenerator - scene2d.ui, VerticalGroup and HorizontalGroup got pad, fill and an API similar to Table/Container - Removed OpenGL ES 1.0, 1.1 support; see http://www.badlogicgames.com/wordpress/?p=3311 - Added OpenGL ES 3 support - Updated Android backend, demos, tests to 4.4 - Added Viewport, changed Stage to have a Viewport instead of a Camera (API change, see http://www.badlogicgames.com/wordpress/?p=3322 ). - Changed play mode constants of Animation class to enumeration, see http://www.badlogicgames.com/wordpress/?p=3330 - Updated to RoboVM 0.0.11 and RoboVM Gradle plugin 0.0.6, see http://www.badlogicgames.com/wordpress/?p=3351 - Updated to Swig 3.0 for Bullet, disabled SIMD on Mac OS X as alignements are broken in Bullet, see https://github.com/libgdx/libgdx/pull/1595 - TextureData can only be Custom or Pixmap; compressed image files are considered custom [0.9.9] - added setCursorImage method to Input interface to support custom mouse cursors on the desktop - removed Xamarin backend, see http://www.badlogicgames.com/wordpress/?p=3213 - added Select class for selecting kth ordered statistic from arrays (see Array.selectRanked() method) - refactored Box2D to use badlogic Arrays instead of java.util.ArrayLists - MipMapGenerator methods now don't take disposePixmap argument anymore - added GLTexture, base class for all textures, encapsulates target (2d, cubemap, ...) - added CubeMap, 6 sided texture - changed TextureData#consumeCompressedData, takes target now - added RoboVM backend jar and native libs (libObjectAL, libgdx, in ios/ folder of distribution) - added RoboVM backend to build - changed Bullet wrapper API, see http://www.badlogicgames.com/wordpress/?p=3150 - changed MusicLoader and SoundLoader to be asynchronous loaders - changed behaviour of Net#sendHttpRequest() so HttpResponseListener#handleHttpResponse() callback is executed in worker thread instead of main thread - added Bresenham2, for drawing lines on an integer 2D grid - added GridPoint2 and GridPoint3, representing integer points in a 2D or 3D grid - added attribute location caching for VertexData/Mesh. Hand vertex attribs to a ShaderProgram, get back int[], pass that to Mesh - added Android x86 builds, removed libandroidgl20.so, it's now build as part of gdx-core for Android - changed method signature on Box2D World#getBodies and World#getJoints, pass in an Array to fill - removed glGetShaderSource from GL20, use ShaderProgram#getVertexShaderSource/getFragmentShaderSource instead - added reflection api - added AsynchExecutor, execute tasks asynchronously. Used for GWT mainly. - removed FileHandle#file(), has no business in there. - removed box2deditor - removed custom typedarrays in gwt backend - added classpath files support for gwt backend (limited) - moved AndroidWallpaperListener to Android Backend - added new VertexAttribute Usage flags, bone weight, tangent, binormal. previously encoded as Usage.Generic. Also added field "unit" to VertexAttribute, used by texture coordinates and bone weights to specify index/unit. - setup-ui template for iOS disables pngcrush, also updated wiki iOS article - add Pixmap#fillTriangle via jni gdx2d_fill_triangle() to fill a triangle based on its vertices. - add asynchronous download with continuous progress feedback to GWT asset preloader, see https://github.com/libgdx/libgdx/pull/409?w=1 - add capability to add/exclude package/classes GWT Reflection system, see https://github.com/libgdx/libgdx/pull/409?w=1 - add updated gdx-tiled-preprocessor, generate one single TextureAtlas for all the specified Tiled maps, see http://www.badlogicgames.com/forum/viewtopic.php?f=17&t=8911 - maps API, add new AtlasTiledMapLoader for loading maps produced by the tiled preprocessor tool - ImageProcessor, TexturePacker2 now accepts BufferedImage objects as input - TexturePacker2 now avoids duplicated aliases - Updated to LWJGL 2.9.0 - refactored JSON API, see http://www.badlogicgames.com/wordpress/?p=2993 - Updated Box2D to the latest trunk. Body#applyXXX methods now take an additional boolean parameter. - TmxMapLoader has a flag in Parameters that lets you specify whether to generate mipmaps - Animation#isAnimationFinished was fixed to behave as per javadocs (ignores looping) - remove GLU interface and implementations. Use Matrix4 et al instead. see http://www.badlogicgames.com/wordpress/?p=2886 - new maps API, see http://www.badlogicgames.com/wordpress/?p=2870 - removed static public tmp Vector2 instances, manage such temporary vars yourself, see http://www.badlogicgames.com/wordpress/?p=2840 - changed Scene2D Group#clear(), see http://www.badlogicgames.com/wordpress/?p=2837 - changed the build system, natives are now fetched from the build server, see http://www.badlogicgames.com/wordpress/?p=2821 - freetype extension supported on iOS, see http://www.badlogicgames.com/wordpress/?p=2819 - changed ShapeRenderer API, see http://www.badlogicgames.com/wordpress/?p=2809 - changed Actions.add to addAction, changed parameter order, and added removeAction, addListener, removeListener - Box2d joints now allow for user data - Changes to Intersector, Circle, Rectangle and BoundingBox for consistency in #overlap, #intersect and #contains methods, see https://github.com/libgdx/libgdx/pull/312 - Removed LwjglApplicationConfiguration CPU sync. Added foreground and background target framerate. - scene2d, no longer use getters/setters internally for Actor x, y, width, height, scalex, scaley and rotation. - Array, detect nested iterator usage and throw exception. - Added getVolume to Music class and Android, IOS and GWT backends - 1381, fixed JSON parsing of longs. In addition to Float, it now parses Long if no decimal point is found. - Changed Array constructors that took an array to have offset and count - scene2d, Actor parentToLocalCoordinates and localToParentCoordinates refactoring, see http://www.badlogicgames.com/forum/viewtopic.php?p=40441#p40441 - scene2d, Action#setActor no longer calls reset if the Action has no pool. This allows non-pooled actions to be add and removed from actors, restarted, and reused. - ScrollBar#setForceOverscroll renamed to setForceScroll, as it affects more than just overscroll. - ArrayMap#addAll renamed to putAll to match the other maps. - Added ObjectSet and IntSet. - Added completion listener to Music. - Added Music#setPan. - Sound#play and Sound#loop on Android now return -1 on failure, to match other backends. - DelegateAction subclasses need to implement delegate() instead of act(). http://www.badlogicgames.com/forum/viewtopic.php?p=43576#p43576 - Added pause and resume methods to Sound. - Changed AssetErrorListener#error to have AssetDescriptor to enable access to parameters of failed asset. - Changed SelectBoxStyle to have ScrollPaneStyle and ListStyle for fully customizing the drop down list. http://www.badlogicgames.com/wordpress/?p=3110 - AssetLoader now takes a FileHandle that is the resolved file name. The AssetLoader no longer has to resolve the file name, so we can prevent it from being resolved twice. - Rewrote EarClippingTriangulator to not allocate (no more Vector2s). - Added ParticleEffectLoader to make AssetManager load ParticleEffects - Added GeometryUtils, more Intersector functions, DelaunayTriangulator, ConvexHull. - Added getBoundingBox to ParticleEffect - EarClippingTriangulator changed to return triangle indices. - PolygonSpriteBatch and friends refactored to use triangle indices. - Added add(T, float), remove(int), remove(T) and clear() methods to BinaryHeap - Bitmap Font changes: - FreeTypeFontGenerator allows you to specify the PixmapPacker now, to create an atlas with many different fonts (see FreeTypePackTest) - BitmapFont, BitmapFontCache and FreeTypeFontGenerator now support fonts with multiple texture pages. (see BitmapFontTest and FreeTypePackTest) - BitmapFontData.imagePath and getImagePath() is depreacted, use imagePaths[] and getImagePath(int) instead - Added two BitmapFont constructors for convenience; no need to specify flip boolean - Added getCache() to BitmapFont, for expert users who wish to use the BitmapFontCache (see BitmapFontTest) - FreeTypeFontGenerator now includes setMaxTextureSize and getMaxTextureSize to cap the generated glyph atlas size (default 1024) - added render-hooks beginRender() and endRender() to BatchTiledMapRenderer - Added panStop to GestureListener interface. - ScissorStack#calculateScissors changed to take viewport, enabling it to work with glViewport. - Added Bits#getAndClear, Bits#getAndSet and Bits#containsAll - Added setX and setY to TextureAtlas.AtlasSprite so it matches expected behavior [0.9.8] - see http://www.badlogicgames.com/wordpress/?p=2791 [0.9.7] - see http://www.badlogicgames.com/wordpress/?p=2664 [0.9.6] - see http://www.badlogicgames.com/wordpress/?p=2513
[1.12.1] - LWJGL3 Improvement: Audio device is automatically switched if it was changed in the operating system. - Tiled Fix: TiledLayer parallax default values fix - Android: Removed mouse catching added on 1.12.0 due to unintended effects (see #7187). [1.12.0] - [BREAKING CHANGE] Added #touchCancelled to InputProcessor interface, see #6871. - [BREAKING CHANGE] Android: Immersive mode is now true by default. Set `useImmersiveMode` config to `false` to disable it. - [BREAKING CHANGE] iOS: Increased min supported iOS version to 11.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] iOS: `hideHomeIndicator` set to `false` by default (was `true`). - [BREAKING CHANGE] iOS: `screenEdgesDeferringSystemGestures` set to `UIRectEdge.All` by default (was `UIRectEdge.None`). - [BREAKING CHANGE] iOS: preferred FPS is now uncapped by default, see #6717 - [BREAKING CHANGE] iOS: `ApplicationListener.create` and first `resize` are now called within `UIApplicationDelegate.didFinishLaunching`. Allows for earlier rendering and prevents black screen frames after launch screen. NOTE: App will get terminated if this method is blocked for more than 10-20 sec. - [BREAKING CHANGE] Actor#localToAscendantCoordinates throws an exception if the specified actor is not an ascendant. - [BREAKING CHANGE] WidgetGroup#hit first validates the layout. - [BREAKING CHANGE] Cell getters return object wrapper instead of primitives. - [BREAKING CHANGE] MeshPartBuilder#lastIndex now returns int instead of short. - [BREAKING CHANGE] 3D API - max bone weights is now configurable and limited to 4 by default. Change this value if you need less or more. See #6522. - [BREAKING CHANGE] Mesh#getVerticesBuffer, Mesh#getIndicesBuffer, VertexData#getBuffer, and IndexData#getBuffer are deprecated in favor to new methods with boolean parameter. If you subclassed some of these classes, you need to implement the new methods. - [BREAKING CHANGE] Desktop: The return value of AudioDevice#getLatency() is now in samples, and not milliseconds - [BREAKING CHANGE] iOS: 32 bit (armv7) builds are no longer supported. Builds must be 64 bit (arm64) only. - [BREAKING CHANGE] iOS: Use dynamic frameworks instead of static libs - [BREAKING CHANGE] optimized Mesh#bind and Mesh#unbind have a new parameter for instanced attribute locations. If you use these methods without instancing, you can pass a null value. - [BREAKING CHANGE] Dropped support for older libc versions since libGDX is now built on Ubuntu 20.04 (#7005) - [KNOWN ISSUE] Android drag behaviour. Gdx.input.getDeltaX() and Gdx.input.getDeltaY always return 0 for pointer 0. Fixed on next version. - Update to jnigen 2.4.1 - LWJGL Fix: setPosision() for MP3 files. - iOS: Add new MobiVM MetalANGLE backend - iOS: Update to MobiVM 2.3.19 - Update to LWJGL 3.3.2 - API Addition: Added Audio#switchOutputDevice and Audio#getAvailableOutputDevices to specify output devices. Only works for LWJGL3 - Fix LWJGL3: Audio doesn't die anymore, if a device gets disconnected - API Addition: Added Haptics API with 4 different Input#vibrate() methods with complete Android and iOS implementations. - Fix: Fixed Android and iOS touch cancelled related issues, see #6871. - Javadoc: Add "-use" flag to javadoc generation - Android: gdx-setup now uses AGP 7.2.2 and SDK 32, requiring Android Studio Chipmunk or IntelliJ IDEA 2022.2 and JDK 11. - libGDX is now built using Java 11 due to new Android requirements. The rest of libGDX can still be built with JDK 8 and runtime compatibility of libGDX projects should be unaffected. - Fixed glViewport when using HdpiMode.Logical with the LWJGL3 backend. - Added Stage#actorRemoved to fire exit events just before an actor is removed. - ScrollPane#setScrollingDisabled avoids invalidate() if nothing changed. - Fixed incorrect ScrollPane#scrollTo. - API Addition: Added Texture3D support - Fix: Throw an exception when maximum Attribute count is reached to prevent silent failure. - API Fix: The cursor can now be catched on Android. - LWJGL3 Fix: Stereo audio can now be played on mono output devices. This may also improve downmixing to stereo and upmixing to surround. - API Addition: Added CheckBox#getImageDrawable. - FIX: HexagonalTiledMapRenderer now displays maps with the correct stagger index. - API Addition: Added I18NBundle#keys() method. - TOOLS Features: Save mode can be changed in Flame particle 3D editor. - API Addition: added WebGL 2.0 implementation to Gwt backend : you can enable it by GwtApplicationConfiguration#useGL30 - Added GLES31 and GLES32 support with Lwjgl3 backend implementation - API Addition: JsonReader#stop() to stop parsing. - API Change: TextureAtlas now uses FileHandle#reader so outside code can control the charset - API Fix: Intersector#isPointInTriangle - API Addition: The Skin serializer now supports useIntegerPositions - API Change: The skin serializer now treats scaledSize as a float - API Change: DataInput throws an EOF-Exception - API Fix: RenderBuffer leak in GLFrameBuffer class - API Change: Pixmap#setPixels will now verify it has been given a direct ByteBuffer - API Addition: glTexImage2D and glTexSubImage2D with offset parameter - API Addition: OrientedBoundingBox - API Addition: Tiled parallax factor support - API Fix: LWJGL 3’s borderless fullscreen works with negative monitor coords - API Fix: Update mouse x and y values immediately after calling #setCursorPosition - API Change: Never stall with AssetManager on GWT - API Change: Allow packed depth stencil buffer creation when not using GL30 - API Fix: Fixed DataInput#readString for non-ASCII - API Fix: LwjglGraphics.setupDisplay() is no longer choosing the wrong display mode - API Fix: MathUtils.lerpAngle() fixed for extreme inputs - MathUtils trigonometry improvements - Various Scene2D fixes and improvements [1.11.0] - [BREAKING CHANGE] iOS: Increased min supported iOS version to 9.0. Update your Info.plist file if necessary. - [BREAKING CHANGE] Removed Maven and Ant build systems. libGDX is now solely built with Gradle. See https://libgdx.com/dev/from-source/ for updated build instructions. - [BREAKING CHANGE] Android Moved natives loading out of static init block, see #5795 - [BREAKING CHANGE] Linux: Shared libraries are now built on Ubuntu 18.04 (up from Ubuntu 16.04) - [BREAKING CHANGE] The built-in font files arial-15.fnt and arial-15.png have been replaced with lsans-15.fnt and lsans-15.png; this may change some text layout that uses the built-in font, and code that expects arial-15 assets to be present must change to lsans-15. - [BREAKING CHANGE] Legacy LWJGL3 projects must update the sourceCompatibility to 1.8 or higher. - [BREAKING CHANGE] Android Removed hideStatusBar configuration, see #6683 - [BREAKING CHANGE] Lwjgl3ApplicationConfiguration#useOpenGL3 was replaced by #setOpenGLEmulation - Gradle build now takes -PjavaVersion=7|8|9... to specify the Java version against which to compile libGDX. Default is Java 7 for everything, except the LWJGL3 backend, which is compiled for Java 8. - LWJGL3 extension: Added gdx-lwjgl3-glfw-awt-macos extension. Fixes GLFW in such a way, that the LWJGL3/libGDX must no longer run on the main thread in macOS, which allows AWT to work in parallel, i.e. file dialogs, JFrames, ImageIO, etc. You no longer need to pass `-XstartOnFirstThread` when starting an LWJGL3 app on macOS. See `AwtTestLWJGL` in gdx-tests-lwjgl3. For more information, see https://github.com/libgdx/libgdx/pull/6772 - API Addition: Added LWJGL3 ANGLE support for x86_64 Windows, Linux, and macOS. Emulates OpenGL ES 2.0 through DirectX (Windows), desktop OpenGL (Linux), and Metal (macOS). May become the preferred method of rendering on macOS if Apple removes OpenGL support entirely. May fix some OpenGL driver issues. More information here: https://github.com/libgdx/libgdx/pull/6672 - iOS: Update to MobiVM 2.3.16 - Update to LWJGL 3.3.1 - API Addition: ObjLoader now supports ambientColor, ambientTexture, transparencyTexture, specularTexture and shininessTexture - API Addition: PointSpriteParticleBatch blending is now configurable. - TOOLS Features: Blending mode and sort mode can be changed in Flame particle 3D editor. - API Addition: Polygon methods setVertex, getVertex, getVertexCount, getCentroid. - API Addition: TMX built-in tile property "type" is now supported. - API Addition: Octree structure. - API Addition: Added StringBuilder#toStringAndClear() method. - FirstPersonCameraController keys mapping is now configurable - Fix: GlyphLayout: Several fixes for color markup runs with multi-line or wrapping texts - API change: GlyphLayout#GlyphRun is now one GlyphRun per line. "color" was removed from GlyphRun and is now handled by GlyphLayout. - Gdx Setup Tool: Target Android API 30 and update AGP plugin to 4.1.3 - API Fix: Sound IDs are now properly removed; this prevents changes to music instances with the same ID - API Fix: LWJGL3Net#openURI does now work on macOS & JDK >= 16 - API Fix: Fixed a possible deadlock with AssetManager#dispose() and #clear() - API Change: Enable the AL_DIRECT_CHANNELS_SOFT option for Sounds and AudioDevices as well to fix stereo sound - API Addition: CameraInputController#setInvertedControls(boolean) - API Removal: AnimatedTiledMapTile#frameCount - LWJGL 3 is now the default desktop backend. If you want to port your existing applications, take a look here: https://gist.github.com/crykn/eb37cb4f7a03d006b3a0ecad27292a2d - Brought the official and third-party extensions in gdx-setup up to date. Removed some unmaintained ones and added gdx-websockets & jbump. - API Fix: Escaped characters in XML attributes are now properly un-escaped - Bug Fix: AssetManager backslash conversion removed - fixes use of filenames containing backslashes - gdx-setup now places the assets directory in project root instead of android or core. See advanced settings (UI) or arguments (command line) if you don't want it in root. - API Fix: Resolved issues with LWJGL 3 and borderless fullscreen - API Addition: GeometryUtils,polygons isCCW, ensureClockwise, reverseVertices - API Addition: Added FreeTypeFontGenerator#hasCharGlyph method. - API Fix: Pool discard method now resets object by default. This fixes the known issue about Pool in libGDX 1.10.0. - API Addition: Split GWT reflection cache into two generated classes - API Fix: Fix Box2D memory leak with ropes on GWT - API Fix: Fix NPE in Type#getDeclaredAnnotation - API Addition: Add pause/resume methods to AudioDevice - API Fix: Protection against NullPointerException in World#destroyBody() - API Fix: Prevent repeated mipmap generation in FileTextureArrayData - API Fix: Fix issue with camera reference in CameraGroupStrategy’s default sorter - API Fix: Move vertex array index buffer limit to backends to fix issue with numIndices parameter - API Fix: TexturePacker: Fix wrong Y value when using padding - API Fix: Lwjgl3Net: Add fallback to xdg-open on Linux if Desktop.BROWSE is unavailable - API Addition: Add NWSEResize, NESWResize, AllResize, NotAllowed and None SystemCursors - API Addition: GWTApplication#getJavaHeap and getNativeHeap are now supported - API Addition: Box2D Shape now implements Disposable - API Addition: Added ChainShape#clear method - API Addition: Added Tooltip#setTouchIndependent; see #6758 - API Addition: Emulate Timer#isEmpty on GWT - API Addition: Bits add copy constructor public Bits (Bits bitsToCpy) - API Addition: Added List#drawSelection(). - API Addition: GwtApplicationConfiguration#xrCompatible - API Fix: setSystemCursor() now works on Android - API Fix: getDisplayMode() is now more accurate on Android and GWT. - API Addition: JsonValue#iterator(String) to more easily iterate a child that may not exist. - API Addition: Added ExtendViewport#setScaling, eg for use with Scaling.contain. - API Addition: Added application lifecycle methods to IOSAudio for custom audio implementations. - API Addition: Added getBoundingRectangle() to Polyline - API Addition: ShapeRenderer#check() has now protected visibility - API Addition: Add ability to host GWT module on a different domain than the site, see #6851 - API Addition: Addes Tooltip#setTouchIndependent; see #6758 - API ADDITION: Emulate Timer#isEmpty on GWT - API Addition: OrientedBoundingBox. [1.10.0] - [BREAKING CHANGE] Android armeabi support has been removed. To migrate your projects: remove any dependency with natives-armeabi qualifier from your gradle build file, this apply to gdx-platform, gdx-bullet-platform, gdx-freetype-platform and gdx-box2d-platform. - [BREAKING CHANGE] tvOS libraries have been removed. No migration steps required. - [BREAKING CHANGE] Linux x86 (32-bit) support has been removed. No migration steps required. - [BREAKING CHANGE] Requires Java 7 or above. - [BREAKING CHANGE] API Change: Scaling is now an object instead of an enum. This may change behavior when used with serialization. - [BREAKING CHANGE] Group#clear() and #clearChildren() now unfocus the children. Added clear(boolean) and clearChildren(boolean) for when this isn't wanted. Code that overrides clear()/clearChildren() probably should change to override the (boolean) method. #6423 - [BREAKING CHANGE] Lwjgl3WindowConfiguration#autoIconify is enabled by default. - [KNOWN ISSUE] Pool no longer reset freed objects when pool size is above its retention limit. Pool will discard objects instead. If you want to keep the old behavior, you should override Pool#discard method to reset discarded objects. - Scene2d.ui: Added new ParticleEffectActor to use particle effects on Stage - API addition: iOS: Added HdpiMode option to IOSApplicationConfiguration to allow users to set whether they want to work in logical or raw pixels (default logical). - Fix for #6377 Gdx.net.openURI not working with targetSdk 30 - Api Addition: Added a Pool#discard(T) method. - Architecture support: Linux ARM and AARCH64 support has been added. The gdx-xxx-natives.jar files now contain native libraries of these architectures as well. - API Addition: Desktop Sound now returns number of channels and sample rate. [1.9.14] - [BREAKING CHANGE] iOS: IOSUIViewController has been moved to its own separate class - [BREAKING CHANGE] API Change: G3D AnimationDesc#update now returns -1 (instead of 0) if animation not finished. - [BREAKING CHANGE] InputEventQueue no longer implements InputProcessor, pass InputProcessor to #drain. - [BREAKING CHANGE] HeadlessApplicationConfiguration#renderInterval was changed to #updatesPerSecond - API addition: Added Pixmap#setPixels(ByteBuffer). - API change: ScreenUtils#getFrameBufferPixmap is deprecated in favor to new method Pixmap#createFromFrameBuffer. - API Addition: Added overridable createFiles() methods to backend application classes to allow initializing custom module implementations. - API Addition: Add a Graphics#setForegroundFPS() method. [1.9.13] - [BREAKING CHANGE] Fixed keycode representations for ESCAPE, END, INSERT and F1 to F12. These keys are working on Android now, but if you hardcoded or saved the values you might need to migrate. - [BREAKING CHANGE] TextureAtlas.AtlasRegion and Region splits and pads fields have been removed and moved to name/value pairs, use #findValue("split") and #findValue("pad") instead. - iOS: Update to MobiVM 2.3.12 - GWT: Key codes set with Gdx.input.setCatchKey prevent default browser behaviour - Added Scaling.contain mode: Scales the source to fit the target while keeping the same aspect ratio, but the source is not scaled at all if smaller in both directions. - API Addition: Added hasContents() to Clipboard interface, to reduce clipboard notifications on iOS 14 - TOOLS Features: Blending mode can be changed in Flame particle 3D editor. - Input Keycodes added: CAPS_LOCK, PAUSE (aka Break), PRINT_SCREEN, SCROLL_LOCK, F13 to F24, NUMPAD_DIVIDE, NUMPAD_MULTIPLY, NUMPAD_SUBTRACT, NUMPAD_ADD, NUMPAD_DOT, NUMPAD_COMMA, NUMPAD_ENTER, NUMPAD_EQUALS, NUMPAD_LEFT_PAREN, NUMPAD_RIGHT_PAREN, NUM_LOCK. Following changes might be done depending on platform: Keys.STAR to Keys.NUMPAD_MULTIPLY, Keys.SLASH to Keys.NUMPAD_DIVIDE, Keys.NUM to Keys.NUM_LOCK, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.PERIOD to Keys.NUMPAD_DOT, Keys.COMMA to Keys.NUMPAD_COMMA, Keys.ENTER to Keys.NUMPAD_ENTER, Keys.PLUS to Keys.NUMPAD_ADD, Keys.MINUS to Keys.NUMPAD_SUBTRACT - Added a QuadFloatTree class. - Desktop: Cubemap Seamless feature is now enabled by default when supported, can be changed via backend specific methods, see supportsCubeMapSeamless and enableCubeMapSeamless in both LwjglGraphics and Lwjgl3Graphics. - API Addition: TextureAtlas reads arbitrary name/value pairs for each region. See #6316. - TexturePacker writes using a new format when legacyOutput is false (default is true). TextureAtlas can read both old and new formats. See #6316. [1.9.12] - [BREAKING CHANGE] iOS: Changed how Retina/hdpi handled on iOS. See #3709. - [BREAKING CHANGE] API Change: InputProcessor scrolled method now receives scroll amount for X and Y. Changed type to float to support devices which report fractional scroll amounts. Updated InputEvent in scene2d accordingly: added scrollAmountX, scrollAmountY attributes and corresponding setters and getters. See #6154. - [BREAKING CHANGE] API Change: Vector2 angleRad(Vector2) now correctly returns counter-clockwise angles. See #5428 - [BREAKING CHANGE] Android: getDeltaTime() now returns the raw delta time instead of a smoothed one. See #6228. - Fixed vertices returned by Decal.getVertices() not being updated - Fixes Issue #5048. The function Intersector.overlapConvexPolygons now should return the right minimum translation vector values. - Update to MobiVM 2.3.11 - API Change: Removed Pool constructor with preFill parameter in favor of using Pool#fill() method. See #6117 - API Addition: Slider can now be configured to only trigger on certain mouse button clicks (Slider#setButton(int)). - Fixed GlyphLayout not laying out correctly with color markup. - Fixed TileDrawable not applying its scale correctly. - API Addition: Added epsilon methods to maps with float values. - API Addition: Added an insertRange method to array collections. - Fixed GestureDetector maxFlingDelay. - API Change: Changed default GestureDetector maxFlingDelay to Integer.MAX_VALUE (didn't work before, this matches that). - Gdx.files.external on Android now uses app external storage - see wiki article File handling for more information - Improved text, cursor and selection rendering in TextArea. - API Addition: Added setProgrammaticChangeEvents, updateVisualValue, round methods to ProgressBar/Slider. - iOS: Keyboard events working on RoboVM on iOS 13.5 and up, uses same API as on other platforms - API Addition: Added AndroidLiveWallpaper.notifyColorsChanged() to communicate visually significant colors back to the wallpaper engine. - API Change: AssetManager invokes the loaded callback when an asset is unloaded from the load queue if the asset is already loaded. - GWT: changed audio backend to WebAudio API. Now working on mobiles, pitch implemented. Configuration change: preferFlash removed. When updating existing projects, you can remove the soundmanager js files from your webapp folder and the references to it from index.html - GWT: added possibility to lazy load assets via AssetManager instead of preload them before game start. See GWT specifics wiki article for more information. - GWT: New configuration setting usePhysicalPixels to use native resolution on mobile / Retina / HDPI screens. When using this option, make sure to update your code in index.html and HTMLLauncher from setup template. - GWT: GwtApplicationConfiguration and GWT backend now support an application to be resizable or fixed size. You can remove your own resizing code from your HTMLLaunchers. - GWT: Assets in distribute build are renamed with md5 hash suffix to bypass browser cache on changes - GWT: Fixed GwtFileHandle that was only returning text assets when listing a directory, now returns all children - API Addition: Pixmap.downloadFromUrl() downloads an image from http(s) URLs and passes it back as a Pixmap on all platforms - Added support for Linux ARM builds. - 32-bit: ARMv7/armhf - 64-bit: ARMv8/AArch64 - API Change: Removed arm abi from SharedLibraryLoader - API Addition: Added a Lwjgl3ApplicationConfiguration#foregroundFPS option. - API Change: Utility classes are now final and have a private constructor to prevent instantiation. - API Change: ScrollPane now supports all combinations of scrollBarsOnTop and fadeScrollBars. - API Addition: Added new methods with a "deg" suffix in the method's name for all Vector2 degrees-based methods and deprecated the old ones. - API Addition: Added Slider#setVisualPercent. - API Change: Enabling fullscreen mode on the lwjgl3 backend now automatically sets the vsync setting again. - API Addition: Added put(key, value, defaultValue) for maps with primitive keys, so the old value can be returned. - API Addition: Added ObjectLongMap. - Added Intersector#intersectRayOrientedBoundsFast to detect if a ray intersects an oriented bounding box, see https://github.com/libgdx/libgdx/pull/6139 - API Addition: Added Table#clip() and Container#clip() methods. - API Addition: Added getBackgroundDrawable() to Button. - API Addition: Added imageCheckedDown and getImageDrawable() to ImageButton and ImageTextButton. - API Addition: Added focusedFontColor, checkedFocusedFontColor, and getFontColor() to TextButton and ImageTextButton. - API Addition: Added wrapReverse setting to HorizontalGroup. - API Addition: Added Slider style drawables for over and down: background, knobBefore, and knobAfter. - Fixed LwjglFrame not hiding the canvas in some situations. - API Change: Table#round uses ceil/floor and is applied during layout, rather than afterward. - Fixed blurry NinePatch rendering when using a single center region. - API Change: Upon changing the window size with the lwjgl3 backend, the window is centered on the monitor. - Fixed DepthShaderProvider no longer creates one DepthShader per bones count. Now it creates only one skinned variant and one non-skinned variant based on DepthShader/Config numBones. - API Addition: Added Intersector#intersectPlanes to calculate the point intersected by three planes, see https://github.com/libgdx/libgdx/pull/6217 - API Addition: Added alternative Android Audio implementation for performant sound. See https://github.com/libgdx/libgdx/pull/6243. - API Addition: Expose SpriteBatch and PolygonSpriteBatch setupMatrices() as protected. - API Addition: New parameter OnscreenKeyboardType for Input.setOnscreenKeyboardVisible and Input.getTextInput [1.9.11] - Update to MobiVM 2.3.8 - Update to LWJGL 3.2.3 - Fixed AndroidInput crashes due to missing array resize (pressure array). - API Change: Ray#set methods and Ray#mul(Matrix4) normalize direction vector. Use public field to set and avoid nor() - API Change: New internal implementation of all Map and Set classes (except ArrayMap) to avoid OutOfMemoryErrors when too many keys collide. This also helps resistance against malicious users who can choose problematic names. - API Addition: OrderedMap#alter(Object,Object) and OrderedMap#alterIndex(int,Object) allow swapping out a key in-place without changing its value; OrderedSet also has this. - API Addition: Json can now read/write: ObjectIntMap, ObjectFloatMap, IntMap, LongMap. - API Addition: Added @Null annotation for IDE null analysis. All parameters and return values should be considered non-null unless annotated (or javadoc'ed if not yet annotated). - API Addition: Added ParticleEmitter#preAllocateParticles() and ParticleEffect#preAllocateParticles() to avoid particle allocations during updates. - Fixed changing looping state of already playing sounds on Android by first pausing the sound before setting the looping state (see #5822). - API Change: scene2d: Table#getRow now returns -1 when over the table but not over a row (used to return the last row). - API Change: scene2d: Tree#addToTree and #removeFromTree now have an "int actorIndex" parameter. - API Addition: scene2d: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: scene2d: In TextField, only revert the text if the change event was cancelled. This allows the text to be manipulated in the change listener. - API Change: scene2d: Tree.Node#removeAll renamed to clearChildren. - API Addition: scene2d: Added SelectBox#setSelectedPrefWidth to make the pref width based on the selected item and SelectBoxStyle#overFontColor. - API Change: DefaultTextureBinder WEIGHTED strategy replaced by LRU strategy. - API Change: ShaderProgram begin and end methods are deprecated in favor to bind method. - API Addition: Added a OpenALAudio#getSourceId(long) method. - API Addition: Added a ShaderProgram#getHandle() method. - API Change: Replaced deprecated android support libraries with androidx. AndroidFragmentApplication is only affected. - API Addition: Created interfaces AndroidAudio and AndroidInput and added AndroidApplication#createAudio and AndroidApplication#createInput to allow initializing custom module implementations. - Allows up to 64k (65536) vertices in a Mesh instead of 32k before. Indices can use unsigned short range, so index above 32767 should be converted to int using bitwise mask, eg. int unsigneShortIndex = (shortIndex & 0xFFFF). - API Change: DragAndDrop only removes actors that were not already in the stage. This is to better support using a source actor as the drag actor, see #5675 and #5403. - API Change: Changed TiledMapTileLayer#tileWidth & #tileHeight from float to int - API Addition: convenient Matrix4 rotate methods: rotateTowardDirection and rotateTowardTarget - API Addition: Convenience method Actions#targeting(Actor, Action) to set an action's target. - API Change: Correction of TextField#ENTER_ANDROID renamed to NEWLINE and TextField#ENTER_DESKTOP renamed to CARRIAGE_RETURN. - API Change: Changed the visibility of TextField#BULLET, TextField#DELETE, TextField#TAB and TextField#BACKSPACE to protected. - API Addition: TextField and TextArea are providing the protected method TextField#checkFocusTraverse(char) to handle the focus traversal. - API Addition: UIUtils provides the constants UIUtils#isAndroid and UIUtils#isIos now. - Fixed: The behaving of TextFields and TextAreas new line and focus traversal works like intended on all platforms now. - API Change: Changed Base64Coder#encodeString() to use UTF-8 instead of the platform default encoding. See #6061 - Fixed: SphereShapeBuilder poles are now merged which removes lighting artifacts, see #6068 for more information. - API Change: Matrix3#setToRotation(Vector3, float float) now rotates counter-clockwise about the axis provided. This also changes Matrix3:setToRotation(Vector3, float) and the 3d particles will rotate counter-clockwise as well. - API Change: TexturePacker uses a dash when naming atlas page image files if the name ends with a digit or a digit + 'x'. - API Addition: Added Skin#setScale to control the size of drawables from the skin. This enables scaling a UI and using different sized images to match, without affecting layout. - API Change: Moved adding touch focus from Actor#notify to InputListener#handle (see #6082). Code that overrides InputListener#handle or otherwise handles InputEvent.Type.touchDown events must now call Stage#addTouchFocus to get touchDragged and touchUp events. - API Addition: Added AsynchronousAssetLoader#unloadAsync to fix memory leaks when an asset is unloaded during loading. - Fixed Label text wrapping when it shouldn't (#6098). - Fixed ShapeRenderer not being able to render alpha 0xff (was max 0xfe). - API Change: glGetActiveUniform and glGetActiveAttrib parameter changed from Buffer to IntBuffer. [1.9.10] - API Addition: Allow target display for maximization LWJGL3 backend - API Addition: Accelerometer support on GWT - API Change: Set default behaviour of iOS audio to allow use of iPod - API Change: IOSDevice is no longer an enum to allow users to add their own new devices when LibGDX is not up to date - API Addition: Add statusBarVisible configuration to IOSApplicationConfiguration - Update GWT Backend to GWT 2.8.2 - Update Android backend to build against API 28 (Android 9.0) - API Addition: Input.isButtonJustPressed - Update to LWJGL 2 backend to 2.9.3 - Update to MobiVM 2.3.6 release - Update to LWJGL 3.2.1 - API Addition: Input allows getting the maximum number of pointers supported by the backend - API Addition: Configuration option added to allow setting a max number of threads to use for net requests - API Change: NetJavaImpl now uses a cached thread pool to allow concurrent requests (by default, the thread pool is unbounded - use maxNetThreads in backend configurations to set a limit - set to 1 for previous behavior) - API Addition: New MathUtils norm and map methods - API Change: Pixmap blending was incorrect. Generated fonts may change for the better, but may require adjusting font settings. - API Change: Particle effects obtained from a ParticleEffectPool are now automatically started - Removed OSX 32-bit support - API Change: By default LWJGL2 backend no longer does pause/resume when becoming background/foreground window. New app config setting was added to enable the old behavior. - API Change: By default LWJGL2 backend now does pause/resume when window is minimized/restored. New app config setting was added to disable this behavior. - LWJGL3: Fixed window creation ignoring refresh rate of fullscreen mode. - TmxMapLoader and AtlasTmxMapLoader refactoring: Shared functionality was moved to BaseTmxMapLoader, duplicate code was removed. - AtlasTmxMapLoader supports group layers now (a positive side effect of the BaseTmxMapLoader refactoring). - API Change: TmxMapLoader and AtlasTmxMapLoader: load/loadAsync methods work exactly as before, but many methods of these classes had to change. This makes it possible implement new Tiled features. - API Addition: TextField#drawMessageText. - Fixed TextField rendering text outside the widget at small sizes. - API Addition: Group#getChild(int) - API Addition: notEmpty() for collections. - API Change: scene2d.ui Tree methods renamed for node set/getObject to set/getValue. - API Change: scene2d.ui Tree and Tree.Node require generics for the type of node, values, and actors. - API Change: For Selection in scene2d.utils "toggle" is now respected when !required and selected.size == 1. - API Addition: new InstanceBufferObject and InstanceBufferObjectSubData classes to enable instanced rendering. - API Addition: Support for InstancedRendering via Mesh - API Change: Cell#setLayout renamed to setTable. - API Addition: Added Collections#allocateIterators. When true, iterators are allocated. When false (default), iterators cannot be used nested. - API Addition: Added Group#removeActorAt(int,boolean) to avoid looking up the actor index. Subclasses intending to take action when an actor is removed may need to override this new method. - API Change: If Group#addActorAfter is called with an afterActor not in the group, the actor is added as the last child (not the first). [1.9.9] - API Addition: Add support for stripping whitespace in PixmapPacker - API Addition: Add support for 9 patch packing in PixmapPacker - API Addition: Pressure support for ios/android. https://github.com/libgdx/libgdx/pull/5270 - Update to Lwjgl 3.2.0 - Update android level we build against to 7.1 (API 25) - API Change: gdx-tools no longer bundles dependencies to be compatible with java 9 - Skin JSON files can now use the simple names of classes, i.e. "BitmapFont" rather than "com.badlogic.gdx.graphics.g2d.BitmapFont". Custom classes can be added by overriding Skin.getJsonLoader() and calling json.setClassTag(). - Skin supports cascading styles in JSON. Use the "parent" property to tag another style by name to use its values as defaults. See https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests-android/assets/data/uiskin.json for example. - SkinLoader can be used on subclasses of Skin by overriding generateSkin(). - API addition: Tree indentation can be customized. - Fixed GlyphLayout not respecting BitmapFontData#down. - API Addition: Added faceIndex paramter to #FreeTypeFontGenerator(FileHandle, int). - API Change: BitmapFont#getSpaceWidth changed to BitmapFont#getSpaceXadvance. - Many GlyphLayout fixes. - API Addition: Added FileHandle#map(), can be used to memory map a file - API Change: BitmapFontData#getGlyphs changed for better glyph layout. See https://github.com/libgdx/libgdx/commit/9a7dfdff3c6374a5ebd2f33a819982aceb287dfa - API Change: Actor#hit is now responsible for returning null if invisible. #5264 - API Addition: Added [Collection]#isEmpty() method to all 22 custom LibGDX-collections (e.g. Array, ObjectMap, ObjectSet, Queue, ...) - API Addition: StringBuilder#clear() - API Addition: Color#WHITE_FLOAT_BITS - Table layout fixed when expand is used and the layout width is less than the table's min width. - InputMultiplexer#setProcessors(Array) now copies the items instead of using the specified array instance. - API Change: A wrapped HorizontalGroup or VerticalGroup will now size children down to their min size if the group is smaller than their pref size. - LWJGL3: useVSync() is now a per-window setting. Any additional windows should disable vsync to avoid frames dropping to (refresh rate / # of windows). - Batch and sprite implementations and SpriteCache store Color separately from the float packed color, since converting to/from float is lossy. - API Change: NumberUtils floatToIntColor expands the alpha from 0-254 to 0-255, so 255 doesn't become 254 from conversion from int to float to int. - API Change: Batch and Decal setColor(float) renamed to setPackedColor for differentiation, since the conversion from float to Color is lossy. - API Change: PolygonSprite getVertexColor renamed to getPackedColor to match other classes. - API Change: FreeTypeFontGenerator only generates a missing glyph if \0 is in the characters. - API Change: DragScrollListener no longer requires the touch/mouse cursor to be directly above/below the scroll pane. - API Change: List#toString(Object) changed from protected to public. Subclasses overriding this need to change to public. - API Change: List now handles more key presses. - API Change: TexturePacker ImageProcessor#addImage(File, String) now returns the Rect. [1.9.8] - Add iPhoneX images - Fix MacOS issue with GL_ARB_texture_float extension check - Fix AtlasTmxMapLoader tileset tile id offset - Bullet: updated to 2.87, see: http://bulletphysics.org/wordpress/?p=485 - API Addition: Possibility to specify TexturePacker settings for resampling when scaling. - API Addition: Support for customizing render buffer attachments in GLFrameBuffers - API Change: Revert to constructors for GLFrameBuffers for easier customization [1.9.7] - Update to MobiVM(RoboVM) 2.3.3 - Add iOS 11 support - Update to Lwjgl 3.1.3 - Update to MOE 1.4.0 - API Change: GLFrameBuffer has been refactored https://github.com/libgdx/libgdx/pull/4882. Create standard FrameBuffers with static methods. Customized FBOS with FrameBufferBuilder - API addition: Tiled group layer support - Fix Tiled properties, offset parsing for image layers - API addition: Added utility methods for Vector equals with epsilon - Fix Animation backing array type - Fix Mesh copying with 0 indices - Fix restoration of pooled particle effects scale - Fix loss of controller listeners on reconnect - Added basic kotlin project generation support in the setup tool - API addition: Allow APK expansion to be used in fragments and activities - API addition: Added color properties support from tiled maps - API Change: Added rotation vector sensor support on Android - API Change: GLProfiler refactored for OOP and lwjgl3 multi windows - LWJGL3: The creation of additional windows via Lwjgl3Application.newWindow() is now deferred, with postRunnable(), until all existing windows have been updated. This fixes a potential native crash with NVidia GL drivers on Windows, presumably caused by a GL context conflict. - API addition: Lwjgl3WindowListener.created() is called after a new window has been created. It's unsafe to call Lwjgl3Window functions in between Lwjgl3Application.newWindow() and this callback. - Updated LWJGL3 backend to 3.1.3. - Lwjgl3Graphics.setUndecorated() and Lwjgl3Graphics.setResizable() now delegate their work to the respective GLFW functions. - API addition: ProgressBar.isVertical() - returns whether a progress bar is vertical or horizontal. - API Change: SplitPane now by default does not allow the split amount to shrink children below their minimum sizes (cropping them). This behavior can be reverted by overriding clampSplitAmount or wrapping the children in Containers set to minSize(0) and fill(). SplitPane also now correctly includes the handle min size in its own min size calculations. - API Change: SplitPane.getSplit() renamed to SplitPane.getSplitAmount() to match other getter and setter names. - Improved internal Timer synchronization. - API Change: List#drawItem, added float width parameter. - API Addition: Make it possible to disable sound on the GWT-Backend with disableSound=true. - API Change: ScrollPane setWidget deprecated in favor of setActor to match other APIs. - API Change: removed JGLFW backend - Fixed mixed up use of TexturePacker.Settings.stripWhitespaceX|Y. - Added joystick POV support to LWJGL3 controller backend. - Added support for 2d particles sprite animation. - API Change: ParticleEmitter getSprite, setSprite, getImagePath, setImagePath are now getSprites, setSprites, getImagePaths, setImagePaths. - Added support for 2d particles independant scale X and Y. - API Change: ParticleEmitter getScale, matchSize are now getScaleX/getScaleY, matchSizeX/matchSizeY. Added scaleSize(float scaleX, float scaleY) - API Change: Added iconDropped() callback to AndroidWallpaperListener. [1.9.6] - Fix performance regression in LWJGL3 backend, use java.nio instead of BufferUtils. Those are intrinsics and quite a bit faster than BufferUtils on HotSpot. - Updated to latest Sound Manager 2 - Added mappings for Xbox 360 controller for Linux - Separated error log for vertex/fragment shaders for easier debugging - Minimum Android API level is now level 9 (Android 2.3) - API addition: Configurable TexturePacker bleed iterations - Updated IOS Multi-OS Engine backend to 1.3.6 - API Change: Pixmap.setBlending, Pixmap.setFilter are now instance methods - VertexAttribute expert constructors exposed. Short types can now be used for attributes. [1.9.5] - Fix NPE swallowing "video driver unsupported" error on LWJGL 2 backend. - Allow window icons to be set in Lwjgl3ApplicationConfiguration or Lwjgl3WindowConfiguration. - Allow window icon and title to be changed in Lwjgl3Window - API Addition: ApplicationLogger interface, allowing easier access to custom logging - DefaultRenderableSorter accounts for center of Renderable mesh, see https://github.com/libgdx/libgdx/pull/4319 - Bullet: added FilterableVehicleRaycaster, see https://github.com/libgdx/libgdx/pull/4361 - Bullet: updated to 2.85, see: http://bulletphysics.org/wordpress/?p=456 - Updated iOS native build scripts to iOS 10.1 and TVOS 10.0 - API Addition: BitmapFont#blankLineScale. - Fixed rounding of Drawables in ProgressBar. Allow rounding to be disabled with setRound(). - Updated LWJGL3 backend to LWJGL 3.1.0, see https://blog.lwjgl.org/lwjgl-3-1-0-released/ - LWJGL3 backend now supports non-continuous rendering, see https://github.com/libgdx/libgdx/pull/3772 - API Change: Lwjgl3WindowListener.refreshRequested() is called when the windowing system (GLFW) reports contents of a window are dirty and need to be redrawn. - API Change: Lwjgl3WindowListener.maximized() is called when a window enters or exits a maximized state. - API Change: Lwjgl3WindowListener.deiconified() removed, combined with .iconified(). - API Change: Lwjgl3Window.deiconify() renamed to .restore() since it can also be used to de-maximize a window. - Lwjgl3Window now has a maximize() method, and windows can be started maximized using the window or app configuration's setMaximized() method. - NinePatch can now be drawn rotated or scaled. - NinepatchDrawable is now a TransformDrawable. - API Change: Group add* methods no longer remove and re-add the actor if it is already in the group, instead they do nothing. - API Change: g2d.Animation is now generic so it can support Drawables, PolygonRegions, NinePatches, etc. To fix existing code, specify the TextureRegion type in animation declarations (and instantiations in Java 6), i.e. Animation<TextureRegion> myAnimation = new Animation<TextureRegion>(...); - TiledDrawable throws unsupported operation if trying to draw rotated/scaled. #4005 - API Change: DragAndDrop now puts default position of drag actor at pointer location. The original default offset from the pointer was (14, -20). - Added ShaderProgramLoader for AssetManager. - BoundingBox#isValid now returns also true when min==max, see: https://github.com/libgdx/libgdx/pull/4460 [1.9.4] - Moved snapping from ProgressBar to Slider to prevent snapping when setting the value programmatically. - Bullet: added btSoftBody#getLinkCount() and btSoftBody#getLink(int), see https://github.com/libgdx/libgdx/issues/4152 - API Change: Wrapping for scene2d's HorizontalGroup and VerticalGroup. - Fix hiero problem with certain unicode characters. See https://github.com/libgdx/libgdx/issues/4202 - Switched to RoboVM fork 2.2.0, fixes incompatibility with Android Gradle plugin and iOS 9.3.4 [1.9.3] - Switched to MobiDevelop's RoboVM fork (http://robovm.mobidevelop.com) - Addition of Intel Multi-OS Engine backend for deploying to iOS - Updated iOS native build scripts to iOS 9.3 and TVOS 9.2 - API Addition: GestureDetector#pinchStop() called when no longer pinching - API Addition: Gdx.graphics.setUndecorated/setResizable API added to Graphics https://github.com/libgdx/libgdx/pull/3847 - API Addition: Gdx.graphics.getGLVersion(), grab the GL version and implementation type. https://github.com/libgdx/libgdx/pull/3788 - API Change: Lwjgl3WindowListener -> filesDropped(String[] files) adds drag'n drop support for the lwjgl3 backend - Added isComplete() to ParticleEffect to make it easier to know when all the emitters are done, behaves the same as in the 2D API. - API Change: renamed Lwjgl3WindowListener.windowIsClosing() to closeRequested() to better communicate its intent. - Add IndexData.updateIndices method to increase performance when used with IndexBufferObjectSubData. - Added FlushablePool - Added ShapeCache see https://github.com/libgdx/libgdx/pull/3953 - API Change: moved shape builder logic out of MeshBuilder, see: https://github.com/libgdx/libgdx/pull/3996 - API Change: changed copy constructor OrderedMap(ObjectMap) to OrderedMap(OrderedMap) - API Change: Table reset now calls clearChildren, not clear. - Fixed crashes in AndroidMusic.java when isPlaying is called. Errors are now logged only rather than crashing the app. - Added emulation of ScreenUtils for GWT - Improved performance of glReadPixels() on GWT. New method is 20-30 times faster - Fixed crash on Mac when using LWJGL2, custom cursors and embedding the game in an AWT window - Fixed getDisplayModes(Monitor monitor) returning wrong data on LWJGL2 backend - Fixed Gdx.input.getCurrentEventTime() not being set on LWJGL3, fixes GestureDetector and flick scroll not working - Fixed not being able to select non-latin characters in TextFields - Bullet: added CustomActionInterface, see https://github.com/libgdx/libgdx/pull/4025 - Add window size limits option to LWJGL3 app and window configurations - Add handling of tag "<objectgroup>" within tags "<tile>" in TmxMap loaders. [1.9.2] - Added TextureArray wrapper see https://github.com/libgdx/libgdx/pull/3807 - Fixed bug in AndroidGL20.cpp which cast a pointer to a 32-bit int. Crash on 64-bit ARM, but only for a specific code path and address... - Fixed multiple controllers registering on same index with LWJGL3, see https://github.com/libgdx/libgdx/issues/3774 - Fixed the FreeTypeFontGenerator texture bleeding, see https://github.com/libgdx/libgdx/issues/3521 [1.9.1] - API Change: Override GwtApplication#createApplicationListener() to create your ApplicationListener on GWT, overriding GwtApplication#getApplicationListener() isn't needed anymore, see https://github.com/libgdx/libgdx/issues/3628 - Fixed ARM64 and x86_64 binaries for Android [1.9.0] - API Change: Lwjgl3ApplicationConfiguration#setBackbufferConfig -> setBackBufferConfig - Fixed HexagonalTiledMapRenderer, see https://github.com/libgdx/libgdx/pull/3654 - Added support for locking the screen orientation in GWT, see https://github.com/libgdx/libgdx/pull/3633 - Added Gdx-Kiwi and gdx-lml to extensions, see https://github.com/libgdx/libgdx/pull/3597 - Added Gyroscope support in Input, implemented for Android, see https://github.com/libgdx/libgdx/pull/3594 - Fixed touch mapping on iOS, see https://github.com/libgdx/libgdx/pull/3590 - Added orientation to Box2D Transform class, see https://github.com/libgdx/libgdx/pull/3308 - Added system cursors to GWT, fix 'Ibeam' system cursor not working on LWJGL3. - Added experimental AndroidApplicationConfiguration#useGL30 and IOSApplicationConfiguration#useGL30 for testing OpenGL ES 3.0 support on mobile devices, do not use in production. - Fix broken kerning for FreeType fonts, see https://github.com/libgdx/libgdx/pull/3756 - Added ARM64 and x86_64 binaries for Android - API Addition: FreeTypeFontParameter has an additional field for tweaking hinting, see https://github.com/libgdx/libgdx/pull/3757 [1.8.0] - API Change: Rewrote FreeType shadow rendering (much better). - Added spaceX/Y to FreeType fonts. - Higher quality FreeType font rendering. - Hiero updated to v5, now with FreeType support and other new features! - GlyphLayout now allocates much, much less memory when processing long text that wraps. - Added LWJGL 3 backend, see https://github.com/libgdx/libgdx/issues/3673 for more info. - Added Graphics#getBackBufferWidth and Graphics#getBackBufferHeight for HDPI handling - API Change: Added HdpiUtils. Instead of calling GL20#glViewport and GL20#glScissor yourself please use HdpiUtils instead. It will ensure that you handle HDPI monitors correctly when using those OpenGL functions. On HDPI monitors, the size reported by Gdx.graphics getWidth/getHeight is in logical coordinates as dictated by the operating system, usually half the HDPI resolution. The OpenGL drawing surface works in backbuffer coordinates at the full HDPI resolution. If you pass logical coordinates to glViewport and glScissor, you only affect a quarter of the real backbuffer size. Use HdpiUtils instead, it will do the right thing, while letting you continue to work in logical (aka returned by Gdx.graphics.getWidth/getHeight) coordinates. - API Change: Graphis#getDesktopDisplayMode() has been renamed to Graphics#getDisplayMode() and returns the current display mode of the monitor the window is shown on (primary monitor on all backends except LWJGL3, which supports real multi-monitor setups). - API Change: Graphics#getDisplayModes() return the display modes of the monitor the monitor the window is shown on (primary monitor on all backends except LWJGL3 which supports real multi-monitor setups). - API Change: Graphics#setDisplayMode(DisplayMode) has been renamed to Graphics#setFullscreenMode(). If the window is in windowed mode, it will be switched to fullscreen mode on the monitor from which the DisplayMode stems from. - API Change: Graphics#setDisplayMode(int, int, boolean) has been renamed to Graphics#setWindowedMode(int, int). This will NOT allow you to switch to fullscreen anymore, use Graphics#setFullscreenMode() instead. If the window is in fullscreen mode, it will be switched to windowed mode on the monitor the window was in fullscreen mode on. - API Addition: Graphics#Monitor, represents a monitor connected to the machine the app is running on. A monitor is defined by a name and it's position relative to other connected monitors. All backends except the LWJGL3 backend will report only the primary monitor - API Addition: Graphics#getPrimaryMonitor() returns the primary monitor you usually want to work with. - API Addition: Graphics#getMonitor() returns the monitor your app's window is shown on, which may not be the primary monitor in >= 2 monitor systems. All backends except the LWJGL3 backend will report only the primary monitor. - API Addition: Graphics#getMonitors() returns all monitors connected to the system. All backends except the LWJGL3 backend will only report the primary monitor. - API Addition: Graphics#getDisplayMode(Monitor) returns the display mode of the monitor the app's window is shown on. All backends except the LWJGL3 backend will report the primary monitor display mode instead of the actual monitor's display mode. Not a problem as all other backends run on systems with only a single monitor so far (primary monitor). - Added option to include credentials on cross-origin http requests (used only for GWT backend). - Added option to specify crossorigin attribute when loading images with AssetDownloader (GWT), see #3216. - API Change: removed Sound#setPriority, this was only implemented for the Android backend. However, Android itself never honored priority settings. - API Change: cursor API has been cleaned up. To create a custom cursor, call Graphics#newCursor(), to set the custom cursor call Graphics#setCursor(), to set a system cursor call Graphics#setSystemCursor(). The Cursor#setSystemCursor method has been removed as that was not the right place. Note that cursors only work on the LWJGL, LWJGL3 and GWT backends. Note that system cursors only fully work on LWJGL3 as the other two backends lack a means to set a specific system cursor. These backends fall back to displaying an arrow cursor when setting any system cursor. - API Addition: Added Lwjgl3WindowListener, allows you to hook into per-window iconficiation, focus and close events. Also allows you to prevent closing the window when a close event arrives. [1.7.2] - Added AndroidAudio#newMusic(FileDescriptor) to allow loading music from a file descriptor, see #2970 - Added GLOnlyTextureData, which is now the default for FrameBuffer and FrameBufferCubemap, see #3539 - Added rotationChanged() for Actor class, called when rotation changes, see https://github.com/libgdx/libgdx/pull/3563 - Fixed crash on MacOS when enumerating connected gamepads. - ParticleEmitter no longer says it's complete when it's set to continuous, see #3516 - Improved JSON parsing and object mapping error messages. - Updated FreeType from version 2.5.5 to 2.6.2. - Fixed corrupt FreeType rendering for some font sizes. - API Change: FreeTypeFontParameter has new fields for rendering borders and shadows. - FreeTypeFontParameter can render much better fonts at small sizes using gamma settings. - BitmapFont can now render missing (tofu) glyph for glyphs not in the font. - FreeTypeFontGenerator depreacted methods removed. - Fixed BitmapFont color tags changing glyph spacing versus not using color tags. BitmapFont#getGlyphs has a new paramter. See #3455. - Skin's TintedDrawable now works with TiledDrawable. #3627 - Updated jnigen to Java Parser 2.3.0 (http://javaparser.github.io/javaparser/). - FreeType fonts no longer look terrible at small size. This is a big deal! - Updated to RoboVM 1.12.0, includes tvOS support! [1.7.1] - Fixes AtlasTmxMapLoader region name loading to tileset name instead of filename - Changes TiledMapPacker output, region names are tileset names, adjusts gid, defaults to one atlas per map - API Change: members of Renderable and MeshPart are changed, see https://github.com/libgdx/libgdx/pull/3483 - Added Vector#setToRandomDirection(), see #3222 - Updated to stb_image v2.08 - Added Node#copy(), used when creating a ModelInstance from a Model to allow using custom nodes - Add ModelCache, see https://github.com/libgdx/libgdx/wiki/ModelCache - Updated bullet to v2.83.6 - Updated to RoboVM 1.9, for free life-time license read http://www.badlogicgames.com/wordpress/?p=3762 [1.7.0] - Gdx.input.setCursorImage removed, replaced with Gdx.graphics.setCursor and Gdx.graphics.newCursor see https://github.com/libgdx/libgdx/pull/2841/ - Fixed an issue with UTF8 decoding in GWT emulation of InputStreamReader - Updated to RoboVM 1.8 for iOS 9 support. [1.6.5] - Objects from animated tiles in TMX maps are now supported. - Made possible to use any actor for tooltips. - Improved cross-platform reflection api for annotations. - NinePatch#scale now also scales middle patch size. - GLFrameBuffer is now abstract, renamed setupTexture to createColorTexture, added disposeColorTexture - Added LwjglApplicationConfiguration#gles30Context*Version, see https://github.com/libgdx/libgdx/pull/2941 - Added OpenGL error checking to GLProfiler, see https://github.com/libgdx/libgdx/pull/2889 - Updated to RoboVM 1.6 [1.6.4] - TextField cursor and selection size changed. https://github.com/libgdx/libgdx/commit/2a830dea348948d2a37bd8f6338af2023fec9b09 - FreeTypeFontGenerator setting to improve shadows and borders. - ScrollPane scrolls smoothly when the scrolled area is much larger than the scrollbars. - TexturePacker sorts page regions by name. - GlyphLayout text wrapping changed to not trim whitespace. https://github.com/libgdx/libgdx/commit/ee42693da067da7c5ddd747f051c1423d262cb96 - Fixed BitmapFont computing space width incorrectly when padding is used and no space glyph is in the font. - Fixed TextArea cursor and selection drawing positions. - Fixed ActorGestureListener pan and zoom when the actor is rotated or scaled. - Fixed TextField for non-pixel display. - Allow ellipsis string to be set on Label. - AssetManager gets hook for handling loading failure. - TextField now fires a ChangeEvent when the text change. Can be cancelled too! - Added tooltips to scene2d.ui. - Updated to RoboVM 1.5 [1.6.3] - Updated to RoboVM 1.4 [1.6.2] - API Change: TiledMapImageLayer now uses floats instead of ints for positioning - API Change: Added GLFrameBuffer and FrameBufferCubemap: Framebuffer now extends GLFramebuffer, see #2933 [1.6.1] - Added optional hostname argument to Net.newServerSocket method to allow specific ip bindings for server applications made with gdx. - Changed the way iOS native libs are handled. Removed updateRoboVMXML and copyNatives task from ios/build.gradle. Instead natives are now packaged in jars, within the META-INF/robovm/ios folder. Additionally, a robovm.xml file is stored there that gets merged with the project's robovm.xml file by RoboVM. [1.6.0] - API Change: GlyphLayout xAdvances now have an additional entry at the beginning. This was required to implement tighter text bounds. #3034 - API Change: Label#getTextBounds changed to getGlyphLayout. This exposes all the runs, not just the width and height. - In the 2D ParticleEditor, all chart points can be dragged at once by holding ctrl. They can be dragged proportionally by holding ctrl-shift. - Added Merge button to the 2D ParticleEditor, for merging a loaded particle effect file with the currently open particle effect. - Added ability to retrieve method annotations to reflection api - Added PixmapPacker.updateTextureRegions() method. - Added ability to pack "anonymous" pixmaps into PixmapPacker, which will appear in the generated texture but not a generated or updated TextureAtlas - Added PixmapPacker.packDirectToTexture() methods. - API Change: PixmapPacker.generateTextureAtlas(...) now returns an atlas which can be updated with subsequent calls to PixmapPacker.updateTextureAtlas(...) - API Change: FreeTypeFontGenerator.generateFont(...) now works with a user-provided PixmapPacker. - Added DirectionalLightsAttribute, PointLightsAttribute and SpotLightsAttribute, removed Environment#directionalLights/pointLights/spotLights, added Environment#remove, lights are now just like any other attribute. See also https://github.com/libgdx/libgdx/wiki/Material-and-environment#lights - API Change: BitmapFont metrics now respect padding. #3074 - Update bullet wrapper to v2.83 - Added AnimatedTiledMapTile.getFrameTiles() method [1.5.6] - API Change: Refactored Window. https://github.com/libgdx/libgdx/commit/7d372b3c67d4fcfe4e82546b0ad6891d14d03242 - Added VertexBufferObjectWithVAO, see https://github.com/libgdx/libgdx/pull/2527 - API Change: Removed Mesh.create(...), use MeshBuilder instead - API Change: BitmapFontData, BitmapFont, and BitmapFontCache have been refactored. http://www.badlogicgames.com/wordpress/?p=3658 - FreeTypeFontGenerator can now render glyphs on the fly. - Attribute now implements Comparable, custom attributes might need to be updated, see: https://github.com/libgdx/libgdx/wiki/Material-and-environment#custom-attributes - API Change: Removed (previously deprecated) GLTexture#createTextureData/createGLHandle, Ray#getEndPoint(float), Color#tmp, Node#parent/children, VertexAttribute#Color(), Usage#Color, ModelBuilder#createFromMesh, BoundingBox#getCenter()/updateCorners()/getCorners(), Matrix4.tmp [1.5.5] - Added iOS ARM-64 bit support for Bullet physics - 3D Animation, NodeAnimation keyframes are separated into translation, rotation and scaling - Added capability to enable color markup from inside skin json file. - Exposed method ControllerManager#clearListeners on Controllers class - Net#openURI now returns a boolean to indicate whether the uri was actually opened. - DefaultShader now always combines material and environment attributes - Added ShapeRenderer constructor to pass a custom shader program to ImmediateModeRenderer20. - API Change: Group#toString now returns actor hierarchy. Group#print is gone. - Added SpotLight class, see https://github.com/libgdx/libgdx/pull/2907 - Added support for resolving file handles using classpaths (ClasspathFileHandleResolver) [1.5.4] - Added support for image layers in Tiled maps (TiledMapImageLayer) - Added support for loading texture objects from TMX Maps (TextureMapObject) - Added support for border and shadow with FreeTypeFontGenerator - see https://github.com/libgdx/libgdx/pull/2774 - Now unknown markup colors are silently ignored and considered as normal text. - Updated freetype from version 2.4.10 to 2.5.5 - Added 3rd party extensions to setup application, see - Updated to RoboVM 1.0.0-beta-04 - Updated to GWT 2.6.1, sadly GWT 2.7.0 isn't production ready yet. [1.5.3] - API Change: TextField#setRightAlign -> TextField#setAlignment - I18NBundle is now compatible with Android 2.2 - Fixed GWT reflection includes for 3D particles - 3D ParticleEffectLoader registered by default - Added HttpRequestBuilder, see https://github.com/libgdx/libgdx/pull/2698 - Added LwjglApplicationConfiguration.useHDPI for Mac OS X with retina displays. Allows you to get "real" pixel coordinates for mouse and display coordinates. - Updated RoboVM to 1.0.0-beta-03 [1.5.2] - Fixed issue #2433 with color markup and alpha animation. - Fixed natives loading for LWJGL on Mac OS X [1.5.1] - Gradle updated to 2.2 - Android Gradle tooling updated to 1.0.0 - API Change: Switched from Timer to AnimationScheduler for driving main loop on GWT. Removed fps field from GwtApplicationConfiguration to instead let the browser choose the most optimal rate. - API Change: Added pause and resume handling on GWT backend. When the browser supports the page visibility api, pause and resume will be called when the tab or window loses and gains visibility. - API Change: Added concept of target actor, separate from the actor the action is added to. This allows an action to be added to one actor but affect another. This is useful to create a sequence of actions that affect many different actors. Previously this would require adding actions to each actor and using delays to get them to play in the correct order. - Added 64-bit support for iOS sim and device - Deprecated Node#children and Node#parent, added inheritTransform flag and methods to add/get/remove children - API Change: By default keyframes are no longer copied from Model to ModelInstance but shared instead, can be changed using the `ModelInstance.defaultShareKeyframes` flag or `shareKeyframes` constructor argument. - JSON minimal format now makes commas optional: newline can be used in place of any comma. - JSON minimal format is now more lenient with unquoted strings: spaces and more are allowed. - API Change: Added support for KTX/ZKTX file format, https://github.com/libgdx/libgdx/pull/2431 - Update stb_image from v1.33 to v1.48, see https://github.com/libgdx/libgdx/pull/2668 - Bullet Wrapper: added Gimpact, see https://github.com/libgdx/libgdx/issues/2619 - API Addition: Added MeshPartBuilder#addMesh(...), can be used to more easily combine meshes/models - Update to LWJGL 2.9.2, fixes fullscreen mode on "retina" displays - Fixes to RoboVM backend which would crash if accelerometer is used. [1.5.0] - API Addition: IOSInput now uses CMCoreMotion for accelerometer and magnetometer - API Addition: Added getter for UITextField on IOS for keyboard customization - API Addition: Added ability to save PixmapPackers to atlas files. See PixmapPackerIO. - API Addition: Added HttpRequestHeader and HttpResponseHeader with constants for HTTP headers. - API Addition: HttpRequest is now poolable. - New PNG encoder that supports compression, more efficient vertical flipping, and minimal allocation when encoding multiple PNGs. - API Change: Label#setEllipse -> Label#setEllipsis. - API Change: BatchTiledMapRenderer *SpriteBatch fields and methods renamed to *Batch - API Change: ScrollPane#scrollToCenter -> ScrollPane#scrollTo; see optional boolean arguments centerHorizontal and centerVertical (scrollToCenter centered vertically only). - API Change: Changed Input#getTextInput to accept both text and hint, removed Input#getPlaceholderTextInput. - Bug Fix: Fixed potential NPE with immersive mode in the Android fragment backend. - iOS backend now supports sound ids, thanks Tomski! [1.4.1] - Update to the Gradle Integration plugin nightly build if you are on Eclipse 4.4.x! - Update Intellij IDEA to 13.1.5+, because Gradle! - Updated to Gradle 2.1 and Android build tools 20, default Android version to 20. You need to install the latest Android build tools via the SDK manager - API Change: deprecation of bounding box methods, see https://github.com/libgdx/libgdx/pull/2408 - Added non-continuous rendering to iOS backend, thanks Dominik! - Setup now uses Gradle 2.1 with default Android API level 20, build tools 20.0.0 - Non-continuous renderering implemented for iOS - Added color markup support for scene2d label and window title. - API Change: removed default constructor of DecalBatch, removed DefaultGroupStrategy - Updated to latests RoboVM release, 1.0.0-alpha-04, please update your RoboVM plugins/installations - Reduced I18NBundle loading times on Android and bypassed unclosed stream on iOS. - Removed the gdx-ai extension from the libGDX repository. Now it lives in its own repository under the libGDX umbrella, see https://github.com/libgdx/gdx-ai - API Addition: Added randomSign and randomTriangular methods to MathUtils. - API Addition: Decal has now a getter for the Color. - API Addition: now I18NBundle can be set so that no exception is thrown when the key can not be found. - API Addition: added annotation support in reflection layer, thanks code-disaster! https://github.com/libgdx/libgdx/pull/2215 - API Addition: shapes like Rect, Circle etc. now implement Shape2D interface so you can put them all into a single collection https://github.com/libgdx/libgdx/pull/2178 - API Addition: bitmap fonts can now be loaded from an atlas via AssetManager/BitmapFontLoader, see https://github.com/libgdx/libgdx/pull/2110 - API Change: updated to RoboVM 1.0.0-SNAPSHOT for now until the next alpha is released. - API Change: Table now uses padding from its background drawable by default. https://github.com/libgdx/libgdx/issues/2322 - Drawables now know their names, making debugging easier. - API Change: Table fill now respects the widget's minimum size. - Texture packer, fixed image size written to atlas file. - API Change: Cell no longer uses primitive wrappers in public API and boxing is minimized. - API Addition: TextureAttribute now supports uv transform (texture regions). - API Change: Added parameters to Elastic Interpolation. - API Change: Removed Actor#setCenterPosition, added setPosition(x,y,align). - API Change: JsonReader, forward slash added to characters an unquoted strings cannot start with. - API Change: Stage#cancelTouchFocus(EventListener,Actor) changed to cancelTouchFocusExcept. - API Change: Json/JsonWriter.setQuoteLongValues() quotes Long, BigDecimal and BigInteger types to prevent truncation in languages like JavaScript and PHP. [1.3.1] - API change: Viewport refactoring. https://github.com/libgdx/libgdx/pull/2220 - Fixed GWT issues [1.3.0] - Added Input.isKeyJustPressed. - API Addition: multiple recipients are now supported by MessageDispatcher, see https://github.com/libgdx/libgdx/wiki/Message-Handling#multiple-recipients - API Change: State#onMessage now takes the message receiver as argument. - API Addition: added StackStateMachine to the gdx-ai extension. - API change: ShapeRenderer: rect methods accept scale, more methods can work under both line and fill types, auto shape type changing. - API change: Built-in ShapeRenderer debugging for Stage, see https://github.com/libgdx/libgdx/pull/2011 - Files#getLocalStoragePath now returns the actual path instead of the empty string synonym on desktop (LWJGL and JGLFW). - Fixed and improved xorshift128+ PRNG implementation. - Added support for Tiled's animated tiles, and varying frame duration tile animations. - Fixed an issue with time granularity in MessageDispatcher. - Updated to Android API level 19 and build tools 19.1.0 which will require the latest Eclipse ADT 23.02, see http://stackoverflow.com/questions/24437564/update-eclipse-with-android-development-tools-23 for how things are broken this time... - Updated to RoboVM 0.0.14 and RoboVM Gradle plugin version 0.0.10 - API Addition: added FreeTypeFontLoader so you can transparently load BitmapFonts generated through gdx-freetype via AssetManager, see https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/FreeTypeFontLoaderTest.java - Preferences put methods now return "this" for chaining - Fixed issue 2048 where MessageDispatcher was dispatching delayed messages immediately. - API Addition: 3d particle system and accompanying editor, contributed by lordjone, see https://github.com/libgdx/libgdx/pull/2005 - API Addition: extended shape classes like Circle, Ellipse etc. with hashcode/equals and other helper methods, see https://github.com/libgdx/libgdx/pull/2018 - minor API change (will not increase minor revision number): fixed a bug in handling of atlasPrefixes, https://github.com/libgdx/libgdx/pull/2023 - Bullet: btManifoldPoint member getters/setters changed from btVector3 to Vector3, also it is no longer pooled, instead static instances are used for callback methods - Added Intersector#intersectRayRay to detect if two 2D rays intersect, see https://github.com/libgdx/libgdx/pull/2132 - Bullet: ClosestRayResultCallback, AllHitsRayResultCallback, LocalConvexResult, ClosestConvexResultCallback and subclasses now use getter/setters taking a Vector3 instead of btVector3, see https://github.com/libgdx/libgdx/pull/2176 - 2d particle system supports pre-multiplied alpha. - Bullet: btIDebugDrawer/DebugDrawer now use pooled Vector3 instances instead of btVector3, see https://github.com/libgdx/libgdx/issues/2174 [1.2.0] - API Addition: Some OpenGL profiling utilities have been added, see https://github.com/libgdx/libgdx/wiki/Profiling - API Addition: A FreeTypeFontGeneratorLoader has been added to the gdx-freetype extension - API change: Animation#frameDuration and #animationDuration are now hidden behind a getter/setter and dynamic - API Addition: Vector#setZero - API Addition: gdx-ai, extension for AI algorithms. Currently supports FSMs, see https://github.com/libgdx/libgdx/wiki/Artificial-Intelligence - API change: TableLayout has been forked and integrated into libgdx more tightly, see http://www.badlogicgames.com/wordpress/?p=3458 - API Addition: added equals/hashCode methods to Rectangle, may break old code (very, very unlikely) - API Addition: scene2D Actors now have a setCenterPosition method, see https://github.com/libgdx/libgdx/pull/2000 [1.1.0] - Updated to RoboVM 0.0.13 and RoboVM Gradle plugin 0.0.9 - Big improvements to setup-ui and build times in Intellij IDEA https://github.com/libgdx/libgdx/pull/1865 - Setup now uses android build tools version: 19.1.0 - BitmapFontCache now supports in-string colored text through a simple markup language, see https://github.com/libgdx/libgdx/wiki/Color-Markup-Language - Added i18n localization/internationalization support, thanks davebaol, see https://github.com/libgdx/libgdx/wiki/Internationalization-and-Localization - Possibility to override density on desktop to simulate mobile devices, see https://github.com/libgdx/libgdx/pull/1825 - Progressive JPEG support through JPGD (https://code.google.com/p/jpeg-compressor/). - Mavenized JGLFW backend - Box2D: Added MotorJoint and ghost vertices on EdgeShape - Updated GWT Box2D to latest version - Updated native Box2D to latest version 2.3.1, no API changes - API change: Matrix4.set(x,y,z, translation) changed, z axis is no more flipped - API addition: Matrix4.avg(Matrix4[],float[]) that lets weighted averaging multiple matrices, Quaternion.slerp(Quaternion[],float[]) that lets weighted slerping multiple Quaternions - fixed the long standing issue of the alpha=1 not actually being fully opaque, thanks kalle! https://github.com/libgdx/libgdx/issues/1815 - down to 25 issues on the tracker, 8 bugs, 17 enhancement requests :) [1.0.1] - updated to RoboVM 0.12 (and so should you!) - fixed GC issues on iOS with regards to touch (thanks Niklas!), see https://github.com/libgdx/libgdx/pull/1758 - updated gwt gradle plugin to 0.4, android build tools to 0.10, gradle version to 1.11 - Tiled maps are now always y-up - Tiled maps now support drawing offsets for tiles - FileHandle#list is now supported in GWT! - FileHandle#list now supports FileFilters - Controllers now reinitialize on the desktop when switching between windowed/fullscreen - added a Texture unpacker that will extract all images from a texture atlas, see https://github.com/libgdx/libgdx/pull/1774 - updates to gdx-setup - CustomCollisionDispatcher in bullet, see https://github.com/libgdx/libgdx/commit/916fc85cecf433c3461b458e00f8afc516ad21e3 [1.0.0] - Box2D is no longer in the core, it has been moved to an extension. See http://www.badlogicgames.com/wordpress/?p=3404 - Merged gdx-openal project into gdx-backend-lwjgl - Now LoadedCallback in AssetLoaderParameters is always called after loading an asset from AssetManager, even if the asset is already loaded - Added Payload as a new parameter to Source.dragStop, see https://github.com/libgdx/libgdx/pull/1666 - You can now load PolygonRegions via AssetLoader, see https://github.com/libgdx/libgdx/pull/1602 - implemented software keyboard support in RoboVM iOS backend - Fixed an issue where key event timestamp is not set by the android backend. - scene2d.ui, added to TextArea the preferred number of rows used to calculate the preferred height. - scene2d.actions, fixed infinite recursion for event listener's handle(event). - Various Quaternion changes. - scene2d.ui, fixed a drawing issue with knobBefore when there's no knob (typical progress bar). - Various MeshBuilder fixes and additions. - Math package: added cumulative distribution. - Fixed Music isPlaying() on iOS when is paused. - Added support for C-style comments to JsonReader (mainly used for json skin files). - Support for resource removal from Skin objects. - Added fling gesture to generate fling in scrollpane. - Vector classes now have mulAdd method for adding pre-multiplied values - Vector implementations no longer use squared value for margin comparisons, see: isZero(float margin), isUnit(float margin). - Vector2 now has isUnit and isZero methods (copied from Vector3) - Removed deprecated methods from Vector classes. - Added new headless backend for server applications - Support 'scaledSize' as a json skin data value for BitmapFont - Added setAlpha(float a) method to Sprite class - Added Input.Keys.toString(int keycode) and Input.Keys.valueOf(String keyname) methods - Added Immersive Mode support to Android backend - Added userObject to Actor in scene2d, allowing for custom data storage - Altered Android's hide status bar behavior - Changed the way wakelocks are implemented. You no longer need any special permissions for the libgdx wakelock - BitmapFontCache setColor changes to match SpriteBatch and friends. http://www.badlogicgames.com/forum/viewtopic.php?f=23&t=12112 - Changed ParticleEffect: the ParticleEffect.save method now takes a Writer instead of a File - TexturePacker2 renamed to TexturePacker, added grid and scaling settings. - Added support for custom prefrences on the desktop backends. - Fixed double resume calls on iOS. - Android Music no longer throws exceptions if MediaPlayer is null. - PolygonSpriteBatch implements Batch. - New scene2d actions: EventAction, CountdownEventAction. - Adds cancelHttpRequest() method to Net interface - Updated GWT/HTML5 Backend to GWT 2.6.0 - Minimal Android version is 2.2, see http://www.badlogicgames.com/wordpress/?p=3297 - Updated to LWJGL 2.9.1 - Can now embed your libgdx app as a fragment, more info on the wiki - scene2d.ui, renamed Actor methods translate, rotate, scale, size to moveBy, rotateBy, scaleBy, sizeBy. May have conflicts with Actions static import, eg you'll need to use "Actions.moveBy" - scene2d.ui, Table background is now drawn usign the table's transform - scene2d.ui, added Container which is similar to a Table with one cell, but more lightweight - Added texture filters and mip map generation to BitMapFontLoader and FreeTypeFontGenerator - scene2d.ui, VerticalGroup and HorizontalGroup got pad, fill and an API similar to Table/Container - Removed OpenGL ES 1.0, 1.1 support; see http://www.badlogicgames.com/wordpress/?p=3311 - Added OpenGL ES 3 support - Updated Android backend, demos, tests to 4.4 - Added Viewport, changed Stage to have a Viewport instead of a Camera (API change, see http://www.badlogicgames.com/wordpress/?p=3322 ). - Changed play mode constants of Animation class to enumeration, see http://www.badlogicgames.com/wordpress/?p=3330 - Updated to RoboVM 0.0.11 and RoboVM Gradle plugin 0.0.6, see http://www.badlogicgames.com/wordpress/?p=3351 - Updated to Swig 3.0 for Bullet, disabled SIMD on Mac OS X as alignements are broken in Bullet, see https://github.com/libgdx/libgdx/pull/1595 - TextureData can only be Custom or Pixmap; compressed image files are considered custom [0.9.9] - added setCursorImage method to Input interface to support custom mouse cursors on the desktop - removed Xamarin backend, see http://www.badlogicgames.com/wordpress/?p=3213 - added Select class for selecting kth ordered statistic from arrays (see Array.selectRanked() method) - refactored Box2D to use badlogic Arrays instead of java.util.ArrayLists - MipMapGenerator methods now don't take disposePixmap argument anymore - added GLTexture, base class for all textures, encapsulates target (2d, cubemap, ...) - added CubeMap, 6 sided texture - changed TextureData#consumeCompressedData, takes target now - added RoboVM backend jar and native libs (libObjectAL, libgdx, in ios/ folder of distribution) - added RoboVM backend to build - changed Bullet wrapper API, see http://www.badlogicgames.com/wordpress/?p=3150 - changed MusicLoader and SoundLoader to be asynchronous loaders - changed behaviour of Net#sendHttpRequest() so HttpResponseListener#handleHttpResponse() callback is executed in worker thread instead of main thread - added Bresenham2, for drawing lines on an integer 2D grid - added GridPoint2 and GridPoint3, representing integer points in a 2D or 3D grid - added attribute location caching for VertexData/Mesh. Hand vertex attribs to a ShaderProgram, get back int[], pass that to Mesh - added Android x86 builds, removed libandroidgl20.so, it's now build as part of gdx-core for Android - changed method signature on Box2D World#getBodies and World#getJoints, pass in an Array to fill - removed glGetShaderSource from GL20, use ShaderProgram#getVertexShaderSource/getFragmentShaderSource instead - added reflection api - added AsynchExecutor, execute tasks asynchronously. Used for GWT mainly. - removed FileHandle#file(), has no business in there. - removed box2deditor - removed custom typedarrays in gwt backend - added classpath files support for gwt backend (limited) - moved AndroidWallpaperListener to Android Backend - added new VertexAttribute Usage flags, bone weight, tangent, binormal. previously encoded as Usage.Generic. Also added field "unit" to VertexAttribute, used by texture coordinates and bone weights to specify index/unit. - setup-ui template for iOS disables pngcrush, also updated wiki iOS article - add Pixmap#fillTriangle via jni gdx2d_fill_triangle() to fill a triangle based on its vertices. - add asynchronous download with continuous progress feedback to GWT asset preloader, see https://github.com/libgdx/libgdx/pull/409?w=1 - add capability to add/exclude package/classes GWT Reflection system, see https://github.com/libgdx/libgdx/pull/409?w=1 - add updated gdx-tiled-preprocessor, generate one single TextureAtlas for all the specified Tiled maps, see http://www.badlogicgames.com/forum/viewtopic.php?f=17&t=8911 - maps API, add new AtlasTiledMapLoader for loading maps produced by the tiled preprocessor tool - ImageProcessor, TexturePacker2 now accepts BufferedImage objects as input - TexturePacker2 now avoids duplicated aliases - Updated to LWJGL 2.9.0 - refactored JSON API, see http://www.badlogicgames.com/wordpress/?p=2993 - Updated Box2D to the latest trunk. Body#applyXXX methods now take an additional boolean parameter. - TmxMapLoader has a flag in Parameters that lets you specify whether to generate mipmaps - Animation#isAnimationFinished was fixed to behave as per javadocs (ignores looping) - remove GLU interface and implementations. Use Matrix4 et al instead. see http://www.badlogicgames.com/wordpress/?p=2886 - new maps API, see http://www.badlogicgames.com/wordpress/?p=2870 - removed static public tmp Vector2 instances, manage such temporary vars yourself, see http://www.badlogicgames.com/wordpress/?p=2840 - changed Scene2D Group#clear(), see http://www.badlogicgames.com/wordpress/?p=2837 - changed the build system, natives are now fetched from the build server, see http://www.badlogicgames.com/wordpress/?p=2821 - freetype extension supported on iOS, see http://www.badlogicgames.com/wordpress/?p=2819 - changed ShapeRenderer API, see http://www.badlogicgames.com/wordpress/?p=2809 - changed Actions.add to addAction, changed parameter order, and added removeAction, addListener, removeListener - Box2d joints now allow for user data - Changes to Intersector, Circle, Rectangle and BoundingBox for consistency in #overlap, #intersect and #contains methods, see https://github.com/libgdx/libgdx/pull/312 - Removed LwjglApplicationConfiguration CPU sync. Added foreground and background target framerate. - scene2d, no longer use getters/setters internally for Actor x, y, width, height, scalex, scaley and rotation. - Array, detect nested iterator usage and throw exception. - Added getVolume to Music class and Android, IOS and GWT backends - 1381, fixed JSON parsing of longs. In addition to Float, it now parses Long if no decimal point is found. - Changed Array constructors that took an array to have offset and count - scene2d, Actor parentToLocalCoordinates and localToParentCoordinates refactoring, see http://www.badlogicgames.com/forum/viewtopic.php?p=40441#p40441 - scene2d, Action#setActor no longer calls reset if the Action has no pool. This allows non-pooled actions to be add and removed from actors, restarted, and reused. - ScrollBar#setForceOverscroll renamed to setForceScroll, as it affects more than just overscroll. - ArrayMap#addAll renamed to putAll to match the other maps. - Added ObjectSet and IntSet. - Added completion listener to Music. - Added Music#setPan. - Sound#play and Sound#loop on Android now return -1 on failure, to match other backends. - DelegateAction subclasses need to implement delegate() instead of act(). http://www.badlogicgames.com/forum/viewtopic.php?p=43576#p43576 - Added pause and resume methods to Sound. - Changed AssetErrorListener#error to have AssetDescriptor to enable access to parameters of failed asset. - Changed SelectBoxStyle to have ScrollPaneStyle and ListStyle for fully customizing the drop down list. http://www.badlogicgames.com/wordpress/?p=3110 - AssetLoader now takes a FileHandle that is the resolved file name. The AssetLoader no longer has to resolve the file name, so we can prevent it from being resolved twice. - Rewrote EarClippingTriangulator to not allocate (no more Vector2s). - Added ParticleEffectLoader to make AssetManager load ParticleEffects - Added GeometryUtils, more Intersector functions, DelaunayTriangulator, ConvexHull. - Added getBoundingBox to ParticleEffect - EarClippingTriangulator changed to return triangle indices. - PolygonSpriteBatch and friends refactored to use triangle indices. - Added add(T, float), remove(int), remove(T) and clear() methods to BinaryHeap - Bitmap Font changes: - FreeTypeFontGenerator allows you to specify the PixmapPacker now, to create an atlas with many different fonts (see FreeTypePackTest) - BitmapFont, BitmapFontCache and FreeTypeFontGenerator now support fonts with multiple texture pages. (see BitmapFontTest and FreeTypePackTest) - BitmapFontData.imagePath and getImagePath() is depreacted, use imagePaths[] and getImagePath(int) instead - Added two BitmapFont constructors for convenience; no need to specify flip boolean - Added getCache() to BitmapFont, for expert users who wish to use the BitmapFontCache (see BitmapFontTest) - FreeTypeFontGenerator now includes setMaxTextureSize and getMaxTextureSize to cap the generated glyph atlas size (default 1024) - added render-hooks beginRender() and endRender() to BatchTiledMapRenderer - Added panStop to GestureListener interface. - ScissorStack#calculateScissors changed to take viewport, enabling it to work with glViewport. - Added Bits#getAndClear, Bits#getAndSet and Bits#containsAll - Added setX and setY to TextureAtlas.AtlasSprite so it matches expected behavior [0.9.8] - see http://www.badlogicgames.com/wordpress/?p=2791 [0.9.7] - see http://www.badlogicgames.com/wordpress/?p=2664 [0.9.6] - see http://www.badlogicgames.com/wordpress/?p=2513
1
libgdx/libgdx
7,215
Revert #6821
obigu
2023-08-22T10:02:37Z
2023-08-25T03:27:36Z
c9ed23f0371f1ece2942ccff2086893f2c08e1c9
ed811688c42a3eeb32427e56b47988e7ac4a6539
Revert #6821.
./backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.android; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Build; import android.os.Handler; import android.text.InputType; import android.text.method.PasswordTransformationMethod; import android.view.MotionEvent; import android.view.Surface; import android.view.View; import android.view.View.OnGenericMotionListener; import android.view.View.OnKeyListener; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import com.badlogic.gdx.AbstractInput; import com.badlogic.gdx.Application; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Graphics.DisplayMode; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20; import com.badlogic.gdx.utils.Pool; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** An implementation of the {@link Input} interface for Android. * * @author mzechner */ /** @author jshapcot */ public class DefaultAndroidInput extends AbstractInput implements AndroidInput { static class KeyEvent { static final int KEY_DOWN = 0; static final int KEY_UP = 1; static final int KEY_TYPED = 2; long timeStamp; int type; int keyCode; char keyChar; } static class TouchEvent { static final int TOUCH_DOWN = 0; static final int TOUCH_UP = 1; static final int TOUCH_DRAGGED = 2; static final int TOUCH_SCROLLED = 3; static final int TOUCH_MOVED = 4; static final int TOUCH_CANCELLED = 5; long timeStamp; int type; int x; int y; int scrollAmountX; int scrollAmountY; int button; int pointer; } Pool<KeyEvent> usedKeyEvents = new Pool<KeyEvent>(16, 1000) { protected KeyEvent newObject () { return new KeyEvent(); } }; Pool<TouchEvent> usedTouchEvents = new Pool<TouchEvent>(16, 1000) { protected TouchEvent newObject () { return new TouchEvent(); } }; public static final int NUM_TOUCHES = 20; ArrayList<OnKeyListener> keyListeners = new ArrayList(); ArrayList<KeyEvent> keyEvents = new ArrayList(); ArrayList<TouchEvent> touchEvents = new ArrayList(); int[] touchX = new int[NUM_TOUCHES]; int[] touchY = new int[NUM_TOUCHES]; int[] deltaX = new int[NUM_TOUCHES]; int[] deltaY = new int[NUM_TOUCHES]; boolean[] touched = new boolean[NUM_TOUCHES]; int[] button = new int[NUM_TOUCHES]; int[] realId = new int[NUM_TOUCHES]; float[] pressure = new float[NUM_TOUCHES]; final boolean hasMultitouch; private boolean[] justPressedButtons = new boolean[NUM_TOUCHES]; private SensorManager manager; public boolean accelerometerAvailable = false; protected final float[] accelerometerValues = new float[3]; public boolean gyroscopeAvailable = false; protected final float[] gyroscopeValues = new float[3]; private Handler handle; final Application app; final Context context; protected final AndroidTouchHandler touchHandler; private int sleepTime = 0; protected final AndroidHaptics haptics; private boolean compassAvailable = false; private boolean rotationVectorAvailable = false; boolean keyboardAvailable; protected final float[] magneticFieldValues = new float[3]; protected final float[] rotationVectorValues = new float[3]; private float azimuth = 0; private float pitch = 0; private float roll = 0; private boolean justTouched = false; private InputProcessor processor; private final AndroidApplicationConfiguration config; protected final Orientation nativeOrientation; private long currentEventTimeStamp = 0; private SensorEventListener accelerometerListener; private SensorEventListener gyroscopeListener; private SensorEventListener compassListener; private SensorEventListener rotationVectorListener; private final ArrayList<OnGenericMotionListener> genericMotionListeners = new ArrayList(); private final AndroidMouseHandler mouseHandler; public DefaultAndroidInput (Application activity, Context context, Object view, AndroidApplicationConfiguration config) { // we hook into View, for LWPs we call onTouch below directly from // within the AndroidLivewallpaperEngine#onTouchEvent() method. if (view instanceof View) { View v = (View)view; v.setOnKeyListener(this); v.setOnTouchListener(this); v.setFocusable(true); v.setFocusableInTouchMode(true); v.requestFocus(); v.setOnGenericMotionListener(this); } this.config = config; this.mouseHandler = new AndroidMouseHandler(); for (int i = 0; i < realId.length; i++) realId[i] = -1; handle = new Handler(); this.app = activity; this.context = context; this.sleepTime = config.touchSleepTime; touchHandler = new AndroidTouchHandler(); hasMultitouch = touchHandler.supportsMultitouch(context); haptics = new AndroidHaptics(context); int rotation = getRotation(); DisplayMode mode = app.getGraphics().getDisplayMode(); if (((rotation == 0 || rotation == 180) && (mode.width >= mode.height)) || ((rotation == 90 || rotation == 270) && (mode.width <= mode.height))) { nativeOrientation = Orientation.Landscape; } else { nativeOrientation = Orientation.Portrait; } // this is for backward compatibility: libGDX always caught the circle button, original comment: // circle button on Xperia Play shouldn't need catchBack == true setCatchKey(Keys.BUTTON_CIRCLE, true); } @Override public float getAccelerometerX () { return accelerometerValues[0]; } @Override public float getAccelerometerY () { return accelerometerValues[1]; } @Override public float getAccelerometerZ () { return accelerometerValues[2]; } @Override public float getGyroscopeX () { return gyroscopeValues[0]; } @Override public float getGyroscopeY () { return gyroscopeValues[1]; } @Override public float getGyroscopeZ () { return gyroscopeValues[2]; } @Override public void getTextInput (TextInputListener listener, String title, String text, String hint) { getTextInput(listener, title, text, hint, OnscreenKeyboardType.Default); } @Override public void getTextInput (final TextInputListener listener, final String title, final String text, final String hint, final OnscreenKeyboardType keyboardType) { handle.post(new Runnable() { public void run () { AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.setTitle(title); final EditText input = new EditText(context); if (keyboardType != OnscreenKeyboardType.Default) { input.setInputType(getAndroidInputType(keyboardType)); } input.setHint(hint); input.setText(text); input.setSingleLine(); if (keyboardType == OnscreenKeyboardType.Password) { input.setTransformationMethod(new PasswordTransformationMethod()); } alert.setView(input); alert.setPositiveButton(context.getString(android.R.string.ok), new DialogInterface.OnClickListener() { public void onClick (DialogInterface dialog, int whichButton) { Gdx.app.postRunnable(new Runnable() { @Override public void run () { listener.input(input.getText().toString()); } }); } }); alert.setNegativeButton(context.getString(android.R.string.cancel), new DialogInterface.OnClickListener() { public void onClick (DialogInterface dialog, int whichButton) { Gdx.app.postRunnable(new Runnable() { @Override public void run () { listener.canceled(); } }); } }); alert.setOnCancelListener(new OnCancelListener() { @Override public void onCancel (DialogInterface arg0) { Gdx.app.postRunnable(new Runnable() { @Override public void run () { listener.canceled(); } }); } }); alert.show(); } }); } public static int getAndroidInputType (OnscreenKeyboardType type) { int inputType; switch (type) { case NumberPad: inputType = InputType.TYPE_CLASS_NUMBER; break; case PhonePad: inputType = InputType.TYPE_CLASS_PHONE; break; case Email: inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; break; case Password: inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD; break; case URI: inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI; break; default: inputType = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; break; } return inputType; } @Override public int getMaxPointers () { return NUM_TOUCHES; } @Override public int getX () { synchronized (this) { return touchX[0]; } } @Override public int getY () { synchronized (this) { return touchY[0]; } } @Override public int getX (int pointer) { synchronized (this) { return touchX[pointer]; } } @Override public int getY (int pointer) { synchronized (this) { return touchY[pointer]; } } public boolean isTouched (int pointer) { synchronized (this) { return touched[pointer]; } } @Override public float getPressure () { return getPressure(0); } @Override public float getPressure (int pointer) { return pressure[pointer]; } @Override public void setKeyboardAvailable (boolean available) { this.keyboardAvailable = available; } @Override public boolean isTouched () { synchronized (this) { if (hasMultitouch) { for (int pointer = 0; pointer < NUM_TOUCHES; pointer++) { if (touched[pointer]) { return true; } } } return touched[0]; } } public void setInputProcessor (InputProcessor processor) { synchronized (this) { this.processor = processor; } } @Override public void processEvents () { synchronized (this) { if (justTouched) { justTouched = false; for (int i = 0; i < justPressedButtons.length; i++) { justPressedButtons[i] = false; } } if (keyJustPressed) { keyJustPressed = false; for (int i = 0; i < justPressedKeys.length; i++) { justPressedKeys[i] = false; } } if (!isCursorCatched()) { deltaX[0] = 0; deltaY[0] = 0; } if (processor != null) { final InputProcessor processor = this.processor; int len = keyEvents.size(); for (int i = 0; i < len; i++) { KeyEvent e = keyEvents.get(i); currentEventTimeStamp = e.timeStamp; switch (e.type) { case KeyEvent.KEY_DOWN: // Catching the cursor causes it to send D-pad events. Ignore them. if (!isCursorCatched() || !(e.keyCode >= Keys.UP && e.keyCode <= Keys.CENTER)) { processor.keyDown(e.keyCode); keyJustPressed = true; justPressedKeys[e.keyCode] = true; } break; case KeyEvent.KEY_UP: if (!isCursorCatched() || !(e.keyCode >= Keys.UP && e.keyCode <= Keys.CENTER)) { processor.keyUp(e.keyCode); } break; case KeyEvent.KEY_TYPED: if (!isCursorCatched() || e.keyChar != Keys.UNKNOWN) { processor.keyTyped(e.keyChar); } } usedKeyEvents.free(e); } len = touchEvents.size(); for (int i = 0; i < len; i++) { TouchEvent e = touchEvents.get(i); currentEventTimeStamp = e.timeStamp; switch (e.type) { case TouchEvent.TOUCH_DOWN: processor.touchDown(e.x, e.y, e.pointer, e.button); justTouched = true; justPressedButtons[e.button] = true; break; case TouchEvent.TOUCH_UP: processor.touchUp(e.x, e.y, e.pointer, e.button); break; case TouchEvent.TOUCH_DRAGGED: processor.touchDragged(e.x, e.y, e.pointer); break; case TouchEvent.TOUCH_CANCELLED: processor.touchCancelled(e.x, e.y, e.pointer, e.button); break; case TouchEvent.TOUCH_MOVED: processor.mouseMoved(e.x, e.y); break; case TouchEvent.TOUCH_SCROLLED: processor.scrolled(e.scrollAmountX, e.scrollAmountY); } usedTouchEvents.free(e); } } else { int len = touchEvents.size(); for (int i = 0; i < len; i++) { TouchEvent e = touchEvents.get(i); if (e.type == TouchEvent.TOUCH_DOWN) justTouched = true; usedTouchEvents.free(e); } len = keyEvents.size(); for (int i = 0; i < len; i++) { usedKeyEvents.free(keyEvents.get(i)); } } keyEvents.clear(); touchEvents.clear(); } } boolean requestFocus = true; @Override public boolean onTouch (View view, MotionEvent event) { if (requestFocus && view != null) { view.setFocusableInTouchMode(true); view.requestFocus(); requestFocus = false; } // synchronized in handler.postTouchEvent() touchHandler.onTouch(event, this); if (sleepTime != 0) { try { Thread.sleep(sleepTime); } catch (InterruptedException e) { } } return true; } // TODO Seems unused. Delete when confirmed. // /** Called in {@link AndroidLiveWallpaperService} on tap // * @param x // * @param y */ // public void onTap (int x, int y) { // postTap(x, y); // } // // /** Called in {@link AndroidLiveWallpaperService} on drop // * @param x // * @param y */ // public void onDrop (int x, int y) { // postTap(x, y); // } // // protected void postTap (int x, int y) { // synchronized (this) { // TouchEvent event = usedTouchEvents.obtain(); // event.timeStamp = System.nanoTime(); // event.pointer = 0; // event.x = x; // event.y = y; // event.type = TouchEvent.TOUCH_DOWN; // touchEvents.add(event); // // event = usedTouchEvents.obtain(); // event.timeStamp = System.nanoTime(); // event.pointer = 0; // event.x = x; // event.y = y; // event.type = TouchEvent.TOUCH_UP; // touchEvents.add(event); // } // Gdx.app.getGraphics().requestRendering(); // } @Override public boolean onKey (View v, int keyCode, android.view.KeyEvent e) { for (int i = 0, n = keyListeners.size(); i < n; i++) if (keyListeners.get(i).onKey(v, keyCode, e)) return true; // If the key is held sufficiently long that it repeats, then the initial down is followed // additional key events with ACTION_DOWN and a non-zero value for getRepeatCount(). // We are only interested in the first key down event here and must ignore all others if (e.getAction() == android.view.KeyEvent.ACTION_DOWN && e.getRepeatCount() > 0) return isCatchKey(keyCode); synchronized (this) { KeyEvent event = null; if (e.getKeyCode() == android.view.KeyEvent.KEYCODE_UNKNOWN && e.getAction() == android.view.KeyEvent.ACTION_MULTIPLE) { String chars = e.getCharacters(); for (int i = 0; i < chars.length(); i++) { event = usedKeyEvents.obtain(); event.timeStamp = System.nanoTime(); event.keyCode = 0; event.keyChar = chars.charAt(i); event.type = KeyEvent.KEY_TYPED; keyEvents.add(event); } return false; } char character = (char)e.getUnicodeChar(); // Android doesn't report a unicode char for back space. hrm... if (keyCode == 67) character = '\b'; if (e.getKeyCode() < 0 || e.getKeyCode() > Keys.MAX_KEYCODE) { return false; } switch (e.getAction()) { case android.view.KeyEvent.ACTION_DOWN: event = usedKeyEvents.obtain(); event.timeStamp = System.nanoTime(); event.keyChar = 0; event.keyCode = e.getKeyCode(); event.type = KeyEvent.KEY_DOWN; // Xperia hack for circle key. gah... if (keyCode == android.view.KeyEvent.KEYCODE_BACK && e.isAltPressed()) { keyCode = Keys.BUTTON_CIRCLE; event.keyCode = keyCode; } keyEvents.add(event); if (!pressedKeys[event.keyCode]) { pressedKeyCount++; pressedKeys[event.keyCode] = true; } break; case android.view.KeyEvent.ACTION_UP: long timeStamp = System.nanoTime(); event = usedKeyEvents.obtain(); event.timeStamp = timeStamp; event.keyChar = 0; event.keyCode = e.getKeyCode(); event.type = KeyEvent.KEY_UP; // Xperia hack for circle key. gah... if (keyCode == android.view.KeyEvent.KEYCODE_BACK && e.isAltPressed()) { keyCode = Keys.BUTTON_CIRCLE; event.keyCode = keyCode; } keyEvents.add(event); event = usedKeyEvents.obtain(); event.timeStamp = timeStamp; event.keyChar = character; event.keyCode = 0; event.type = KeyEvent.KEY_TYPED; keyEvents.add(event); if (keyCode == Keys.BUTTON_CIRCLE) { if (pressedKeys[Keys.BUTTON_CIRCLE]) { pressedKeyCount--; pressedKeys[Keys.BUTTON_CIRCLE] = false; } } else { if (pressedKeys[e.getKeyCode()]) { pressedKeyCount--; pressedKeys[e.getKeyCode()] = false; } } } app.getGraphics().requestRendering(); } return isCatchKey(keyCode); } @Override public void setOnscreenKeyboardVisible (final boolean visible) { setOnscreenKeyboardVisible(visible, OnscreenKeyboardType.Default); } @Override public void setOnscreenKeyboardVisible (final boolean visible, final OnscreenKeyboardType type) { handle.post(new Runnable() { public void run () { InputMethodManager manager = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); if (visible) { View view = ((AndroidGraphics)app.getGraphics()).getView(); OnscreenKeyboardType tmp = type == null ? OnscreenKeyboardType.Default : type; if (((GLSurfaceView20)view).onscreenKeyboardType != tmp) { ((GLSurfaceView20)view).onscreenKeyboardType = tmp; manager.restartInput(view); } view.setFocusable(true); view.setFocusableInTouchMode(true); manager.showSoftInput(((AndroidGraphics)app.getGraphics()).getView(), 0); } else { manager.hideSoftInputFromWindow(((AndroidGraphics)app.getGraphics()).getView().getWindowToken(), 0); } } }); } @Override public void vibrate (int milliseconds) { haptics.vibrate(milliseconds); } @Override public void vibrate (int milliseconds, boolean fallback) { haptics.vibrate(milliseconds); } @Override public void vibrate (int milliseconds, int amplitude, boolean fallback) { haptics.vibrate(milliseconds, amplitude, fallback); } @Override public void vibrate (VibrationType vibrationType) { haptics.vibrate(vibrationType); } @Override public boolean justTouched () { return justTouched; } @Override public boolean isButtonPressed (int button) { synchronized (this) { if (hasMultitouch) { for (int pointer = 0; pointer < NUM_TOUCHES; pointer++) { if (touched[pointer] && (this.button[pointer] == button)) { return true; } } } return (touched[0] && (this.button[0] == button)); } } @Override public boolean isButtonJustPressed (int button) { if (button < 0 || button > NUM_TOUCHES) return false; return justPressedButtons[button]; } final float[] R = new float[9]; final float[] orientation = new float[3]; private void updateOrientation () { if (rotationVectorAvailable) { SensorManager.getRotationMatrixFromVector(R, rotationVectorValues); } else if (!SensorManager.getRotationMatrix(R, null, accelerometerValues, magneticFieldValues)) { return; // compass + accelerometer in free fall } SensorManager.getOrientation(R, orientation); azimuth = (float)Math.toDegrees(orientation[0]); pitch = (float)Math.toDegrees(orientation[1]); roll = (float)Math.toDegrees(orientation[2]); } /** Returns the rotation matrix describing the devices rotation as per * <a href= "http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], * float[], float[])" >SensorManager#getRotationMatrix(float[], float[], float[], float[])</a>. Does not manipulate the matrix * if the platform does not have an accelerometer and compass, or a rotation vector sensor. * @param matrix */ public void getRotationMatrix (float[] matrix) { if (rotationVectorAvailable) SensorManager.getRotationMatrixFromVector(matrix, rotationVectorValues); else // compass + accelerometer SensorManager.getRotationMatrix(matrix, null, accelerometerValues, magneticFieldValues); } @Override public float getAzimuth () { if (!compassAvailable && !rotationVectorAvailable) return 0; updateOrientation(); return azimuth; } @Override public float getPitch () { if (!compassAvailable && !rotationVectorAvailable) return 0; updateOrientation(); return pitch; } @Override public float getRoll () { if (!compassAvailable && !rotationVectorAvailable) return 0; updateOrientation(); return roll; } void registerSensorListeners () { if (config.useAccelerometer) { manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); if (manager.getSensorList(Sensor.TYPE_ACCELEROMETER).isEmpty()) { accelerometerAvailable = false; } else { Sensor accelerometer = manager.getSensorList(Sensor.TYPE_ACCELEROMETER).get(0); accelerometerListener = new SensorListener(); accelerometerAvailable = manager.registerListener(accelerometerListener, accelerometer, config.sensorDelay); } } else accelerometerAvailable = false; if (config.useGyroscope) { manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); if (manager.getSensorList(Sensor.TYPE_GYROSCOPE).isEmpty()) { gyroscopeAvailable = false; } else { Sensor gyroscope = manager.getSensorList(Sensor.TYPE_GYROSCOPE).get(0); gyroscopeListener = new SensorListener(); gyroscopeAvailable = manager.registerListener(gyroscopeListener, gyroscope, config.sensorDelay); } } else gyroscopeAvailable = false; rotationVectorAvailable = false; if (config.useRotationVectorSensor) { if (manager == null) manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); List<Sensor> rotationVectorSensors = manager.getSensorList(Sensor.TYPE_ROTATION_VECTOR); if (!rotationVectorSensors.isEmpty()) { rotationVectorListener = new SensorListener(); for (Sensor sensor : rotationVectorSensors) { // favor AOSP sensor if (sensor.getVendor().equals("Google Inc.") && sensor.getVersion() == 3) { rotationVectorAvailable = manager.registerListener(rotationVectorListener, sensor, config.sensorDelay); break; } } if (!rotationVectorAvailable) rotationVectorAvailable = manager.registerListener(rotationVectorListener, rotationVectorSensors.get(0), config.sensorDelay); } } if (config.useCompass && !rotationVectorAvailable) { if (manager == null) manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); Sensor sensor = manager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); if (sensor != null) { compassAvailable = accelerometerAvailable; if (compassAvailable) { compassListener = new SensorListener(); compassAvailable = manager.registerListener(compassListener, sensor, config.sensorDelay); } } else { compassAvailable = false; } } else compassAvailable = false; Gdx.app.log("AndroidInput", "sensor listener setup"); } void unregisterSensorListeners () { if (manager != null) { if (accelerometerListener != null) { manager.unregisterListener(accelerometerListener); accelerometerListener = null; } if (gyroscopeListener != null) { manager.unregisterListener(gyroscopeListener); gyroscopeListener = null; } if (rotationVectorListener != null) { manager.unregisterListener(rotationVectorListener); rotationVectorListener = null; } if (compassListener != null) { manager.unregisterListener(compassListener); compassListener = null; } manager = null; } Gdx.app.log("AndroidInput", "sensor listener tear down"); } @Override public InputProcessor getInputProcessor () { return this.processor; } @Override public boolean isPeripheralAvailable (Peripheral peripheral) { if (peripheral == Peripheral.Accelerometer) return accelerometerAvailable; if (peripheral == Peripheral.Gyroscope) return gyroscopeAvailable; if (peripheral == Peripheral.Compass) return compassAvailable; if (peripheral == Peripheral.HardwareKeyboard) return keyboardAvailable; if (peripheral == Peripheral.OnscreenKeyboard) return true; if (peripheral == Peripheral.Vibrator) return haptics.hasVibratorAvailable(); if (peripheral == Peripheral.HapticFeedback) return haptics.hasHapticsSupport(); if (peripheral == Peripheral.MultitouchScreen) return hasMultitouch; if (peripheral == Peripheral.RotationVector) return rotationVectorAvailable; if (peripheral == Peripheral.Pressure) return true; return false; } public int getFreePointerIndex () { int len = realId.length; for (int i = 0; i < len; i++) { if (realId[i] == -1) return i; } pressure = resize(pressure); realId = resize(realId); touchX = resize(touchX); touchY = resize(touchY); deltaX = resize(deltaX); deltaY = resize(deltaY); touched = resize(touched); button = resize(button); return len; } private int[] resize (int[] orig) { int[] tmp = new int[orig.length + 2]; System.arraycopy(orig, 0, tmp, 0, orig.length); return tmp; } private boolean[] resize (boolean[] orig) { boolean[] tmp = new boolean[orig.length + 2]; System.arraycopy(orig, 0, tmp, 0, orig.length); return tmp; } private float[] resize (float[] orig) { float[] tmp = new float[orig.length + 2]; System.arraycopy(orig, 0, tmp, 0, orig.length); return tmp; } public int lookUpPointerIndex (int pointerId) { int len = realId.length; for (int i = 0; i < len; i++) { if (realId[i] == pointerId) return i; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i++) { sb.append(i + ":" + realId[i] + " "); } Gdx.app.log("AndroidInput", "Pointer ID lookup failed: " + pointerId + ", " + sb.toString()); return -1; } @Override public int getRotation () { int orientation = 0; if (context instanceof Activity) { orientation = ((Activity)context).getWindowManager().getDefaultDisplay().getRotation(); } else { orientation = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation(); } switch (orientation) { case Surface.ROTATION_0: return 0; case Surface.ROTATION_90: return 90; case Surface.ROTATION_180: return 180; case Surface.ROTATION_270: return 270; default: return 0; } } @Override public Orientation getNativeOrientation () { return nativeOrientation; } @Override public void setCursorCatched (boolean catched) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { View view = ((AndroidGraphics)app.getGraphics()).getView(); if (catched) { view.requestPointerCapture(); view.setOnCapturedPointerListener(new View.OnCapturedPointerListener() { @Override public boolean onCapturedPointer (View view, MotionEvent motionEvent) { deltaX[0] = (int)motionEvent.getX(); deltaY[0] = (int)motionEvent.getY(); return false; } }); } else { view.releasePointerCapture(); } } } @Override public boolean isCursorCatched () { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { View view = ((AndroidGraphics)app.getGraphics()).getView(); return view.hasPointerCapture(); } return false; } @Override public int getDeltaX () { return deltaX[0]; } @Override public int getDeltaX (int pointer) { return deltaX[pointer]; } @Override public int getDeltaY () { return deltaY[0]; } @Override public int getDeltaY (int pointer) { return deltaY[pointer]; } @Override public void setCursorPosition (int x, int y) { } @Override public long getCurrentEventTime () { return currentEventTimeStamp; } @Override public void addKeyListener (OnKeyListener listener) { keyListeners.add(listener); } @Override public boolean onGenericMotion (View view, MotionEvent event) { if (mouseHandler.onGenericMotion(event, this)) return true; for (int i = 0, n = genericMotionListeners.size(); i < n; i++) if (genericMotionListeners.get(i).onGenericMotion(view, event)) return true; return false; } @Override public void addGenericMotionListener (OnGenericMotionListener listener) { genericMotionListeners.add(listener); } @Override public void onPause () { unregisterSensorListeners(); } @Override public void onResume () { registerSensorListeners(); } @Override public void onDreamingStarted () { registerSensorListeners(); } @Override public void onDreamingStopped () { unregisterSensorListeners(); // erase pointer ids. this sucks donkeyballs... Arrays.fill(realId, -1); // erase touched state. this also sucks donkeyballs... Arrays.fill(touched, false); } /** Our implementation of SensorEventListener. Because Android doesn't like it when we register more than one Sensor to a * single SensorEventListener, we add one of these for each Sensor. Could use an anonymous class, but I don't see any harm in * explicitly defining it here. Correct me if I am wrong. */ private class SensorListener implements SensorEventListener { public SensorListener () { } @Override public void onAccuracyChanged (Sensor arg0, int arg1) { } @Override public void onSensorChanged (SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { if (nativeOrientation == Orientation.Portrait) { System.arraycopy(event.values, 0, accelerometerValues, 0, accelerometerValues.length); } else { accelerometerValues[0] = event.values[1]; accelerometerValues[1] = -event.values[0]; accelerometerValues[2] = event.values[2]; } } if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { System.arraycopy(event.values, 0, magneticFieldValues, 0, magneticFieldValues.length); } if (event.sensor.getType() == Sensor.TYPE_GYROSCOPE) { if (nativeOrientation == Orientation.Portrait) { System.arraycopy(event.values, 0, gyroscopeValues, 0, gyroscopeValues.length); } else { gyroscopeValues[0] = event.values[1]; gyroscopeValues[1] = -event.values[0]; gyroscopeValues[2] = event.values[2]; } } if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) { if (nativeOrientation == Orientation.Portrait) { System.arraycopy(event.values, 0, rotationVectorValues, 0, rotationVectorValues.length); } else { rotationVectorValues[0] = event.values[1]; rotationVectorValues[1] = -event.values[0]; rotationVectorValues[2] = event.values[2]; } } } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.backends.android; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Handler; import android.text.InputType; import android.text.method.PasswordTransformationMethod; import android.view.MotionEvent; import android.view.Surface; import android.view.View; import android.view.View.OnGenericMotionListener; import android.view.View.OnKeyListener; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import com.badlogic.gdx.AbstractInput; import com.badlogic.gdx.Application; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Graphics.DisplayMode; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.backends.android.surfaceview.GLSurfaceView20; import com.badlogic.gdx.utils.Pool; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** An implementation of the {@link Input} interface for Android. * * @author mzechner */ /** @author jshapcot */ public class DefaultAndroidInput extends AbstractInput implements AndroidInput { static class KeyEvent { static final int KEY_DOWN = 0; static final int KEY_UP = 1; static final int KEY_TYPED = 2; long timeStamp; int type; int keyCode; char keyChar; } static class TouchEvent { static final int TOUCH_DOWN = 0; static final int TOUCH_UP = 1; static final int TOUCH_DRAGGED = 2; static final int TOUCH_SCROLLED = 3; static final int TOUCH_MOVED = 4; static final int TOUCH_CANCELLED = 5; long timeStamp; int type; int x; int y; int scrollAmountX; int scrollAmountY; int button; int pointer; } Pool<KeyEvent> usedKeyEvents = new Pool<KeyEvent>(16, 1000) { protected KeyEvent newObject () { return new KeyEvent(); } }; Pool<TouchEvent> usedTouchEvents = new Pool<TouchEvent>(16, 1000) { protected TouchEvent newObject () { return new TouchEvent(); } }; public static final int NUM_TOUCHES = 20; ArrayList<OnKeyListener> keyListeners = new ArrayList(); ArrayList<KeyEvent> keyEvents = new ArrayList(); ArrayList<TouchEvent> touchEvents = new ArrayList(); int[] touchX = new int[NUM_TOUCHES]; int[] touchY = new int[NUM_TOUCHES]; int[] deltaX = new int[NUM_TOUCHES]; int[] deltaY = new int[NUM_TOUCHES]; boolean[] touched = new boolean[NUM_TOUCHES]; int[] button = new int[NUM_TOUCHES]; int[] realId = new int[NUM_TOUCHES]; float[] pressure = new float[NUM_TOUCHES]; final boolean hasMultitouch; private boolean[] justPressedButtons = new boolean[NUM_TOUCHES]; private SensorManager manager; public boolean accelerometerAvailable = false; protected final float[] accelerometerValues = new float[3]; public boolean gyroscopeAvailable = false; protected final float[] gyroscopeValues = new float[3]; private Handler handle; final Application app; final Context context; protected final AndroidTouchHandler touchHandler; private int sleepTime = 0; protected final AndroidHaptics haptics; private boolean compassAvailable = false; private boolean rotationVectorAvailable = false; boolean keyboardAvailable; protected final float[] magneticFieldValues = new float[3]; protected final float[] rotationVectorValues = new float[3]; private float azimuth = 0; private float pitch = 0; private float roll = 0; private boolean justTouched = false; private InputProcessor processor; private final AndroidApplicationConfiguration config; protected final Orientation nativeOrientation; private long currentEventTimeStamp = 0; private SensorEventListener accelerometerListener; private SensorEventListener gyroscopeListener; private SensorEventListener compassListener; private SensorEventListener rotationVectorListener; private final ArrayList<OnGenericMotionListener> genericMotionListeners = new ArrayList(); private final AndroidMouseHandler mouseHandler; public DefaultAndroidInput (Application activity, Context context, Object view, AndroidApplicationConfiguration config) { // we hook into View, for LWPs we call onTouch below directly from // within the AndroidLivewallpaperEngine#onTouchEvent() method. if (view instanceof View) { View v = (View)view; v.setOnKeyListener(this); v.setOnTouchListener(this); v.setFocusable(true); v.setFocusableInTouchMode(true); v.requestFocus(); v.setOnGenericMotionListener(this); } this.config = config; this.mouseHandler = new AndroidMouseHandler(); for (int i = 0; i < realId.length; i++) realId[i] = -1; handle = new Handler(); this.app = activity; this.context = context; this.sleepTime = config.touchSleepTime; touchHandler = new AndroidTouchHandler(); hasMultitouch = touchHandler.supportsMultitouch(context); haptics = new AndroidHaptics(context); int rotation = getRotation(); DisplayMode mode = app.getGraphics().getDisplayMode(); if (((rotation == 0 || rotation == 180) && (mode.width >= mode.height)) || ((rotation == 90 || rotation == 270) && (mode.width <= mode.height))) { nativeOrientation = Orientation.Landscape; } else { nativeOrientation = Orientation.Portrait; } // this is for backward compatibility: libGDX always caught the circle button, original comment: // circle button on Xperia Play shouldn't need catchBack == true setCatchKey(Keys.BUTTON_CIRCLE, true); } @Override public float getAccelerometerX () { return accelerometerValues[0]; } @Override public float getAccelerometerY () { return accelerometerValues[1]; } @Override public float getAccelerometerZ () { return accelerometerValues[2]; } @Override public float getGyroscopeX () { return gyroscopeValues[0]; } @Override public float getGyroscopeY () { return gyroscopeValues[1]; } @Override public float getGyroscopeZ () { return gyroscopeValues[2]; } @Override public void getTextInput (TextInputListener listener, String title, String text, String hint) { getTextInput(listener, title, text, hint, OnscreenKeyboardType.Default); } @Override public void getTextInput (final TextInputListener listener, final String title, final String text, final String hint, final OnscreenKeyboardType keyboardType) { handle.post(new Runnable() { public void run () { AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.setTitle(title); final EditText input = new EditText(context); if (keyboardType != OnscreenKeyboardType.Default) { input.setInputType(getAndroidInputType(keyboardType)); } input.setHint(hint); input.setText(text); input.setSingleLine(); if (keyboardType == OnscreenKeyboardType.Password) { input.setTransformationMethod(new PasswordTransformationMethod()); } alert.setView(input); alert.setPositiveButton(context.getString(android.R.string.ok), new DialogInterface.OnClickListener() { public void onClick (DialogInterface dialog, int whichButton) { Gdx.app.postRunnable(new Runnable() { @Override public void run () { listener.input(input.getText().toString()); } }); } }); alert.setNegativeButton(context.getString(android.R.string.cancel), new DialogInterface.OnClickListener() { public void onClick (DialogInterface dialog, int whichButton) { Gdx.app.postRunnable(new Runnable() { @Override public void run () { listener.canceled(); } }); } }); alert.setOnCancelListener(new OnCancelListener() { @Override public void onCancel (DialogInterface arg0) { Gdx.app.postRunnable(new Runnable() { @Override public void run () { listener.canceled(); } }); } }); alert.show(); } }); } public static int getAndroidInputType (OnscreenKeyboardType type) { int inputType; switch (type) { case NumberPad: inputType = InputType.TYPE_CLASS_NUMBER; break; case PhonePad: inputType = InputType.TYPE_CLASS_PHONE; break; case Email: inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; break; case Password: inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD; break; case URI: inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI; break; default: inputType = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; break; } return inputType; } @Override public int getMaxPointers () { return NUM_TOUCHES; } @Override public int getX () { synchronized (this) { return touchX[0]; } } @Override public int getY () { synchronized (this) { return touchY[0]; } } @Override public int getX (int pointer) { synchronized (this) { return touchX[pointer]; } } @Override public int getY (int pointer) { synchronized (this) { return touchY[pointer]; } } public boolean isTouched (int pointer) { synchronized (this) { return touched[pointer]; } } @Override public float getPressure () { return getPressure(0); } @Override public float getPressure (int pointer) { return pressure[pointer]; } @Override public void setKeyboardAvailable (boolean available) { this.keyboardAvailable = available; } @Override public boolean isTouched () { synchronized (this) { if (hasMultitouch) { for (int pointer = 0; pointer < NUM_TOUCHES; pointer++) { if (touched[pointer]) { return true; } } } return touched[0]; } } public void setInputProcessor (InputProcessor processor) { synchronized (this) { this.processor = processor; } } @Override public void processEvents () { synchronized (this) { if (justTouched) { justTouched = false; for (int i = 0; i < justPressedButtons.length; i++) { justPressedButtons[i] = false; } } if (keyJustPressed) { keyJustPressed = false; for (int i = 0; i < justPressedKeys.length; i++) { justPressedKeys[i] = false; } } if (processor != null) { final InputProcessor processor = this.processor; int len = keyEvents.size(); for (int i = 0; i < len; i++) { KeyEvent e = keyEvents.get(i); currentEventTimeStamp = e.timeStamp; switch (e.type) { case KeyEvent.KEY_DOWN: processor.keyDown(e.keyCode); keyJustPressed = true; justPressedKeys[e.keyCode] = true; break; case KeyEvent.KEY_UP: processor.keyUp(e.keyCode); break; case KeyEvent.KEY_TYPED: processor.keyTyped(e.keyChar); } usedKeyEvents.free(e); } len = touchEvents.size(); for (int i = 0; i < len; i++) { TouchEvent e = touchEvents.get(i); currentEventTimeStamp = e.timeStamp; switch (e.type) { case TouchEvent.TOUCH_DOWN: processor.touchDown(e.x, e.y, e.pointer, e.button); justTouched = true; justPressedButtons[e.button] = true; break; case TouchEvent.TOUCH_UP: processor.touchUp(e.x, e.y, e.pointer, e.button); break; case TouchEvent.TOUCH_DRAGGED: processor.touchDragged(e.x, e.y, e.pointer); break; case TouchEvent.TOUCH_CANCELLED: processor.touchCancelled(e.x, e.y, e.pointer, e.button); break; case TouchEvent.TOUCH_MOVED: processor.mouseMoved(e.x, e.y); break; case TouchEvent.TOUCH_SCROLLED: processor.scrolled(e.scrollAmountX, e.scrollAmountY); } usedTouchEvents.free(e); } } else { int len = touchEvents.size(); for (int i = 0; i < len; i++) { TouchEvent e = touchEvents.get(i); if (e.type == TouchEvent.TOUCH_DOWN) justTouched = true; usedTouchEvents.free(e); } len = keyEvents.size(); for (int i = 0; i < len; i++) { usedKeyEvents.free(keyEvents.get(i)); } } if (touchEvents.isEmpty()) { for (int i = 0; i < deltaX.length; i++) { deltaX[0] = 0; deltaY[0] = 0; } } keyEvents.clear(); touchEvents.clear(); } } boolean requestFocus = true; @Override public boolean onTouch (View view, MotionEvent event) { if (requestFocus && view != null) { view.setFocusableInTouchMode(true); view.requestFocus(); requestFocus = false; } // synchronized in handler.postTouchEvent() touchHandler.onTouch(event, this); if (sleepTime != 0) { try { Thread.sleep(sleepTime); } catch (InterruptedException e) { } } return true; } // TODO Seems unused. Delete when confirmed. // /** Called in {@link AndroidLiveWallpaperService} on tap // * @param x // * @param y */ // public void onTap (int x, int y) { // postTap(x, y); // } // // /** Called in {@link AndroidLiveWallpaperService} on drop // * @param x // * @param y */ // public void onDrop (int x, int y) { // postTap(x, y); // } // // protected void postTap (int x, int y) { // synchronized (this) { // TouchEvent event = usedTouchEvents.obtain(); // event.timeStamp = System.nanoTime(); // event.pointer = 0; // event.x = x; // event.y = y; // event.type = TouchEvent.TOUCH_DOWN; // touchEvents.add(event); // // event = usedTouchEvents.obtain(); // event.timeStamp = System.nanoTime(); // event.pointer = 0; // event.x = x; // event.y = y; // event.type = TouchEvent.TOUCH_UP; // touchEvents.add(event); // } // Gdx.app.getGraphics().requestRendering(); // } @Override public boolean onKey (View v, int keyCode, android.view.KeyEvent e) { for (int i = 0, n = keyListeners.size(); i < n; i++) if (keyListeners.get(i).onKey(v, keyCode, e)) return true; // If the key is held sufficiently long that it repeats, then the initial down is followed // additional key events with ACTION_DOWN and a non-zero value for getRepeatCount(). // We are only interested in the first key down event here and must ignore all others if (e.getAction() == android.view.KeyEvent.ACTION_DOWN && e.getRepeatCount() > 0) return isCatchKey(keyCode); synchronized (this) { KeyEvent event = null; if (e.getKeyCode() == android.view.KeyEvent.KEYCODE_UNKNOWN && e.getAction() == android.view.KeyEvent.ACTION_MULTIPLE) { String chars = e.getCharacters(); for (int i = 0; i < chars.length(); i++) { event = usedKeyEvents.obtain(); event.timeStamp = System.nanoTime(); event.keyCode = 0; event.keyChar = chars.charAt(i); event.type = KeyEvent.KEY_TYPED; keyEvents.add(event); } return false; } char character = (char)e.getUnicodeChar(); // Android doesn't report a unicode char for back space. hrm... if (keyCode == 67) character = '\b'; if (e.getKeyCode() < 0 || e.getKeyCode() > Keys.MAX_KEYCODE) { return false; } switch (e.getAction()) { case android.view.KeyEvent.ACTION_DOWN: event = usedKeyEvents.obtain(); event.timeStamp = System.nanoTime(); event.keyChar = 0; event.keyCode = e.getKeyCode(); event.type = KeyEvent.KEY_DOWN; // Xperia hack for circle key. gah... if (keyCode == android.view.KeyEvent.KEYCODE_BACK && e.isAltPressed()) { keyCode = Keys.BUTTON_CIRCLE; event.keyCode = keyCode; } keyEvents.add(event); if (!pressedKeys[event.keyCode]) { pressedKeyCount++; pressedKeys[event.keyCode] = true; } break; case android.view.KeyEvent.ACTION_UP: long timeStamp = System.nanoTime(); event = usedKeyEvents.obtain(); event.timeStamp = timeStamp; event.keyChar = 0; event.keyCode = e.getKeyCode(); event.type = KeyEvent.KEY_UP; // Xperia hack for circle key. gah... if (keyCode == android.view.KeyEvent.KEYCODE_BACK && e.isAltPressed()) { keyCode = Keys.BUTTON_CIRCLE; event.keyCode = keyCode; } keyEvents.add(event); event = usedKeyEvents.obtain(); event.timeStamp = timeStamp; event.keyChar = character; event.keyCode = 0; event.type = KeyEvent.KEY_TYPED; keyEvents.add(event); if (keyCode == Keys.BUTTON_CIRCLE) { if (pressedKeys[Keys.BUTTON_CIRCLE]) { pressedKeyCount--; pressedKeys[Keys.BUTTON_CIRCLE] = false; } } else { if (pressedKeys[e.getKeyCode()]) { pressedKeyCount--; pressedKeys[e.getKeyCode()] = false; } } } app.getGraphics().requestRendering(); } return isCatchKey(keyCode); } @Override public void setOnscreenKeyboardVisible (final boolean visible) { setOnscreenKeyboardVisible(visible, OnscreenKeyboardType.Default); } @Override public void setOnscreenKeyboardVisible (final boolean visible, final OnscreenKeyboardType type) { handle.post(new Runnable() { public void run () { InputMethodManager manager = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); if (visible) { View view = ((AndroidGraphics)app.getGraphics()).getView(); OnscreenKeyboardType tmp = type == null ? OnscreenKeyboardType.Default : type; if (((GLSurfaceView20)view).onscreenKeyboardType != tmp) { ((GLSurfaceView20)view).onscreenKeyboardType = tmp; manager.restartInput(view); } view.setFocusable(true); view.setFocusableInTouchMode(true); manager.showSoftInput(((AndroidGraphics)app.getGraphics()).getView(), 0); } else { manager.hideSoftInputFromWindow(((AndroidGraphics)app.getGraphics()).getView().getWindowToken(), 0); } } }); } @Override public void vibrate (int milliseconds) { haptics.vibrate(milliseconds); } @Override public void vibrate (int milliseconds, boolean fallback) { haptics.vibrate(milliseconds); } @Override public void vibrate (int milliseconds, int amplitude, boolean fallback) { haptics.vibrate(milliseconds, amplitude, fallback); } @Override public void vibrate (VibrationType vibrationType) { haptics.vibrate(vibrationType); } @Override public boolean justTouched () { return justTouched; } @Override public boolean isButtonPressed (int button) { synchronized (this) { if (hasMultitouch) { for (int pointer = 0; pointer < NUM_TOUCHES; pointer++) { if (touched[pointer] && (this.button[pointer] == button)) { return true; } } } return (touched[0] && (this.button[0] == button)); } } @Override public boolean isButtonJustPressed (int button) { if (button < 0 || button > NUM_TOUCHES) return false; return justPressedButtons[button]; } final float[] R = new float[9]; final float[] orientation = new float[3]; private void updateOrientation () { if (rotationVectorAvailable) { SensorManager.getRotationMatrixFromVector(R, rotationVectorValues); } else if (!SensorManager.getRotationMatrix(R, null, accelerometerValues, magneticFieldValues)) { return; // compass + accelerometer in free fall } SensorManager.getOrientation(R, orientation); azimuth = (float)Math.toDegrees(orientation[0]); pitch = (float)Math.toDegrees(orientation[1]); roll = (float)Math.toDegrees(orientation[2]); } /** Returns the rotation matrix describing the devices rotation as per * <a href= "http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], * float[], float[])" >SensorManager#getRotationMatrix(float[], float[], float[], float[])</a>. Does not manipulate the matrix * if the platform does not have an accelerometer and compass, or a rotation vector sensor. * @param matrix */ public void getRotationMatrix (float[] matrix) { if (rotationVectorAvailable) SensorManager.getRotationMatrixFromVector(matrix, rotationVectorValues); else // compass + accelerometer SensorManager.getRotationMatrix(matrix, null, accelerometerValues, magneticFieldValues); } @Override public float getAzimuth () { if (!compassAvailable && !rotationVectorAvailable) return 0; updateOrientation(); return azimuth; } @Override public float getPitch () { if (!compassAvailable && !rotationVectorAvailable) return 0; updateOrientation(); return pitch; } @Override public float getRoll () { if (!compassAvailable && !rotationVectorAvailable) return 0; updateOrientation(); return roll; } void registerSensorListeners () { if (config.useAccelerometer) { manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); if (manager.getSensorList(Sensor.TYPE_ACCELEROMETER).isEmpty()) { accelerometerAvailable = false; } else { Sensor accelerometer = manager.getSensorList(Sensor.TYPE_ACCELEROMETER).get(0); accelerometerListener = new SensorListener(); accelerometerAvailable = manager.registerListener(accelerometerListener, accelerometer, config.sensorDelay); } } else accelerometerAvailable = false; if (config.useGyroscope) { manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); if (manager.getSensorList(Sensor.TYPE_GYROSCOPE).isEmpty()) { gyroscopeAvailable = false; } else { Sensor gyroscope = manager.getSensorList(Sensor.TYPE_GYROSCOPE).get(0); gyroscopeListener = new SensorListener(); gyroscopeAvailable = manager.registerListener(gyroscopeListener, gyroscope, config.sensorDelay); } } else gyroscopeAvailable = false; rotationVectorAvailable = false; if (config.useRotationVectorSensor) { if (manager == null) manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); List<Sensor> rotationVectorSensors = manager.getSensorList(Sensor.TYPE_ROTATION_VECTOR); if (!rotationVectorSensors.isEmpty()) { rotationVectorListener = new SensorListener(); for (Sensor sensor : rotationVectorSensors) { // favor AOSP sensor if (sensor.getVendor().equals("Google Inc.") && sensor.getVersion() == 3) { rotationVectorAvailable = manager.registerListener(rotationVectorListener, sensor, config.sensorDelay); break; } } if (!rotationVectorAvailable) rotationVectorAvailable = manager.registerListener(rotationVectorListener, rotationVectorSensors.get(0), config.sensorDelay); } } if (config.useCompass && !rotationVectorAvailable) { if (manager == null) manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); Sensor sensor = manager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); if (sensor != null) { compassAvailable = accelerometerAvailable; if (compassAvailable) { compassListener = new SensorListener(); compassAvailable = manager.registerListener(compassListener, sensor, config.sensorDelay); } } else { compassAvailable = false; } } else compassAvailable = false; Gdx.app.log("AndroidInput", "sensor listener setup"); } void unregisterSensorListeners () { if (manager != null) { if (accelerometerListener != null) { manager.unregisterListener(accelerometerListener); accelerometerListener = null; } if (gyroscopeListener != null) { manager.unregisterListener(gyroscopeListener); gyroscopeListener = null; } if (rotationVectorListener != null) { manager.unregisterListener(rotationVectorListener); rotationVectorListener = null; } if (compassListener != null) { manager.unregisterListener(compassListener); compassListener = null; } manager = null; } Gdx.app.log("AndroidInput", "sensor listener tear down"); } @Override public InputProcessor getInputProcessor () { return this.processor; } @Override public boolean isPeripheralAvailable (Peripheral peripheral) { if (peripheral == Peripheral.Accelerometer) return accelerometerAvailable; if (peripheral == Peripheral.Gyroscope) return gyroscopeAvailable; if (peripheral == Peripheral.Compass) return compassAvailable; if (peripheral == Peripheral.HardwareKeyboard) return keyboardAvailable; if (peripheral == Peripheral.OnscreenKeyboard) return true; if (peripheral == Peripheral.Vibrator) return haptics.hasVibratorAvailable(); if (peripheral == Peripheral.HapticFeedback) return haptics.hasHapticsSupport(); if (peripheral == Peripheral.MultitouchScreen) return hasMultitouch; if (peripheral == Peripheral.RotationVector) return rotationVectorAvailable; if (peripheral == Peripheral.Pressure) return true; return false; } public int getFreePointerIndex () { int len = realId.length; for (int i = 0; i < len; i++) { if (realId[i] == -1) return i; } pressure = resize(pressure); realId = resize(realId); touchX = resize(touchX); touchY = resize(touchY); deltaX = resize(deltaX); deltaY = resize(deltaY); touched = resize(touched); button = resize(button); return len; } private int[] resize (int[] orig) { int[] tmp = new int[orig.length + 2]; System.arraycopy(orig, 0, tmp, 0, orig.length); return tmp; } private boolean[] resize (boolean[] orig) { boolean[] tmp = new boolean[orig.length + 2]; System.arraycopy(orig, 0, tmp, 0, orig.length); return tmp; } private float[] resize (float[] orig) { float[] tmp = new float[orig.length + 2]; System.arraycopy(orig, 0, tmp, 0, orig.length); return tmp; } public int lookUpPointerIndex (int pointerId) { int len = realId.length; for (int i = 0; i < len; i++) { if (realId[i] == pointerId) return i; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i++) { sb.append(i + ":" + realId[i] + " "); } Gdx.app.log("AndroidInput", "Pointer ID lookup failed: " + pointerId + ", " + sb.toString()); return -1; } @Override public int getRotation () { int orientation = 0; if (context instanceof Activity) { orientation = ((Activity)context).getWindowManager().getDefaultDisplay().getRotation(); } else { orientation = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation(); } switch (orientation) { case Surface.ROTATION_0: return 0; case Surface.ROTATION_90: return 90; case Surface.ROTATION_180: return 180; case Surface.ROTATION_270: return 270; default: return 0; } } @Override public Orientation getNativeOrientation () { return nativeOrientation; } @Override public void setCursorCatched (boolean catched) { } @Override public boolean isCursorCatched () { return false; } @Override public int getDeltaX () { return deltaX[0]; } @Override public int getDeltaX (int pointer) { return deltaX[pointer]; } @Override public int getDeltaY () { return deltaY[0]; } @Override public int getDeltaY (int pointer) { return deltaY[pointer]; } @Override public void setCursorPosition (int x, int y) { } @Override public long getCurrentEventTime () { return currentEventTimeStamp; } @Override public void addKeyListener (OnKeyListener listener) { keyListeners.add(listener); } @Override public boolean onGenericMotion (View view, MotionEvent event) { if (mouseHandler.onGenericMotion(event, this)) return true; for (int i = 0, n = genericMotionListeners.size(); i < n; i++) if (genericMotionListeners.get(i).onGenericMotion(view, event)) return true; return false; } @Override public void addGenericMotionListener (OnGenericMotionListener listener) { genericMotionListeners.add(listener); } @Override public void onPause () { unregisterSensorListeners(); } @Override public void onResume () { registerSensorListeners(); } @Override public void onDreamingStarted () { registerSensorListeners(); } @Override public void onDreamingStopped () { unregisterSensorListeners(); // erase pointer ids. this sucks donkeyballs... Arrays.fill(realId, -1); // erase touched state. this also sucks donkeyballs... Arrays.fill(touched, false); } /** Our implementation of SensorEventListener. Because Android doesn't like it when we register more than one Sensor to a * single SensorEventListener, we add one of these for each Sensor. Could use an anonymous class, but I don't see any harm in * explicitly defining it here. Correct me if I am wrong. */ private class SensorListener implements SensorEventListener { public SensorListener () { } @Override public void onAccuracyChanged (Sensor arg0, int arg1) { } @Override public void onSensorChanged (SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { if (nativeOrientation == Orientation.Portrait) { System.arraycopy(event.values, 0, accelerometerValues, 0, accelerometerValues.length); } else { accelerometerValues[0] = event.values[1]; accelerometerValues[1] = -event.values[0]; accelerometerValues[2] = event.values[2]; } } if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { System.arraycopy(event.values, 0, magneticFieldValues, 0, magneticFieldValues.length); } if (event.sensor.getType() == Sensor.TYPE_GYROSCOPE) { if (nativeOrientation == Orientation.Portrait) { System.arraycopy(event.values, 0, gyroscopeValues, 0, gyroscopeValues.length); } else { gyroscopeValues[0] = event.values[1]; gyroscopeValues[1] = -event.values[0]; gyroscopeValues[2] = event.values[2]; } } if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) { if (nativeOrientation == Orientation.Portrait) { System.arraycopy(event.values, 0, rotationVectorValues, 0, rotationVectorValues.length); } else { rotationVectorValues[0] = event.values[1]; rotationVectorValues[1] = -event.values[0]; rotationVectorValues[2] = event.values[2]; } } } } }
1
libgdx/libgdx
7,215
Revert #6821
obigu
2023-08-22T10:02:37Z
2023-08-25T03:27:36Z
c9ed23f0371f1ece2942ccff2086893f2c08e1c9
ed811688c42a3eeb32427e56b47988e7ac4a6539
Revert #6821.
./gdx/src/com/badlogic/gdx/Input.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx; import com.badlogic.gdx.utils.ObjectIntMap; /** * <p> * Interface to the input facilities. This allows polling the state of the keyboard, the touch screen and the accelerometer. On * some backends (desktop, gwt, etc) the touch screen is replaced by mouse input. The accelerometer is of course not available on * all backends. * </p> * * <p> * Instead of polling for events, one can process all input events with an {@link InputProcessor}. You can set the InputProcessor * via the {@link #setInputProcessor(InputProcessor)} method. It will be called before the {@link ApplicationListener#render()} * method in each frame. * </p> * * <p> * Keyboard keys are translated to the constants in {@link Keys} transparently on all systems. Do not use system specific key * constants. * </p> * * <p> * The class also offers methods to use (and test for the presence of) other input systems like vibration, compass, on-screen * keyboards, and cursor capture. Support for simple input dialogs is also provided. * </p> * * @author mzechner */ public interface Input { /** Callback interface for {@link Input#getTextInput(TextInputListener, String, String, String)} * * @author mzechner */ static public interface TextInputListener { public void input (String text); public void canceled (); } /** Mouse buttons. * @author mzechner */ static public class Buttons { public static final int LEFT = 0; public static final int RIGHT = 1; public static final int MIDDLE = 2; public static final int BACK = 3; public static final int FORWARD = 4; } /** Keys. * * @author mzechner */ static public class Keys { public static final int ANY_KEY = -1; public static final int NUM_0 = 7; public static final int NUM_1 = 8; public static final int NUM_2 = 9; public static final int NUM_3 = 10; public static final int NUM_4 = 11; public static final int NUM_5 = 12; public static final int NUM_6 = 13; public static final int NUM_7 = 14; public static final int NUM_8 = 15; public static final int NUM_9 = 16; public static final int A = 29; public static final int ALT_LEFT = 57; public static final int ALT_RIGHT = 58; public static final int APOSTROPHE = 75; public static final int AT = 77; public static final int B = 30; public static final int BACK = 4; public static final int BACKSLASH = 73; public static final int C = 31; public static final int CALL = 5; public static final int CAMERA = 27; public static final int CAPS_LOCK = 115; public static final int CLEAR = 28; public static final int COMMA = 55; public static final int D = 32; public static final int DEL = 67; public static final int BACKSPACE = 67; public static final int FORWARD_DEL = 112; public static final int DPAD_CENTER = 23; public static final int DPAD_DOWN = 20; public static final int DPAD_LEFT = 21; public static final int DPAD_RIGHT = 22; public static final int DPAD_UP = 19; public static final int CENTER = 23; public static final int DOWN = 20; public static final int LEFT = 21; public static final int RIGHT = 22; public static final int UP = 19; public static final int E = 33; public static final int ENDCALL = 6; public static final int ENTER = 66; public static final int ENVELOPE = 65; public static final int EQUALS = 70; public static final int EXPLORER = 64; public static final int F = 34; public static final int FOCUS = 80; public static final int G = 35; public static final int GRAVE = 68; public static final int H = 36; public static final int HEADSETHOOK = 79; public static final int HOME = 3; public static final int I = 37; public static final int J = 38; public static final int K = 39; public static final int L = 40; public static final int LEFT_BRACKET = 71; public static final int M = 41; public static final int MEDIA_FAST_FORWARD = 90; public static final int MEDIA_NEXT = 87; public static final int MEDIA_PLAY_PAUSE = 85; public static final int MEDIA_PREVIOUS = 88; public static final int MEDIA_REWIND = 89; public static final int MEDIA_STOP = 86; public static final int MENU = 82; public static final int MINUS = 69; public static final int MUTE = 91; public static final int N = 42; public static final int NOTIFICATION = 83; public static final int NUM = 78; public static final int O = 43; public static final int P = 44; public static final int PAUSE = 121; // aka break public static final int PERIOD = 56; public static final int PLUS = 81; public static final int POUND = 18; public static final int POWER = 26; public static final int PRINT_SCREEN = 120; // aka SYSRQ public static final int Q = 45; public static final int R = 46; public static final int RIGHT_BRACKET = 72; public static final int S = 47; public static final int SCROLL_LOCK = 116; public static final int SEARCH = 84; public static final int SEMICOLON = 74; public static final int SHIFT_LEFT = 59; public static final int SHIFT_RIGHT = 60; public static final int SLASH = 76; public static final int SOFT_LEFT = 1; public static final int SOFT_RIGHT = 2; public static final int SPACE = 62; public static final int STAR = 17; public static final int SYM = 63; public static final int T = 48; public static final int TAB = 61; public static final int U = 49; public static final int UNKNOWN = 0; public static final int V = 50; public static final int VOLUME_DOWN = 25; public static final int VOLUME_UP = 24; public static final int W = 51; public static final int X = 52; public static final int Y = 53; public static final int Z = 54; public static final int META_ALT_LEFT_ON = 16; public static final int META_ALT_ON = 2; public static final int META_ALT_RIGHT_ON = 32; public static final int META_SHIFT_LEFT_ON = 64; public static final int META_SHIFT_ON = 1; public static final int META_SHIFT_RIGHT_ON = 128; public static final int META_SYM_ON = 4; public static final int CONTROL_LEFT = 129; public static final int CONTROL_RIGHT = 130; public static final int ESCAPE = 111; public static final int END = 123; public static final int INSERT = 124; public static final int PAGE_UP = 92; public static final int PAGE_DOWN = 93; public static final int PICTSYMBOLS = 94; public static final int SWITCH_CHARSET = 95; public static final int BUTTON_CIRCLE = 255; public static final int BUTTON_A = 96; public static final int BUTTON_B = 97; public static final int BUTTON_C = 98; public static final int BUTTON_X = 99; public static final int BUTTON_Y = 100; public static final int BUTTON_Z = 101; public static final int BUTTON_L1 = 102; public static final int BUTTON_R1 = 103; public static final int BUTTON_L2 = 104; public static final int BUTTON_R2 = 105; public static final int BUTTON_THUMBL = 106; public static final int BUTTON_THUMBR = 107; public static final int BUTTON_START = 108; public static final int BUTTON_SELECT = 109; public static final int BUTTON_MODE = 110; public static final int NUMPAD_0 = 144; public static final int NUMPAD_1 = 145; public static final int NUMPAD_2 = 146; public static final int NUMPAD_3 = 147; public static final int NUMPAD_4 = 148; public static final int NUMPAD_5 = 149; public static final int NUMPAD_6 = 150; public static final int NUMPAD_7 = 151; public static final int NUMPAD_8 = 152; public static final int NUMPAD_9 = 153; public static final int NUMPAD_DIVIDE = 154; public static final int NUMPAD_MULTIPLY = 155; public static final int NUMPAD_SUBTRACT = 156; public static final int NUMPAD_ADD = 157; public static final int NUMPAD_DOT = 158; public static final int NUMPAD_COMMA = 159; public static final int NUMPAD_ENTER = 160; public static final int NUMPAD_EQUALS = 161; public static final int NUMPAD_LEFT_PAREN = 162; public static final int NUMPAD_RIGHT_PAREN = 163; public static final int NUM_LOCK = 143; // public static final int BACKTICK = 0; // public static final int TILDE = 0; // public static final int UNDERSCORE = 0; // public static final int DOT = 0; // public static final int BREAK = 0; // public static final int PIPE = 0; // public static final int EXCLAMATION = 0; // public static final int QUESTIONMARK = 0; // ` | VK_BACKTICK // ~ | VK_TILDE // : | VK_COLON // _ | VK_UNDERSCORE // . | VK_DOT // (break) | VK_BREAK // | | VK_PIPE // ! | VK_EXCLAMATION // ? | VK_QUESTION public static final int COLON = 243; public static final int F1 = 131; public static final int F2 = 132; public static final int F3 = 133; public static final int F4 = 134; public static final int F5 = 135; public static final int F6 = 136; public static final int F7 = 137; public static final int F8 = 138; public static final int F9 = 139; public static final int F10 = 140; public static final int F11 = 141; public static final int F12 = 142; public static final int F13 = 183; public static final int F14 = 184; public static final int F15 = 185; public static final int F16 = 186; public static final int F17 = 187; public static final int F18 = 188; public static final int F19 = 189; public static final int F20 = 190; public static final int F21 = 191; public static final int F22 = 192; public static final int F23 = 193; public static final int F24 = 194; public static final int MAX_KEYCODE = 255; /** @return a human readable representation of the keycode. The returned value can be used in * {@link Input.Keys#valueOf(String)} */ public static String toString (int keycode) { if (keycode < 0) throw new IllegalArgumentException("keycode cannot be negative, keycode: " + keycode); if (keycode > MAX_KEYCODE) throw new IllegalArgumentException("keycode cannot be greater than 255, keycode: " + keycode); switch (keycode) { // META* variables should not be used with this method. case UNKNOWN: return "Unknown"; case SOFT_LEFT: return "Soft Left"; case SOFT_RIGHT: return "Soft Right"; case HOME: return "Home"; case BACK: return "Back"; case CALL: return "Call"; case ENDCALL: return "End Call"; case NUM_0: return "0"; case NUM_1: return "1"; case NUM_2: return "2"; case NUM_3: return "3"; case NUM_4: return "4"; case NUM_5: return "5"; case NUM_6: return "6"; case NUM_7: return "7"; case NUM_8: return "8"; case NUM_9: return "9"; case STAR: return "*"; case POUND: return "#"; case UP: return "Up"; case DOWN: return "Down"; case LEFT: return "Left"; case RIGHT: return "Right"; case CENTER: return "Center"; case VOLUME_UP: return "Volume Up"; case VOLUME_DOWN: return "Volume Down"; case POWER: return "Power"; case CAMERA: return "Camera"; case CLEAR: return "Clear"; case A: return "A"; case B: return "B"; case C: return "C"; case D: return "D"; case E: return "E"; case F: return "F"; case G: return "G"; case H: return "H"; case I: return "I"; case J: return "J"; case K: return "K"; case L: return "L"; case M: return "M"; case N: return "N"; case O: return "O"; case P: return "P"; case Q: return "Q"; case R: return "R"; case S: return "S"; case T: return "T"; case U: return "U"; case V: return "V"; case W: return "W"; case X: return "X"; case Y: return "Y"; case Z: return "Z"; case COMMA: return ","; case PERIOD: return "."; case ALT_LEFT: return "L-Alt"; case ALT_RIGHT: return "R-Alt"; case SHIFT_LEFT: return "L-Shift"; case SHIFT_RIGHT: return "R-Shift"; case TAB: return "Tab"; case SPACE: return "Space"; case SYM: return "SYM"; case EXPLORER: return "Explorer"; case ENVELOPE: return "Envelope"; case ENTER: return "Enter"; case DEL: return "Delete"; // also BACKSPACE case GRAVE: return "`"; case MINUS: return "-"; case EQUALS: return "="; case LEFT_BRACKET: return "["; case RIGHT_BRACKET: return "]"; case BACKSLASH: return "\\"; case SEMICOLON: return ";"; case APOSTROPHE: return "'"; case SLASH: return "/"; case AT: return "@"; case NUM: return "Num"; case HEADSETHOOK: return "Headset Hook"; case FOCUS: return "Focus"; case PLUS: return "Plus"; case MENU: return "Menu"; case NOTIFICATION: return "Notification"; case SEARCH: return "Search"; case MEDIA_PLAY_PAUSE: return "Play/Pause"; case MEDIA_STOP: return "Stop Media"; case MEDIA_NEXT: return "Next Media"; case MEDIA_PREVIOUS: return "Prev Media"; case MEDIA_REWIND: return "Rewind"; case MEDIA_FAST_FORWARD: return "Fast Forward"; case MUTE: return "Mute"; case PAGE_UP: return "Page Up"; case PAGE_DOWN: return "Page Down"; case PICTSYMBOLS: return "PICTSYMBOLS"; case SWITCH_CHARSET: return "SWITCH_CHARSET"; case BUTTON_A: return "A Button"; case BUTTON_B: return "B Button"; case BUTTON_C: return "C Button"; case BUTTON_X: return "X Button"; case BUTTON_Y: return "Y Button"; case BUTTON_Z: return "Z Button"; case BUTTON_L1: return "L1 Button"; case BUTTON_R1: return "R1 Button"; case BUTTON_L2: return "L2 Button"; case BUTTON_R2: return "R2 Button"; case BUTTON_THUMBL: return "Left Thumb"; case BUTTON_THUMBR: return "Right Thumb"; case BUTTON_START: return "Start"; case BUTTON_SELECT: return "Select"; case BUTTON_MODE: return "Button Mode"; case FORWARD_DEL: return "Forward Delete"; case CONTROL_LEFT: return "L-Ctrl"; case CONTROL_RIGHT: return "R-Ctrl"; case ESCAPE: return "Escape"; case END: return "End"; case INSERT: return "Insert"; case NUMPAD_0: return "Numpad 0"; case NUMPAD_1: return "Numpad 1"; case NUMPAD_2: return "Numpad 2"; case NUMPAD_3: return "Numpad 3"; case NUMPAD_4: return "Numpad 4"; case NUMPAD_5: return "Numpad 5"; case NUMPAD_6: return "Numpad 6"; case NUMPAD_7: return "Numpad 7"; case NUMPAD_8: return "Numpad 8"; case NUMPAD_9: return "Numpad 9"; case COLON: return ":"; case F1: return "F1"; case F2: return "F2"; case F3: return "F3"; case F4: return "F4"; case F5: return "F5"; case F6: return "F6"; case F7: return "F7"; case F8: return "F8"; case F9: return "F9"; case F10: return "F10"; case F11: return "F11"; case F12: return "F12"; case F13: return "F13"; case F14: return "F14"; case F15: return "F15"; case F16: return "F16"; case F17: return "F17"; case F18: return "F18"; case F19: return "F19"; case F20: return "F20"; case F21: return "F21"; case F22: return "F22"; case F23: return "F23"; case F24: return "F24"; case NUMPAD_DIVIDE: return "Num /"; case NUMPAD_MULTIPLY: return "Num *"; case NUMPAD_SUBTRACT: return "Num -"; case NUMPAD_ADD: return "Num +"; case NUMPAD_DOT: return "Num ."; case NUMPAD_COMMA: return "Num ,"; case NUMPAD_ENTER: return "Num Enter"; case NUMPAD_EQUALS: return "Num ="; case NUMPAD_LEFT_PAREN: return "Num ("; case NUMPAD_RIGHT_PAREN: return "Num )"; case NUM_LOCK: return "Num Lock"; case CAPS_LOCK: return "Caps Lock"; case SCROLL_LOCK: return "Scroll Lock"; case PAUSE: return "Pause"; case PRINT_SCREEN: return "Print"; // BUTTON_CIRCLE unhandled, as it conflicts with the more likely to be pressed F12 default: // key name not found return null; } } private static ObjectIntMap<String> keyNames; /** @param keyname the keyname returned by the {@link Keys#toString(int)} method * @return the int keycode */ public static int valueOf (String keyname) { if (keyNames == null) initializeKeyNames(); return keyNames.get(keyname, -1); } /** lazily intialized in {@link Keys#valueOf(String)} */ private static void initializeKeyNames () { keyNames = new ObjectIntMap<String>(); for (int i = 0; i < 256; i++) { String name = toString(i); if (name != null) keyNames.put(name, i); } } } /** Enumeration of potentially available peripherals. Use with {@link Input#isPeripheralAvailable(Peripheral)}. * @author mzechner */ public enum Peripheral { HardwareKeyboard, OnscreenKeyboard, MultitouchScreen, Accelerometer, Compass, Vibrator, HapticFeedback, Gyroscope, RotationVector, Pressure } /** @return The acceleration force in m/s^2 applied to the device in the X axis, including the force of gravity */ public float getAccelerometerX (); /** @return The acceleration force in m/s^2 applied to the device in the Y axis, including the force of gravity */ public float getAccelerometerY (); /** @return The acceleration force in m/s^2 applied to the device in the Z axis, including the force of gravity */ public float getAccelerometerZ (); /** @return The rate of rotation in rad/s around the X axis */ public float getGyroscopeX (); /** @return The rate of rotation in rad/s around the Y axis */ public float getGyroscopeY (); /** @return The rate of rotation in rad/s around the Z axis */ public float getGyroscopeZ (); /** @return The maximum number of pointers supported */ public int getMaxPointers (); /** @return The x coordinate of the last touch on touch screen devices and the current mouse position on desktop for the first * pointer in screen coordinates. The screen origin is the top left corner. */ public int getX (); /** Returns the x coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id * identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. * When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on * the touch screen the first free index will be used. * * @param pointer the pointer id. * @return the x coordinate */ public int getX (int pointer); /** @return the different between the current pointer location and the last pointer location on the x-axis. */ public int getDeltaX (); /** @return the different between the current pointer location and the last pointer location on the x-axis. */ public int getDeltaX (int pointer); /** @return The y coordinate of the last touch on touch screen devices and the current mouse position on desktop for the first * pointer in screen coordinates. The screen origin is the top left corner. */ public int getY (); /** Returns the y coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id * identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. * When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on * the touch screen the first free index will be used. * * @param pointer the pointer id. * @return the y coordinate */ public int getY (int pointer); /** @return the different between the current pointer location and the last pointer location on the y-axis. */ public int getDeltaY (); /** @return the different between the current pointer location and the last pointer location on the y-axis. */ public int getDeltaY (int pointer); /** @return whether the screen is currently touched. */ public boolean isTouched (); /** @return whether a new touch down event just occurred. */ public boolean justTouched (); /** Whether the screen is currently touched by the pointer with the given index. Pointers are indexed from 0 to n. The pointer * id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. * When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on * the touch screen the first free index will be used. * * @param pointer the pointer * @return whether the screen is touched by the pointer */ public boolean isTouched (int pointer); /** @return the pressure of the first pointer */ public float getPressure (); /** Returns the pressure of the given pointer, where 0 is untouched. On Android it should be up to 1.0, but it can go above * that slightly and its not consistent between devices. On iOS 1.0 is the normal touch and significantly more of hard touch. * Check relevant manufacturer documentation for details. Check availability with * {@link Input#isPeripheralAvailable(Peripheral)}. If not supported, returns 1.0 when touched. * * @param pointer the pointer id. * @return the pressure */ public float getPressure (int pointer); /** Whether a given button is pressed or not. Button constants can be found in {@link Buttons}. On Android only the * Buttons#LEFT constant is meaningful before version 4.0. * @param button the button to check. * @return whether the button is down or not. */ public boolean isButtonPressed (int button); /** Returns whether a given button has just been pressed. Button constants can be found in {@link Buttons}. On Android only the * Buttons#LEFT constant is meaningful before version 4.0. On WebGL (GWT), only LEFT, RIGHT and MIDDLE buttons are supported. * * @param button the button to check. * @return true or false. */ public boolean isButtonJustPressed (int button); /** Returns whether the key is pressed. * * @param key The key code as found in {@link Input.Keys}. * @return true or false. */ public boolean isKeyPressed (int key); /** Returns whether the key has just been pressed. * * @param key The key code as found in {@link Input.Keys}. * @return true or false. */ public boolean isKeyJustPressed (int key); /** System dependent method to input a string of text. A dialog box will be created with the given title and the given text as * a message for the user. Will use the Default keyboard type. Once the dialog has been closed the provided * {@link TextInputListener} will be called on the rendering thread. * * @param listener The TextInputListener. * @param title The title of the text input dialog. * @param text The message presented to the user. */ public void getTextInput (TextInputListener listener, String title, String text, String hint); /** System dependent method to input a string of text. A dialog box will be created with the given title and the given text as * a message for the user. Once the dialog has been closed the provided {@link TextInputListener} will be called on the * rendering thread. * * @param listener The TextInputListener. * @param title The title of the text input dialog. * @param text The message presented to the user. * @param type which type of keyboard we wish to display */ public void getTextInput (TextInputListener listener, String title, String text, String hint, OnscreenKeyboardType type); /** Sets the on-screen keyboard visible if available. Will use the Default keyboard type. * * @param visible visible or not */ public void setOnscreenKeyboardVisible (boolean visible); /** Sets the on-screen keyboard visible if available. * * @param visible visible or not * @param type which type of keyboard we wish to display. Can be null when hiding */ public void setOnscreenKeyboardVisible (boolean visible, OnscreenKeyboardType type); public enum OnscreenKeyboardType { Default, NumberPad, PhonePad, Email, Password, URI } /** Generates a simple haptic effect of a given duration or a vibration effect on devices without haptic capabilities. Note * that on Android backend you'll need the permission * <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your manifest file in order for this to work. * On iOS backend you'll need to set <code>useHaptics = true</code> for devices with haptics capabilities to use them. * * @param milliseconds the number of milliseconds to vibrate. */ public void vibrate (int milliseconds); /** Generates a simple haptic effect of a given duration and default amplitude. Note that on Android backend you'll need the * permission <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your manifest file in order for * this to work. On iOS backend you'll need to set <code>useHaptics = true</code> for devices with haptics capabilities to use * them. * * @param milliseconds the duration of the haptics effect * @param fallback whether to use non-haptic vibrator on devices without haptics capabilities (or haptics disabled). Fallback * non-haptic vibrations may ignore length parameter in some backends. */ public void vibrate (int milliseconds, boolean fallback); /** Generates a simple haptic effect of a given duration and amplitude. Note that on Android backend you'll need the permission * <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your manifest file in order for this to work. * On iOS backend you'll need to set <code>useHaptics = true</code> for devices with haptics capabilities to use them. * * @param milliseconds the duration of the haptics effect * @param amplitude the amplitude/strength of the haptics effect. Valid values in the range [0, 255]. * @param fallback whether to use non-haptic vibrator on devices without haptics capabilities (or haptics disabled). Fallback * non-haptic vibrations may ignore length and/or amplitude parameters in some backends. */ public void vibrate (int milliseconds, int amplitude, boolean fallback); /** Generates a simple haptic effect of a type. VibrationTypes are length/amplitude haptic effect presets that depend on each * device and are defined by manufacturers. Should give most consistent results across devices and OSs. Note that on Android * backend you'll need the permission <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your * manifest file in order for this to work. On iOS backend you'll need to set <code>useHaptics = true</code> for devices with * haptics capabilities to use them. * * @param vibrationType the type of vibration */ public void vibrate (VibrationType vibrationType); public enum VibrationType { LIGHT, MEDIUM, HEAVY; } /** The azimuth is the angle of the device's orientation around the z-axis. The positive z-axis points towards the earths * center. * * @see <a * href="http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], float[], float[])">http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], * float[], float[], float[])</a> * @return the azimuth in degrees */ public float getAzimuth (); /** The pitch is the angle of the device's orientation around the x-axis. The positive x-axis roughly points to the west and is * orthogonal to the z- and y-axis. * @see <a * href="http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], float[], float[])">http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], * float[], float[], float[])</a> * @return the pitch in degrees */ public float getPitch (); /** The roll is the angle of the device's orientation around the y-axis. The positive y-axis points to the magnetic north pole * of the earth. * @see <a * href="http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], float[], float[])">http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], * float[], float[], float[])</a> * @return the roll in degrees */ public float getRoll (); /** Returns the rotation matrix describing the devices rotation as per * <a href= "http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], * float[], float[])" >SensorManager#getRotationMatrix(float[], float[], float[], float[])</a>. Does not manipulate the matrix * if the platform does not have an accelerometer. * @param matrix */ public void getRotationMatrix (float[] matrix); /** @return the time of the event currently reported to the {@link InputProcessor}. */ public long getCurrentEventTime (); /** @deprecated use {@link Input#setCatchKey(int keycode, boolean catchKey)} instead * * Sets whether the BACK button on Android should be caught. This will prevent the app from being paused. Will have * no effect on the desktop. * * @param catchBack whether to catch the back button */ @Deprecated public void setCatchBackKey (boolean catchBack); /** @deprecated use {@link Input#isCatchKey(int keycode)} instead * @return whether the back button is currently being caught */ @Deprecated public boolean isCatchBackKey (); /** @deprecated use {@link Input#setCatchKey(int keycode, boolean catchKey)} instead * * Sets whether the MENU button on Android should be caught. This will prevent the onscreen keyboard to show up. * Will have no effect on the desktop. * * @param catchMenu whether to catch the menu button */ @Deprecated public void setCatchMenuKey (boolean catchMenu); /** @deprecated use {@link Input#isCatchKey(int keycode)} instead * @return whether the menu button is currently being caught */ @Deprecated public boolean isCatchMenuKey (); /** Sets whether the given key on Android or GWT should be caught. No effect on other platforms. All keys that are not caught * may be handled by other apps or background processes on Android, or may trigger default browser behaviour on GWT. For * example, media or volume buttons are handled by background media players if present, or Space key triggers a scroll. All * keys you need to control your game should be caught to prevent unintended behaviour. * * @param keycode keycode to catch * @param catchKey whether to catch the given keycode */ public void setCatchKey (int keycode, boolean catchKey); /** @param keycode keycode to check if caught * @return true if the given keycode is configured to be caught */ public boolean isCatchKey (int keycode); /** Sets the {@link InputProcessor} that will receive all touch and key input events. It will be called before the * {@link ApplicationListener#render()} method each frame. * * @param processor the InputProcessor */ public void setInputProcessor (InputProcessor processor); /** @return the currently set {@link InputProcessor} or null. */ public InputProcessor getInputProcessor (); /** Queries whether a {@link Peripheral} is currently available. In case of Android and the {@link Peripheral#HardwareKeyboard} * this returns the whether the keyboard is currently slid out or not. * * @param peripheral the {@link Peripheral} * @return whether the peripheral is available or not. */ public boolean isPeripheralAvailable (Peripheral peripheral); /** @return the rotation of the device with respect to its native orientation. */ public int getRotation (); /** @return the native orientation of the device. */ public Orientation getNativeOrientation (); public enum Orientation { Landscape, Portrait } /** Only viable on desktop, GWT and Android 8+. Will confine the mouse cursor location to the window and hide the mouse cursor. * X and y coordinates are still reported as if the mouse was not catched. * @param catched whether to catch or not to catch the mouse cursor */ public void setCursorCatched (boolean catched); /** @return whether the mouse cursor is catched. */ public boolean isCursorCatched (); /** Only viable on the desktop. Will set the mouse cursor location to the given window coordinates (origin top-left corner). * @param x the x-position * @param y the y-position */ public void setCursorPosition (int x, int y); }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx; import com.badlogic.gdx.utils.ObjectIntMap; /** * <p> * Interface to the input facilities. This allows polling the state of the keyboard, the touch screen and the accelerometer. On * some backends (desktop, gwt, etc) the touch screen is replaced by mouse input. The accelerometer is of course not available on * all backends. * </p> * * <p> * Instead of polling for events, one can process all input events with an {@link InputProcessor}. You can set the InputProcessor * via the {@link #setInputProcessor(InputProcessor)} method. It will be called before the {@link ApplicationListener#render()} * method in each frame. * </p> * * <p> * Keyboard keys are translated to the constants in {@link Keys} transparently on all systems. Do not use system specific key * constants. * </p> * * <p> * The class also offers methods to use (and test for the presence of) other input systems like vibration, compass, on-screen * keyboards, and cursor capture. Support for simple input dialogs is also provided. * </p> * * @author mzechner */ public interface Input { /** Callback interface for {@link Input#getTextInput(TextInputListener, String, String, String)} * * @author mzechner */ static public interface TextInputListener { public void input (String text); public void canceled (); } /** Mouse buttons. * @author mzechner */ static public class Buttons { public static final int LEFT = 0; public static final int RIGHT = 1; public static final int MIDDLE = 2; public static final int BACK = 3; public static final int FORWARD = 4; } /** Keys. * * @author mzechner */ static public class Keys { public static final int ANY_KEY = -1; public static final int NUM_0 = 7; public static final int NUM_1 = 8; public static final int NUM_2 = 9; public static final int NUM_3 = 10; public static final int NUM_4 = 11; public static final int NUM_5 = 12; public static final int NUM_6 = 13; public static final int NUM_7 = 14; public static final int NUM_8 = 15; public static final int NUM_9 = 16; public static final int A = 29; public static final int ALT_LEFT = 57; public static final int ALT_RIGHT = 58; public static final int APOSTROPHE = 75; public static final int AT = 77; public static final int B = 30; public static final int BACK = 4; public static final int BACKSLASH = 73; public static final int C = 31; public static final int CALL = 5; public static final int CAMERA = 27; public static final int CAPS_LOCK = 115; public static final int CLEAR = 28; public static final int COMMA = 55; public static final int D = 32; public static final int DEL = 67; public static final int BACKSPACE = 67; public static final int FORWARD_DEL = 112; public static final int DPAD_CENTER = 23; public static final int DPAD_DOWN = 20; public static final int DPAD_LEFT = 21; public static final int DPAD_RIGHT = 22; public static final int DPAD_UP = 19; public static final int CENTER = 23; public static final int DOWN = 20; public static final int LEFT = 21; public static final int RIGHT = 22; public static final int UP = 19; public static final int E = 33; public static final int ENDCALL = 6; public static final int ENTER = 66; public static final int ENVELOPE = 65; public static final int EQUALS = 70; public static final int EXPLORER = 64; public static final int F = 34; public static final int FOCUS = 80; public static final int G = 35; public static final int GRAVE = 68; public static final int H = 36; public static final int HEADSETHOOK = 79; public static final int HOME = 3; public static final int I = 37; public static final int J = 38; public static final int K = 39; public static final int L = 40; public static final int LEFT_BRACKET = 71; public static final int M = 41; public static final int MEDIA_FAST_FORWARD = 90; public static final int MEDIA_NEXT = 87; public static final int MEDIA_PLAY_PAUSE = 85; public static final int MEDIA_PREVIOUS = 88; public static final int MEDIA_REWIND = 89; public static final int MEDIA_STOP = 86; public static final int MENU = 82; public static final int MINUS = 69; public static final int MUTE = 91; public static final int N = 42; public static final int NOTIFICATION = 83; public static final int NUM = 78; public static final int O = 43; public static final int P = 44; public static final int PAUSE = 121; // aka break public static final int PERIOD = 56; public static final int PLUS = 81; public static final int POUND = 18; public static final int POWER = 26; public static final int PRINT_SCREEN = 120; // aka SYSRQ public static final int Q = 45; public static final int R = 46; public static final int RIGHT_BRACKET = 72; public static final int S = 47; public static final int SCROLL_LOCK = 116; public static final int SEARCH = 84; public static final int SEMICOLON = 74; public static final int SHIFT_LEFT = 59; public static final int SHIFT_RIGHT = 60; public static final int SLASH = 76; public static final int SOFT_LEFT = 1; public static final int SOFT_RIGHT = 2; public static final int SPACE = 62; public static final int STAR = 17; public static final int SYM = 63; public static final int T = 48; public static final int TAB = 61; public static final int U = 49; public static final int UNKNOWN = 0; public static final int V = 50; public static final int VOLUME_DOWN = 25; public static final int VOLUME_UP = 24; public static final int W = 51; public static final int X = 52; public static final int Y = 53; public static final int Z = 54; public static final int META_ALT_LEFT_ON = 16; public static final int META_ALT_ON = 2; public static final int META_ALT_RIGHT_ON = 32; public static final int META_SHIFT_LEFT_ON = 64; public static final int META_SHIFT_ON = 1; public static final int META_SHIFT_RIGHT_ON = 128; public static final int META_SYM_ON = 4; public static final int CONTROL_LEFT = 129; public static final int CONTROL_RIGHT = 130; public static final int ESCAPE = 111; public static final int END = 123; public static final int INSERT = 124; public static final int PAGE_UP = 92; public static final int PAGE_DOWN = 93; public static final int PICTSYMBOLS = 94; public static final int SWITCH_CHARSET = 95; public static final int BUTTON_CIRCLE = 255; public static final int BUTTON_A = 96; public static final int BUTTON_B = 97; public static final int BUTTON_C = 98; public static final int BUTTON_X = 99; public static final int BUTTON_Y = 100; public static final int BUTTON_Z = 101; public static final int BUTTON_L1 = 102; public static final int BUTTON_R1 = 103; public static final int BUTTON_L2 = 104; public static final int BUTTON_R2 = 105; public static final int BUTTON_THUMBL = 106; public static final int BUTTON_THUMBR = 107; public static final int BUTTON_START = 108; public static final int BUTTON_SELECT = 109; public static final int BUTTON_MODE = 110; public static final int NUMPAD_0 = 144; public static final int NUMPAD_1 = 145; public static final int NUMPAD_2 = 146; public static final int NUMPAD_3 = 147; public static final int NUMPAD_4 = 148; public static final int NUMPAD_5 = 149; public static final int NUMPAD_6 = 150; public static final int NUMPAD_7 = 151; public static final int NUMPAD_8 = 152; public static final int NUMPAD_9 = 153; public static final int NUMPAD_DIVIDE = 154; public static final int NUMPAD_MULTIPLY = 155; public static final int NUMPAD_SUBTRACT = 156; public static final int NUMPAD_ADD = 157; public static final int NUMPAD_DOT = 158; public static final int NUMPAD_COMMA = 159; public static final int NUMPAD_ENTER = 160; public static final int NUMPAD_EQUALS = 161; public static final int NUMPAD_LEFT_PAREN = 162; public static final int NUMPAD_RIGHT_PAREN = 163; public static final int NUM_LOCK = 143; // public static final int BACKTICK = 0; // public static final int TILDE = 0; // public static final int UNDERSCORE = 0; // public static final int DOT = 0; // public static final int BREAK = 0; // public static final int PIPE = 0; // public static final int EXCLAMATION = 0; // public static final int QUESTIONMARK = 0; // ` | VK_BACKTICK // ~ | VK_TILDE // : | VK_COLON // _ | VK_UNDERSCORE // . | VK_DOT // (break) | VK_BREAK // | | VK_PIPE // ! | VK_EXCLAMATION // ? | VK_QUESTION public static final int COLON = 243; public static final int F1 = 131; public static final int F2 = 132; public static final int F3 = 133; public static final int F4 = 134; public static final int F5 = 135; public static final int F6 = 136; public static final int F7 = 137; public static final int F8 = 138; public static final int F9 = 139; public static final int F10 = 140; public static final int F11 = 141; public static final int F12 = 142; public static final int F13 = 183; public static final int F14 = 184; public static final int F15 = 185; public static final int F16 = 186; public static final int F17 = 187; public static final int F18 = 188; public static final int F19 = 189; public static final int F20 = 190; public static final int F21 = 191; public static final int F22 = 192; public static final int F23 = 193; public static final int F24 = 194; public static final int MAX_KEYCODE = 255; /** @return a human readable representation of the keycode. The returned value can be used in * {@link Input.Keys#valueOf(String)} */ public static String toString (int keycode) { if (keycode < 0) throw new IllegalArgumentException("keycode cannot be negative, keycode: " + keycode); if (keycode > MAX_KEYCODE) throw new IllegalArgumentException("keycode cannot be greater than 255, keycode: " + keycode); switch (keycode) { // META* variables should not be used with this method. case UNKNOWN: return "Unknown"; case SOFT_LEFT: return "Soft Left"; case SOFT_RIGHT: return "Soft Right"; case HOME: return "Home"; case BACK: return "Back"; case CALL: return "Call"; case ENDCALL: return "End Call"; case NUM_0: return "0"; case NUM_1: return "1"; case NUM_2: return "2"; case NUM_3: return "3"; case NUM_4: return "4"; case NUM_5: return "5"; case NUM_6: return "6"; case NUM_7: return "7"; case NUM_8: return "8"; case NUM_9: return "9"; case STAR: return "*"; case POUND: return "#"; case UP: return "Up"; case DOWN: return "Down"; case LEFT: return "Left"; case RIGHT: return "Right"; case CENTER: return "Center"; case VOLUME_UP: return "Volume Up"; case VOLUME_DOWN: return "Volume Down"; case POWER: return "Power"; case CAMERA: return "Camera"; case CLEAR: return "Clear"; case A: return "A"; case B: return "B"; case C: return "C"; case D: return "D"; case E: return "E"; case F: return "F"; case G: return "G"; case H: return "H"; case I: return "I"; case J: return "J"; case K: return "K"; case L: return "L"; case M: return "M"; case N: return "N"; case O: return "O"; case P: return "P"; case Q: return "Q"; case R: return "R"; case S: return "S"; case T: return "T"; case U: return "U"; case V: return "V"; case W: return "W"; case X: return "X"; case Y: return "Y"; case Z: return "Z"; case COMMA: return ","; case PERIOD: return "."; case ALT_LEFT: return "L-Alt"; case ALT_RIGHT: return "R-Alt"; case SHIFT_LEFT: return "L-Shift"; case SHIFT_RIGHT: return "R-Shift"; case TAB: return "Tab"; case SPACE: return "Space"; case SYM: return "SYM"; case EXPLORER: return "Explorer"; case ENVELOPE: return "Envelope"; case ENTER: return "Enter"; case DEL: return "Delete"; // also BACKSPACE case GRAVE: return "`"; case MINUS: return "-"; case EQUALS: return "="; case LEFT_BRACKET: return "["; case RIGHT_BRACKET: return "]"; case BACKSLASH: return "\\"; case SEMICOLON: return ";"; case APOSTROPHE: return "'"; case SLASH: return "/"; case AT: return "@"; case NUM: return "Num"; case HEADSETHOOK: return "Headset Hook"; case FOCUS: return "Focus"; case PLUS: return "Plus"; case MENU: return "Menu"; case NOTIFICATION: return "Notification"; case SEARCH: return "Search"; case MEDIA_PLAY_PAUSE: return "Play/Pause"; case MEDIA_STOP: return "Stop Media"; case MEDIA_NEXT: return "Next Media"; case MEDIA_PREVIOUS: return "Prev Media"; case MEDIA_REWIND: return "Rewind"; case MEDIA_FAST_FORWARD: return "Fast Forward"; case MUTE: return "Mute"; case PAGE_UP: return "Page Up"; case PAGE_DOWN: return "Page Down"; case PICTSYMBOLS: return "PICTSYMBOLS"; case SWITCH_CHARSET: return "SWITCH_CHARSET"; case BUTTON_A: return "A Button"; case BUTTON_B: return "B Button"; case BUTTON_C: return "C Button"; case BUTTON_X: return "X Button"; case BUTTON_Y: return "Y Button"; case BUTTON_Z: return "Z Button"; case BUTTON_L1: return "L1 Button"; case BUTTON_R1: return "R1 Button"; case BUTTON_L2: return "L2 Button"; case BUTTON_R2: return "R2 Button"; case BUTTON_THUMBL: return "Left Thumb"; case BUTTON_THUMBR: return "Right Thumb"; case BUTTON_START: return "Start"; case BUTTON_SELECT: return "Select"; case BUTTON_MODE: return "Button Mode"; case FORWARD_DEL: return "Forward Delete"; case CONTROL_LEFT: return "L-Ctrl"; case CONTROL_RIGHT: return "R-Ctrl"; case ESCAPE: return "Escape"; case END: return "End"; case INSERT: return "Insert"; case NUMPAD_0: return "Numpad 0"; case NUMPAD_1: return "Numpad 1"; case NUMPAD_2: return "Numpad 2"; case NUMPAD_3: return "Numpad 3"; case NUMPAD_4: return "Numpad 4"; case NUMPAD_5: return "Numpad 5"; case NUMPAD_6: return "Numpad 6"; case NUMPAD_7: return "Numpad 7"; case NUMPAD_8: return "Numpad 8"; case NUMPAD_9: return "Numpad 9"; case COLON: return ":"; case F1: return "F1"; case F2: return "F2"; case F3: return "F3"; case F4: return "F4"; case F5: return "F5"; case F6: return "F6"; case F7: return "F7"; case F8: return "F8"; case F9: return "F9"; case F10: return "F10"; case F11: return "F11"; case F12: return "F12"; case F13: return "F13"; case F14: return "F14"; case F15: return "F15"; case F16: return "F16"; case F17: return "F17"; case F18: return "F18"; case F19: return "F19"; case F20: return "F20"; case F21: return "F21"; case F22: return "F22"; case F23: return "F23"; case F24: return "F24"; case NUMPAD_DIVIDE: return "Num /"; case NUMPAD_MULTIPLY: return "Num *"; case NUMPAD_SUBTRACT: return "Num -"; case NUMPAD_ADD: return "Num +"; case NUMPAD_DOT: return "Num ."; case NUMPAD_COMMA: return "Num ,"; case NUMPAD_ENTER: return "Num Enter"; case NUMPAD_EQUALS: return "Num ="; case NUMPAD_LEFT_PAREN: return "Num ("; case NUMPAD_RIGHT_PAREN: return "Num )"; case NUM_LOCK: return "Num Lock"; case CAPS_LOCK: return "Caps Lock"; case SCROLL_LOCK: return "Scroll Lock"; case PAUSE: return "Pause"; case PRINT_SCREEN: return "Print"; // BUTTON_CIRCLE unhandled, as it conflicts with the more likely to be pressed F12 default: // key name not found return null; } } private static ObjectIntMap<String> keyNames; /** @param keyname the keyname returned by the {@link Keys#toString(int)} method * @return the int keycode */ public static int valueOf (String keyname) { if (keyNames == null) initializeKeyNames(); return keyNames.get(keyname, -1); } /** lazily intialized in {@link Keys#valueOf(String)} */ private static void initializeKeyNames () { keyNames = new ObjectIntMap<String>(); for (int i = 0; i < 256; i++) { String name = toString(i); if (name != null) keyNames.put(name, i); } } } /** Enumeration of potentially available peripherals. Use with {@link Input#isPeripheralAvailable(Peripheral)}. * @author mzechner */ public enum Peripheral { HardwareKeyboard, OnscreenKeyboard, MultitouchScreen, Accelerometer, Compass, Vibrator, HapticFeedback, Gyroscope, RotationVector, Pressure } /** @return The acceleration force in m/s^2 applied to the device in the X axis, including the force of gravity */ public float getAccelerometerX (); /** @return The acceleration force in m/s^2 applied to the device in the Y axis, including the force of gravity */ public float getAccelerometerY (); /** @return The acceleration force in m/s^2 applied to the device in the Z axis, including the force of gravity */ public float getAccelerometerZ (); /** @return The rate of rotation in rad/s around the X axis */ public float getGyroscopeX (); /** @return The rate of rotation in rad/s around the Y axis */ public float getGyroscopeY (); /** @return The rate of rotation in rad/s around the Z axis */ public float getGyroscopeZ (); /** @return The maximum number of pointers supported */ public int getMaxPointers (); /** @return The x coordinate of the last touch on touch screen devices and the current mouse position on desktop for the first * pointer in screen coordinates. The screen origin is the top left corner. */ public int getX (); /** Returns the x coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id * identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. * When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on * the touch screen the first free index will be used. * * @param pointer the pointer id. * @return the x coordinate */ public int getX (int pointer); /** @return the different between the current pointer location and the last pointer location on the x-axis. */ public int getDeltaX (); /** @return the different between the current pointer location and the last pointer location on the x-axis. */ public int getDeltaX (int pointer); /** @return The y coordinate of the last touch on touch screen devices and the current mouse position on desktop for the first * pointer in screen coordinates. The screen origin is the top left corner. */ public int getY (); /** Returns the y coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id * identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. * When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on * the touch screen the first free index will be used. * * @param pointer the pointer id. * @return the y coordinate */ public int getY (int pointer); /** @return the different between the current pointer location and the last pointer location on the y-axis. */ public int getDeltaY (); /** @return the different between the current pointer location and the last pointer location on the y-axis. */ public int getDeltaY (int pointer); /** @return whether the screen is currently touched. */ public boolean isTouched (); /** @return whether a new touch down event just occurred. */ public boolean justTouched (); /** Whether the screen is currently touched by the pointer with the given index. Pointers are indexed from 0 to n. The pointer * id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. * When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on * the touch screen the first free index will be used. * * @param pointer the pointer * @return whether the screen is touched by the pointer */ public boolean isTouched (int pointer); /** @return the pressure of the first pointer */ public float getPressure (); /** Returns the pressure of the given pointer, where 0 is untouched. On Android it should be up to 1.0, but it can go above * that slightly and its not consistent between devices. On iOS 1.0 is the normal touch and significantly more of hard touch. * Check relevant manufacturer documentation for details. Check availability with * {@link Input#isPeripheralAvailable(Peripheral)}. If not supported, returns 1.0 when touched. * * @param pointer the pointer id. * @return the pressure */ public float getPressure (int pointer); /** Whether a given button is pressed or not. Button constants can be found in {@link Buttons}. On Android only the * Buttons#LEFT constant is meaningful before version 4.0. * @param button the button to check. * @return whether the button is down or not. */ public boolean isButtonPressed (int button); /** Returns whether a given button has just been pressed. Button constants can be found in {@link Buttons}. On Android only the * Buttons#LEFT constant is meaningful before version 4.0. On WebGL (GWT), only LEFT, RIGHT and MIDDLE buttons are supported. * * @param button the button to check. * @return true or false. */ public boolean isButtonJustPressed (int button); /** Returns whether the key is pressed. * * @param key The key code as found in {@link Input.Keys}. * @return true or false. */ public boolean isKeyPressed (int key); /** Returns whether the key has just been pressed. * * @param key The key code as found in {@link Input.Keys}. * @return true or false. */ public boolean isKeyJustPressed (int key); /** System dependent method to input a string of text. A dialog box will be created with the given title and the given text as * a message for the user. Will use the Default keyboard type. Once the dialog has been closed the provided * {@link TextInputListener} will be called on the rendering thread. * * @param listener The TextInputListener. * @param title The title of the text input dialog. * @param text The message presented to the user. */ public void getTextInput (TextInputListener listener, String title, String text, String hint); /** System dependent method to input a string of text. A dialog box will be created with the given title and the given text as * a message for the user. Once the dialog has been closed the provided {@link TextInputListener} will be called on the * rendering thread. * * @param listener The TextInputListener. * @param title The title of the text input dialog. * @param text The message presented to the user. * @param type which type of keyboard we wish to display */ public void getTextInput (TextInputListener listener, String title, String text, String hint, OnscreenKeyboardType type); /** Sets the on-screen keyboard visible if available. Will use the Default keyboard type. * * @param visible visible or not */ public void setOnscreenKeyboardVisible (boolean visible); /** Sets the on-screen keyboard visible if available. * * @param visible visible or not * @param type which type of keyboard we wish to display. Can be null when hiding */ public void setOnscreenKeyboardVisible (boolean visible, OnscreenKeyboardType type); public enum OnscreenKeyboardType { Default, NumberPad, PhonePad, Email, Password, URI } /** Generates a simple haptic effect of a given duration or a vibration effect on devices without haptic capabilities. Note * that on Android backend you'll need the permission * <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your manifest file in order for this to work. * On iOS backend you'll need to set <code>useHaptics = true</code> for devices with haptics capabilities to use them. * * @param milliseconds the number of milliseconds to vibrate. */ public void vibrate (int milliseconds); /** Generates a simple haptic effect of a given duration and default amplitude. Note that on Android backend you'll need the * permission <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your manifest file in order for * this to work. On iOS backend you'll need to set <code>useHaptics = true</code> for devices with haptics capabilities to use * them. * * @param milliseconds the duration of the haptics effect * @param fallback whether to use non-haptic vibrator on devices without haptics capabilities (or haptics disabled). Fallback * non-haptic vibrations may ignore length parameter in some backends. */ public void vibrate (int milliseconds, boolean fallback); /** Generates a simple haptic effect of a given duration and amplitude. Note that on Android backend you'll need the permission * <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your manifest file in order for this to work. * On iOS backend you'll need to set <code>useHaptics = true</code> for devices with haptics capabilities to use them. * * @param milliseconds the duration of the haptics effect * @param amplitude the amplitude/strength of the haptics effect. Valid values in the range [0, 255]. * @param fallback whether to use non-haptic vibrator on devices without haptics capabilities (or haptics disabled). Fallback * non-haptic vibrations may ignore length and/or amplitude parameters in some backends. */ public void vibrate (int milliseconds, int amplitude, boolean fallback); /** Generates a simple haptic effect of a type. VibrationTypes are length/amplitude haptic effect presets that depend on each * device and are defined by manufacturers. Should give most consistent results across devices and OSs. Note that on Android * backend you'll need the permission <code> <uses-permission android:name="android.permission.VIBRATE" /></code> in your * manifest file in order for this to work. On iOS backend you'll need to set <code>useHaptics = true</code> for devices with * haptics capabilities to use them. * * @param vibrationType the type of vibration */ public void vibrate (VibrationType vibrationType); public enum VibrationType { LIGHT, MEDIUM, HEAVY; } /** The azimuth is the angle of the device's orientation around the z-axis. The positive z-axis points towards the earths * center. * * @see <a * href="http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], float[], float[])">http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], * float[], float[], float[])</a> * @return the azimuth in degrees */ public float getAzimuth (); /** The pitch is the angle of the device's orientation around the x-axis. The positive x-axis roughly points to the west and is * orthogonal to the z- and y-axis. * @see <a * href="http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], float[], float[])">http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], * float[], float[], float[])</a> * @return the pitch in degrees */ public float getPitch (); /** The roll is the angle of the device's orientation around the y-axis. The positive y-axis points to the magnetic north pole * of the earth. * @see <a * href="http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], float[], float[])">http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], * float[], float[], float[])</a> * @return the roll in degrees */ public float getRoll (); /** Returns the rotation matrix describing the devices rotation as per * <a href= "http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], * float[], float[])" >SensorManager#getRotationMatrix(float[], float[], float[], float[])</a>. Does not manipulate the matrix * if the platform does not have an accelerometer. * @param matrix */ public void getRotationMatrix (float[] matrix); /** @return the time of the event currently reported to the {@link InputProcessor}. */ public long getCurrentEventTime (); /** @deprecated use {@link Input#setCatchKey(int keycode, boolean catchKey)} instead * * Sets whether the BACK button on Android should be caught. This will prevent the app from being paused. Will have * no effect on the desktop. * * @param catchBack whether to catch the back button */ @Deprecated public void setCatchBackKey (boolean catchBack); /** @deprecated use {@link Input#isCatchKey(int keycode)} instead * @return whether the back button is currently being caught */ @Deprecated public boolean isCatchBackKey (); /** @deprecated use {@link Input#setCatchKey(int keycode, boolean catchKey)} instead * * Sets whether the MENU button on Android should be caught. This will prevent the onscreen keyboard to show up. * Will have no effect on the desktop. * * @param catchMenu whether to catch the menu button */ @Deprecated public void setCatchMenuKey (boolean catchMenu); /** @deprecated use {@link Input#isCatchKey(int keycode)} instead * @return whether the menu button is currently being caught */ @Deprecated public boolean isCatchMenuKey (); /** Sets whether the given key on Android or GWT should be caught. No effect on other platforms. All keys that are not caught * may be handled by other apps or background processes on Android, or may trigger default browser behaviour on GWT. For * example, media or volume buttons are handled by background media players if present, or Space key triggers a scroll. All * keys you need to control your game should be caught to prevent unintended behaviour. * * @param keycode keycode to catch * @param catchKey whether to catch the given keycode */ public void setCatchKey (int keycode, boolean catchKey); /** @param keycode keycode to check if caught * @return true if the given keycode is configured to be caught */ public boolean isCatchKey (int keycode); /** Sets the {@link InputProcessor} that will receive all touch and key input events. It will be called before the * {@link ApplicationListener#render()} method each frame. * * @param processor the InputProcessor */ public void setInputProcessor (InputProcessor processor); /** @return the currently set {@link InputProcessor} or null. */ public InputProcessor getInputProcessor (); /** Queries whether a {@link Peripheral} is currently available. In case of Android and the {@link Peripheral#HardwareKeyboard} * this returns the whether the keyboard is currently slid out or not. * * @param peripheral the {@link Peripheral} * @return whether the peripheral is available or not. */ public boolean isPeripheralAvailable (Peripheral peripheral); /** @return the rotation of the device with respect to its native orientation. */ public int getRotation (); /** @return the native orientation of the device. */ public Orientation getNativeOrientation (); public enum Orientation { Landscape, Portrait } /** Only viable on the desktop. Will confine the mouse cursor location to the window and hide the mouse cursor. X and y * coordinates are still reported as if the mouse was not catched. * @param catched whether to catch or not to catch the mouse cursor */ public void setCursorCatched (boolean catched); /** @return whether the mouse cursor is catched. */ public boolean isCursorCatched (); /** Only viable on the desktop. Will set the mouse cursor location to the given window coordinates (origin top-left corner). * @param x the x-position * @param y the y-position */ public void setCursorPosition (int x, int y); }
1
libgdx/libgdx
7,215
Revert #6821
obigu
2023-08-22T10:02:37Z
2023-08-25T03:27:36Z
c9ed23f0371f1ece2942ccff2086893f2c08e1c9
ed811688c42a3eeb32427e56b47988e7ac4a6539
Revert #6821.
./extensions/gdx-bullet/jni/swig-src/collision/com/badlogic/gdx/physics/bullet/collision/btGimPairArray.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.BulletBase; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btGimPairArray extends BulletBase { private long swigCPtr; protected btGimPairArray (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btGimPairArray, normally you should not need this constructor it's intended for low-level usage. */ public btGimPairArray (long cPtr, boolean cMemoryOwn) { this("btGimPairArray", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (btGimPairArray obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btGimPairArray(swigCPtr); } swigCPtr = 0; } super.delete(); } public btGimPairArray operatorAssignment (btGimPairArray other) { return new btGimPairArray( CollisionJNI.btGimPairArray_operatorAssignment(swigCPtr, this, btGimPairArray.getCPtr(other), other), false); } public btGimPairArray () { this(CollisionJNI.new_btGimPairArray__SWIG_0(), true); } public btGimPairArray (btGimPairArray otherArray) { this(CollisionJNI.new_btGimPairArray__SWIG_1(btGimPairArray.getCPtr(otherArray), otherArray), true); } public int size () { return CollisionJNI.btGimPairArray_size(swigCPtr, this); } public GIM_PAIR atConst (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_atConst(swigCPtr, this, n), false); } public GIM_PAIR at (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_at(swigCPtr, this, n), false); } public GIM_PAIR operatorSubscriptConst (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_operatorSubscriptConst(swigCPtr, this, n), false); } public GIM_PAIR operatorSubscript (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_operatorSubscript(swigCPtr, this, n), false); } public void clear () { CollisionJNI.btGimPairArray_clear(swigCPtr, this); } public void pop_back () { CollisionJNI.btGimPairArray_pop_back(swigCPtr, this); } public void resizeNoInitialize (int newsize) { CollisionJNI.btGimPairArray_resizeNoInitialize(swigCPtr, this, newsize); } public void resize (int newsize, GIM_PAIR fillData) { CollisionJNI.btGimPairArray_resize__SWIG_0(swigCPtr, this, newsize, GIM_PAIR.getCPtr(fillData), fillData); } public void resize (int newsize) { CollisionJNI.btGimPairArray_resize__SWIG_1(swigCPtr, this, newsize); } public GIM_PAIR expandNonInitializing () { return new GIM_PAIR(CollisionJNI.btGimPairArray_expandNonInitializing(swigCPtr, this), false); } public GIM_PAIR expand (GIM_PAIR fillValue) { return new GIM_PAIR(CollisionJNI.btGimPairArray_expand__SWIG_0(swigCPtr, this, GIM_PAIR.getCPtr(fillValue), fillValue), false); } public GIM_PAIR expand () { return new GIM_PAIR(CollisionJNI.btGimPairArray_expand__SWIG_1(swigCPtr, this), false); } public void push_back (GIM_PAIR _Val) { CollisionJNI.btGimPairArray_push_back(swigCPtr, this, GIM_PAIR.getCPtr(_Val), _Val); } public int capacity () { return CollisionJNI.btGimPairArray_capacity(swigCPtr, this); } public void reserve (int _Count) { CollisionJNI.btGimPairArray_reserve(swigCPtr, this, _Count); } static public class less extends BulletBase { private long swigCPtr; protected less (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new less, normally you should not need this constructor it's intended for low-level usage. */ public less (long cPtr, boolean cMemoryOwn) { this("less", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (less obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btGimPairArray_less(swigCPtr); } swigCPtr = 0; } super.delete(); } public less () { this(CollisionJNI.new_btGimPairArray_less(), true); } } public void swap (int index0, int index1) { CollisionJNI.btGimPairArray_swap(swigCPtr, this, index0, index1); } public void removeAtIndex (int index) { CollisionJNI.btGimPairArray_removeAtIndex(swigCPtr, this, index); } public void initializeFromBuffer (long buffer, int size, int capacity) { CollisionJNI.btGimPairArray_initializeFromBuffer(swigCPtr, this, buffer, size, capacity); } public void copyFromArray (btGimPairArray otherArray) { CollisionJNI.btGimPairArray_copyFromArray(swigCPtr, this, btGimPairArray.getCPtr(otherArray), otherArray); } }
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.11 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.badlogic.gdx.physics.bullet.collision; import com.badlogic.gdx.physics.bullet.BulletBase; import com.badlogic.gdx.physics.bullet.linearmath.*; public class btGimPairArray extends BulletBase { private long swigCPtr; protected btGimPairArray (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new btGimPairArray, normally you should not need this constructor it's intended for low-level usage. */ public btGimPairArray (long cPtr, boolean cMemoryOwn) { this("btGimPairArray", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (btGimPairArray obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btGimPairArray(swigCPtr); } swigCPtr = 0; } super.delete(); } public btGimPairArray operatorAssignment (btGimPairArray other) { return new btGimPairArray( CollisionJNI.btGimPairArray_operatorAssignment(swigCPtr, this, btGimPairArray.getCPtr(other), other), false); } public btGimPairArray () { this(CollisionJNI.new_btGimPairArray__SWIG_0(), true); } public btGimPairArray (btGimPairArray otherArray) { this(CollisionJNI.new_btGimPairArray__SWIG_1(btGimPairArray.getCPtr(otherArray), otherArray), true); } public int size () { return CollisionJNI.btGimPairArray_size(swigCPtr, this); } public GIM_PAIR atConst (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_atConst(swigCPtr, this, n), false); } public GIM_PAIR at (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_at(swigCPtr, this, n), false); } public GIM_PAIR operatorSubscriptConst (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_operatorSubscriptConst(swigCPtr, this, n), false); } public GIM_PAIR operatorSubscript (int n) { return new GIM_PAIR(CollisionJNI.btGimPairArray_operatorSubscript(swigCPtr, this, n), false); } public void clear () { CollisionJNI.btGimPairArray_clear(swigCPtr, this); } public void pop_back () { CollisionJNI.btGimPairArray_pop_back(swigCPtr, this); } public void resizeNoInitialize (int newsize) { CollisionJNI.btGimPairArray_resizeNoInitialize(swigCPtr, this, newsize); } public void resize (int newsize, GIM_PAIR fillData) { CollisionJNI.btGimPairArray_resize__SWIG_0(swigCPtr, this, newsize, GIM_PAIR.getCPtr(fillData), fillData); } public void resize (int newsize) { CollisionJNI.btGimPairArray_resize__SWIG_1(swigCPtr, this, newsize); } public GIM_PAIR expandNonInitializing () { return new GIM_PAIR(CollisionJNI.btGimPairArray_expandNonInitializing(swigCPtr, this), false); } public GIM_PAIR expand (GIM_PAIR fillValue) { return new GIM_PAIR(CollisionJNI.btGimPairArray_expand__SWIG_0(swigCPtr, this, GIM_PAIR.getCPtr(fillValue), fillValue), false); } public GIM_PAIR expand () { return new GIM_PAIR(CollisionJNI.btGimPairArray_expand__SWIG_1(swigCPtr, this), false); } public void push_back (GIM_PAIR _Val) { CollisionJNI.btGimPairArray_push_back(swigCPtr, this, GIM_PAIR.getCPtr(_Val), _Val); } public int capacity () { return CollisionJNI.btGimPairArray_capacity(swigCPtr, this); } public void reserve (int _Count) { CollisionJNI.btGimPairArray_reserve(swigCPtr, this, _Count); } static public class less extends BulletBase { private long swigCPtr; protected less (final String className, long cPtr, boolean cMemoryOwn) { super(className, cPtr, cMemoryOwn); swigCPtr = cPtr; } /** Construct a new less, normally you should not need this constructor it's intended for low-level usage. */ public less (long cPtr, boolean cMemoryOwn) { this("less", cPtr, cMemoryOwn); construct(); } @Override protected void reset (long cPtr, boolean cMemoryOwn) { if (!destroyed) destroy(); super.reset(swigCPtr = cPtr, cMemoryOwn); } public static long getCPtr (less obj) { return (obj == null) ? 0 : obj.swigCPtr; } @Override protected void finalize () throws Throwable { if (!destroyed) destroy(); super.finalize(); } @Override protected synchronized void delete () { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; CollisionJNI.delete_btGimPairArray_less(swigCPtr); } swigCPtr = 0; } super.delete(); } public less () { this(CollisionJNI.new_btGimPairArray_less(), true); } } public void swap (int index0, int index1) { CollisionJNI.btGimPairArray_swap(swigCPtr, this, index0, index1); } public void removeAtIndex (int index) { CollisionJNI.btGimPairArray_removeAtIndex(swigCPtr, this, index); } public void initializeFromBuffer (long buffer, int size, int capacity) { CollisionJNI.btGimPairArray_initializeFromBuffer(swigCPtr, this, buffer, size, capacity); } public void copyFromArray (btGimPairArray otherArray) { CollisionJNI.btGimPairArray_copyFromArray(swigCPtr, this, btGimPairArray.getCPtr(otherArray), otherArray); } }
-1
libgdx/libgdx
7,215
Revert #6821
obigu
2023-08-22T10:02:37Z
2023-08-25T03:27:36Z
c9ed23f0371f1ece2942ccff2086893f2c08e1c9
ed811688c42a3eeb32427e56b47988e7ac4a6539
Revert #6821.
./gdx/src/com/badlogic/gdx/graphics/g2d/ParticleEffect.java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g2d; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Writer; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.StreamUtils; /** See <a href= * "https://web.archive.org/web/20200427191041/http://www.badlogicgames.com/wordpress/?p=12555">http://www.badlogicgames.com/wordpress/?p=12555</a> * @author mzechner */ public class ParticleEffect implements Disposable { private final Array<ParticleEmitter> emitters; private BoundingBox bounds; private boolean ownsTexture; protected float xSizeScale = 1f; protected float ySizeScale = 1f; protected float motionScale = 1f; public ParticleEffect () { emitters = new Array(8); } public ParticleEffect (ParticleEffect effect) { emitters = new Array(true, effect.emitters.size); for (int i = 0, n = effect.emitters.size; i < n; i++) emitters.add(newEmitter(effect.emitters.get(i))); } public void start () { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).start(); } /** Resets the effect so it can be started again like a new effect. Any changes to scale are reverted. See * {@link #reset(boolean)}. */ public void reset () { reset(true); } /** Resets the effect so it can be started again like a new effect. * @param resetScaling Whether to restore the original size and motion parameters if they were scaled. Repeated scaling and * resetting may introduce error. */ public void reset (boolean resetScaling) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).reset(); if (resetScaling && (xSizeScale != 1f || ySizeScale != 1f || motionScale != 1f)) { scaleEffect(1f / xSizeScale, 1f / ySizeScale, 1f / motionScale); xSizeScale = ySizeScale = motionScale = 1f; } } public void update (float delta) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).update(delta); } public void draw (Batch spriteBatch) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).draw(spriteBatch); } public void draw (Batch spriteBatch, float delta) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).draw(spriteBatch, delta); } public void allowCompletion () { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).allowCompletion(); } public boolean isComplete () { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (!emitter.isComplete()) return false; } return true; } public void setDuration (int duration) { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); emitter.setContinuous(false); emitter.duration = duration; emitter.durationTimer = 0; } } public void setPosition (float x, float y) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).setPosition(x, y); } public void setFlip (boolean flipX, boolean flipY) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).setFlip(flipX, flipY); } public void flipY () { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).flipY(); } public Array<ParticleEmitter> getEmitters () { return emitters; } /** Returns the emitter with the specified name, or null. */ public ParticleEmitter findEmitter (String name) { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (emitter.getName().equals(name)) return emitter; } return null; } /** Allocates all emitters particles. See {@link com.badlogic.gdx.graphics.g2d.ParticleEmitter#preAllocateParticles()} */ public void preAllocateParticles () { for (ParticleEmitter emitter : emitters) { emitter.preAllocateParticles(); } } public void save (Writer output) throws IOException { int index = 0; for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (index++ > 0) output.write("\n"); emitter.save(output); } } public void load (FileHandle effectFile, FileHandle imagesDir) { loadEmitters(effectFile); loadEmitterImages(imagesDir); } public void load (FileHandle effectFile, TextureAtlas atlas) { load(effectFile, atlas, null); } public void load (FileHandle effectFile, TextureAtlas atlas, String atlasPrefix) { loadEmitters(effectFile); loadEmitterImages(atlas, atlasPrefix); } public void loadEmitters (FileHandle effectFile) { InputStream input = effectFile.read(); emitters.clear(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(input), 512); while (true) { ParticleEmitter emitter = newEmitter(reader); emitters.add(emitter); if (reader.readLine() == null) break; } } catch (IOException ex) { throw new GdxRuntimeException("Error loading effect: " + effectFile, ex); } finally { StreamUtils.closeQuietly(reader); } } public void loadEmitterImages (TextureAtlas atlas) { loadEmitterImages(atlas, null); } public void loadEmitterImages (TextureAtlas atlas, String atlasPrefix) { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (emitter.getImagePaths().size == 0) continue; Array<Sprite> sprites = new Array<Sprite>(); for (String imagePath : emitter.getImagePaths()) { String imageName = new File(imagePath.replace('\\', '/')).getName(); int lastDotIndex = imageName.lastIndexOf('.'); if (lastDotIndex != -1) imageName = imageName.substring(0, lastDotIndex); if (atlasPrefix != null) imageName = atlasPrefix + imageName; Sprite sprite = atlas.createSprite(imageName); if (sprite == null) throw new IllegalArgumentException("SpriteSheet missing image: " + imageName); sprites.add(sprite); } emitter.setSprites(sprites); } } public void loadEmitterImages (FileHandle imagesDir) { ownsTexture = true; ObjectMap<String, Sprite> loadedSprites = new ObjectMap<String, Sprite>(emitters.size); for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (emitter.getImagePaths().size == 0) continue; Array<Sprite> sprites = new Array<Sprite>(); for (String imagePath : emitter.getImagePaths()) { String imageName = new File(imagePath.replace('\\', '/')).getName(); Sprite sprite = loadedSprites.get(imageName); if (sprite == null) { sprite = new Sprite(loadTexture(imagesDir.child(imageName))); loadedSprites.put(imageName, sprite); } sprites.add(sprite); } emitter.setSprites(sprites); } } protected ParticleEmitter newEmitter (BufferedReader reader) throws IOException { return new ParticleEmitter(reader); } protected ParticleEmitter newEmitter (ParticleEmitter emitter) { return new ParticleEmitter(emitter); } protected Texture loadTexture (FileHandle file) { return new Texture(file, false); } /** Disposes the texture for each sprite for each ParticleEmitter. */ public void dispose () { if (!ownsTexture) return; for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); for (Sprite sprite : emitter.getSprites()) { sprite.getTexture().dispose(); } } } /** Returns the bounding box for all active particles. z axis will always be zero. */ public BoundingBox getBoundingBox () { if (bounds == null) bounds = new BoundingBox(); BoundingBox bounds = this.bounds; bounds.inf(); for (ParticleEmitter emitter : this.emitters) bounds.ext(emitter.getBoundingBox()); return bounds; } /** Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a * {@link ParticleEffectPool}, the scale will be reset when it is returned to the pool. */ public void scaleEffect (float scaleFactor) { scaleEffect(scaleFactor, scaleFactor, scaleFactor); } /** Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a * {@link ParticleEffectPool}, the scale will be reset when it is returned to the pool. */ public void scaleEffect (float scaleFactor, float motionScaleFactor) { scaleEffect(scaleFactor, scaleFactor, motionScaleFactor); } /** Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a * {@link ParticleEffectPool}, the scale will be reset when it is returned to the pool. */ public void scaleEffect (float xSizeScaleFactor, float ySizeScaleFactor, float motionScaleFactor) { xSizeScale *= xSizeScaleFactor; ySizeScale *= ySizeScaleFactor; motionScale *= motionScaleFactor; for (ParticleEmitter particleEmitter : emitters) { particleEmitter.scaleSize(xSizeScaleFactor, ySizeScaleFactor); particleEmitter.scaleMotion(motionScaleFactor); } } /** Sets the {@link com.badlogic.gdx.graphics.g2d.ParticleEmitter#setCleansUpBlendFunction(boolean) cleansUpBlendFunction} * parameter on all {@link com.badlogic.gdx.graphics.g2d.ParticleEmitter ParticleEmitters} currently in this ParticleEffect. * <p> * IMPORTANT: If set to false and if the next object to use this Batch expects alpha blending, you are responsible for setting * the Batch's blend function to (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) before that next object is drawn. * @param cleanUpBlendFunction */ public void setEmittersCleanUpBlendFunction (boolean cleanUpBlendFunction) { for (int i = 0, n = emitters.size; i < n; i++) { emitters.get(i).setCleansUpBlendFunction(cleanUpBlendFunction); } } }
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.g2d; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Writer; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.StreamUtils; /** See <a href= * "https://web.archive.org/web/20200427191041/http://www.badlogicgames.com/wordpress/?p=12555">http://www.badlogicgames.com/wordpress/?p=12555</a> * @author mzechner */ public class ParticleEffect implements Disposable { private final Array<ParticleEmitter> emitters; private BoundingBox bounds; private boolean ownsTexture; protected float xSizeScale = 1f; protected float ySizeScale = 1f; protected float motionScale = 1f; public ParticleEffect () { emitters = new Array(8); } public ParticleEffect (ParticleEffect effect) { emitters = new Array(true, effect.emitters.size); for (int i = 0, n = effect.emitters.size; i < n; i++) emitters.add(newEmitter(effect.emitters.get(i))); } public void start () { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).start(); } /** Resets the effect so it can be started again like a new effect. Any changes to scale are reverted. See * {@link #reset(boolean)}. */ public void reset () { reset(true); } /** Resets the effect so it can be started again like a new effect. * @param resetScaling Whether to restore the original size and motion parameters if they were scaled. Repeated scaling and * resetting may introduce error. */ public void reset (boolean resetScaling) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).reset(); if (resetScaling && (xSizeScale != 1f || ySizeScale != 1f || motionScale != 1f)) { scaleEffect(1f / xSizeScale, 1f / ySizeScale, 1f / motionScale); xSizeScale = ySizeScale = motionScale = 1f; } } public void update (float delta) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).update(delta); } public void draw (Batch spriteBatch) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).draw(spriteBatch); } public void draw (Batch spriteBatch, float delta) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).draw(spriteBatch, delta); } public void allowCompletion () { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).allowCompletion(); } public boolean isComplete () { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (!emitter.isComplete()) return false; } return true; } public void setDuration (int duration) { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); emitter.setContinuous(false); emitter.duration = duration; emitter.durationTimer = 0; } } public void setPosition (float x, float y) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).setPosition(x, y); } public void setFlip (boolean flipX, boolean flipY) { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).setFlip(flipX, flipY); } public void flipY () { for (int i = 0, n = emitters.size; i < n; i++) emitters.get(i).flipY(); } public Array<ParticleEmitter> getEmitters () { return emitters; } /** Returns the emitter with the specified name, or null. */ public ParticleEmitter findEmitter (String name) { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (emitter.getName().equals(name)) return emitter; } return null; } /** Allocates all emitters particles. See {@link com.badlogic.gdx.graphics.g2d.ParticleEmitter#preAllocateParticles()} */ public void preAllocateParticles () { for (ParticleEmitter emitter : emitters) { emitter.preAllocateParticles(); } } public void save (Writer output) throws IOException { int index = 0; for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (index++ > 0) output.write("\n"); emitter.save(output); } } public void load (FileHandle effectFile, FileHandle imagesDir) { loadEmitters(effectFile); loadEmitterImages(imagesDir); } public void load (FileHandle effectFile, TextureAtlas atlas) { load(effectFile, atlas, null); } public void load (FileHandle effectFile, TextureAtlas atlas, String atlasPrefix) { loadEmitters(effectFile); loadEmitterImages(atlas, atlasPrefix); } public void loadEmitters (FileHandle effectFile) { InputStream input = effectFile.read(); emitters.clear(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(input), 512); while (true) { ParticleEmitter emitter = newEmitter(reader); emitters.add(emitter); if (reader.readLine() == null) break; } } catch (IOException ex) { throw new GdxRuntimeException("Error loading effect: " + effectFile, ex); } finally { StreamUtils.closeQuietly(reader); } } public void loadEmitterImages (TextureAtlas atlas) { loadEmitterImages(atlas, null); } public void loadEmitterImages (TextureAtlas atlas, String atlasPrefix) { for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (emitter.getImagePaths().size == 0) continue; Array<Sprite> sprites = new Array<Sprite>(); for (String imagePath : emitter.getImagePaths()) { String imageName = new File(imagePath.replace('\\', '/')).getName(); int lastDotIndex = imageName.lastIndexOf('.'); if (lastDotIndex != -1) imageName = imageName.substring(0, lastDotIndex); if (atlasPrefix != null) imageName = atlasPrefix + imageName; Sprite sprite = atlas.createSprite(imageName); if (sprite == null) throw new IllegalArgumentException("SpriteSheet missing image: " + imageName); sprites.add(sprite); } emitter.setSprites(sprites); } } public void loadEmitterImages (FileHandle imagesDir) { ownsTexture = true; ObjectMap<String, Sprite> loadedSprites = new ObjectMap<String, Sprite>(emitters.size); for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); if (emitter.getImagePaths().size == 0) continue; Array<Sprite> sprites = new Array<Sprite>(); for (String imagePath : emitter.getImagePaths()) { String imageName = new File(imagePath.replace('\\', '/')).getName(); Sprite sprite = loadedSprites.get(imageName); if (sprite == null) { sprite = new Sprite(loadTexture(imagesDir.child(imageName))); loadedSprites.put(imageName, sprite); } sprites.add(sprite); } emitter.setSprites(sprites); } } protected ParticleEmitter newEmitter (BufferedReader reader) throws IOException { return new ParticleEmitter(reader); } protected ParticleEmitter newEmitter (ParticleEmitter emitter) { return new ParticleEmitter(emitter); } protected Texture loadTexture (FileHandle file) { return new Texture(file, false); } /** Disposes the texture for each sprite for each ParticleEmitter. */ public void dispose () { if (!ownsTexture) return; for (int i = 0, n = emitters.size; i < n; i++) { ParticleEmitter emitter = emitters.get(i); for (Sprite sprite : emitter.getSprites()) { sprite.getTexture().dispose(); } } } /** Returns the bounding box for all active particles. z axis will always be zero. */ public BoundingBox getBoundingBox () { if (bounds == null) bounds = new BoundingBox(); BoundingBox bounds = this.bounds; bounds.inf(); for (ParticleEmitter emitter : this.emitters) bounds.ext(emitter.getBoundingBox()); return bounds; } /** Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a * {@link ParticleEffectPool}, the scale will be reset when it is returned to the pool. */ public void scaleEffect (float scaleFactor) { scaleEffect(scaleFactor, scaleFactor, scaleFactor); } /** Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a * {@link ParticleEffectPool}, the scale will be reset when it is returned to the pool. */ public void scaleEffect (float scaleFactor, float motionScaleFactor) { scaleEffect(scaleFactor, scaleFactor, motionScaleFactor); } /** Permanently scales all the size and motion parameters of all the emitters in this effect. If this effect originated from a * {@link ParticleEffectPool}, the scale will be reset when it is returned to the pool. */ public void scaleEffect (float xSizeScaleFactor, float ySizeScaleFactor, float motionScaleFactor) { xSizeScale *= xSizeScaleFactor; ySizeScale *= ySizeScaleFactor; motionScale *= motionScaleFactor; for (ParticleEmitter particleEmitter : emitters) { particleEmitter.scaleSize(xSizeScaleFactor, ySizeScaleFactor); particleEmitter.scaleMotion(motionScaleFactor); } } /** Sets the {@link com.badlogic.gdx.graphics.g2d.ParticleEmitter#setCleansUpBlendFunction(boolean) cleansUpBlendFunction} * parameter on all {@link com.badlogic.gdx.graphics.g2d.ParticleEmitter ParticleEmitters} currently in this ParticleEffect. * <p> * IMPORTANT: If set to false and if the next object to use this Batch expects alpha blending, you are responsible for setting * the Batch's blend function to (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) before that next object is drawn. * @param cleanUpBlendFunction */ public void setEmittersCleanUpBlendFunction (boolean cleanUpBlendFunction) { for (int i = 0, n = emitters.size; i < n; i++) { emitters.get(i).setCleansUpBlendFunction(cleanUpBlendFunction); } } }
-1