diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..06bd8b0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +* text=auto eol=lf + +# Binary files. +*.png binary +*.jpg binary +*.jar binary +*.ttf binary +*.js binary +*.wasm binary \ No newline at end of file diff --git a/.github/workflows/build_and_upload.yml b/.github/workflows/build_and_upload.yml new file mode 100644 index 0000000..5596060 --- /dev/null +++ b/.github/workflows/build_and_upload.yml @@ -0,0 +1,314 @@ +name: Build and Upload + +on: + workflow_call: + inputs: + isRelease: + required: true + type: boolean + shouldUpload: + required: true + type: boolean + +env: + RELEASE: ${{ inputs.isRelease }} + +jobs: + build_windows: + name: Build Windows + runs-on: ubuntu-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 11 + + - name: Set up MinGW + run: | + sudo apt install -y --force-yes mingw-w64 lib32z1 + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + - name: Download sources + run: ./gradlew download_all_sources + + - name: Build project + run: ./gradlew :jolt:jolt-build:build_project_windows64 + + - name: Upload natives + uses: actions/upload-artifact@v4 + with: + name: windows-natives + path: ./jolt/jolt-build/build/c++/libs/ + + build_linux: + name: Build Linux + runs-on: ubuntu-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 11 + + - name: Set up MinGW + run: | + sudo apt install -y --force-yes mingw-w64 lib32z1 + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + - name: Download sources + run: ./gradlew download_all_sources + + - name: Build project + run: ./gradlew :jolt:jolt-build:build_project_linux64 + + - name: Upload natives + uses: actions/upload-artifact@v4 + with: + name: linux-natives + path: ./jolt/jolt-build/build/c++/libs/ + + build_mac: + name: Build Mac + runs-on: macos-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 11 + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + - name: Download sources + run: ./gradlew download_all_sources + + - name: Build project + run: ./gradlew :jolt:jolt-build:build_project_mac64 :jolt:jolt-build:build_project_macArm + + - name: Upload natives + uses: actions/upload-artifact@v4 + with: + name: mac-natives + path: ./jolt/jolt-build/build/c++/libs/ + + build_teavm: + name: Build TeaVM + runs-on: ubuntu-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 11 + + - name: Set up MinGW + run: | + sudo apt install -y --force-yes mingw-w64 lib32z1 + + - name: Install emscripten + uses: mymindstorm/setup-emsdk@v14 + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + - name: Download sources + run: ./gradlew download_all_sources + + - name: Build project + run: ./gradlew :jolt:jolt-build:build_project_teavm + + - name: Upload natives + uses: actions/upload-artifact@v4 + with: + name: teavm-natives + path: ./jolt/jolt-build/build/c++/libs/ + + build_android: + name: Build Android + runs-on: ubuntu-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 11 + + - name: Set up MinGW + run: | + sudo apt install -y --force-yes mingw-w64 lib32z1 + + - name: Install NDK + id: setup-ndk + uses: nttld/setup-ndk@v1 + with: + ndk-version: r25c + add-to-path: false + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + - name: Download sources + run: ./gradlew download_all_sources + + - name: Build project + run: ./gradlew :jolt:jolt-build:build_project_android + env: + NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + + - name: Upload natives + uses: actions/upload-artifact@v4 + with: + name: android-natives + path: ./jolt/jolt-build/build/c++/libs/ + + upload_natives: + name: Upload Natives + needs: [build_windows, build_linux, build_mac, build_android, build_teavm] + runs-on: ubuntu-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get version + uses: madhead/read-java-properties@latest + id: version + with: + file: "./gradle.properties" + property: version + default: 0.0.1 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 11 + + - name: Set up MinGW + run: | + sudo apt install -y --force-yes mingw-w64 lib32z1 + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + - name: Download windows natives + uses: actions/download-artifact@v4 + with: + name: windows-natives + path: ./jolt/jolt-build/build/c++/libs/ + + - name: Download linux natives + uses: actions/download-artifact@v4 + with: + name: linux-natives + path: ./jolt/jolt-build/build/c++/libs/ + + - name: Download mac natives + uses: actions/download-artifact@v4 + with: + name: mac-natives + path: ./jolt/jolt-build/build/c++/libs/ + + - name: Download android natives + uses: actions/download-artifact@v4 + with: + name: android-natives + path: ./jolt/jolt-build/build/c++/libs/ + + - name: Download teavm natives + uses: actions/download-artifact@v4 + with: + name: teavm-natives + path: ./jolt/jolt-build/build/c++/libs/ + + - name: Generate Jolt classes + run: ./gradlew :jolt:jolt-build:build_project + +# - name: Upload to repository +# uses: nick-fields/retry@v3 +# if: ${{ inputs.shouldUpload }} +# with: +# max_attempts: 3 +# timeout_minutes: 10 +# retry_on: error +# command: ./gradlew publish +# env: +# USER: ${{ secrets.USER }} +# PASSWORD: ${{ secrets.PASSWORD }} +# SIGNING_KEY: ${{ secrets.PGP_SECRET }} +# SIGNING_PASSWORD: ${{ secrets.PGP_PASSPHRASE }} +# +# - name: Create Git tag +# uses: actions/github-script@v7 +# if: ${{ inputs.isRelease }} +# with: +# script: | +# const versionOutputs = ${{ toJSON(steps.version.outputs) }}; +# +# var version = versionOutputs.value; +# +# console.log("Version: " + version); +# +# var ref = "refs/tags/" + version +# github.rest.git.createRef({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# ref: ref, +# sha: context.sha +# }); \ No newline at end of file diff --git a/.github/workflows/dispatch_build.yml b/.github/workflows/dispatch_build.yml new file mode 100644 index 0000000..5ce4507 --- /dev/null +++ b/.github/workflows/dispatch_build.yml @@ -0,0 +1,16 @@ +name: Dispatch Build + +on: + workflow_dispatch: + inputs: + isRelease: + description: "Release to maven" + required: true + type: boolean +jobs: + build-and-upload: + uses: ./.github/workflows/build_and_upload.yml + with: + isRelease: ${{ inputs.isRelease }} + shouldUpload: true + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml new file mode 100644 index 0000000..35b0249 --- /dev/null +++ b/.github/workflows/pullrequest.yml @@ -0,0 +1,15 @@ +name: Pull Request + +on: + pull_request: + branches: + - "master" + - "release" + +jobs: + build-and-upload: + uses: ./.github/workflows/build_and_upload.yml + with: + isRelease: false + shouldUpload: false + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a1d8642 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,14 @@ +name: Build Release + +on: + push: + branches: + - "release" + +jobs: + build-and-upload: + uses: ./.github/workflows/build_and_upload.yml + with: + isRelease: true + shouldUpload: true + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..dcfc4f7 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,14 @@ +name: Build Snapshot + +on: + push: + branches: + - "master" + +jobs: + build-and-upload: + uses: ./.github/workflows/build_and_upload.yml + with: + isRelease: false + shouldUpload: true + secrets: inherit \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..430c230 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# Temporary Files +*~ +.*.swp +.DS_STORE +*.cache + +bin/ +target/ +test-classes/ +war/ +gwt-unitCache/ +gen/ +dist/ +**/webapp/assets +.gradle/ +build/ + +*.iml +*.a +/.idea/ +.idea/ +workspace.xml +tasks.xml +local.properties +*.class +.settings +out/ +jni-headers/ +*.c +libs/ +*.log +*.o +*.ini + +**/webapp/** + +**/jolt/jolt-core/src/main/java/** +**/jolt/jolt-teavm/src/main/java/** \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..3cac396 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,123 @@ +plugins { + id("java") + id("maven-publish") + id("signing") + id("org.jetbrains.kotlin.android") version "1.8.21" apply false +} + +buildscript { + repositories { + mavenCentral() + google() + } + + val kotlinVersion = "1.8.10" + + dependencies { + classpath("com.android.tools.build:gradle:7.3.1") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + } +} + +allprojects { + + repositories { + mavenLocal() + google() + mavenCentral() + maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") } + maven { url = uri("https://oss.sonatype.org/content/repositories/releases/") } + } + + configurations.configureEach { + // Check for updates every sync + resolutionStrategy.cacheChangingModulesFor(0, "seconds") + } +} + +configure(allprojects - project(":jolt:jolt-android") - project(":examples:basic:android")) { + apply { + plugin("java") + } + java.sourceCompatibility = JavaVersion.VERSION_11 + java.targetCompatibility = JavaVersion.VERSION_11 +} + +var libProjects = mutableSetOf( + project(":jolt:jolt-core"), + project(":jolt:jolt-desktop"), + project(":jolt:jolt-teavm"), + project(":jolt:jolt-android") +) + +configure(libProjects) { + apply(plugin = "maven-publish") + group = LibExt.groupId + version = LibExt.libVersion +} + +configure(libProjects) { + apply(plugin = "signing") + apply(plugin = "maven-publish") + + publishing { + repositories { + maven { + url = uri { + val ver = project.version.toString() + val isSnapshot = ver.uppercase().contains("SNAPSHOT") + val repoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + val repoUrlSnapshot = "https://oss.sonatype.org/content/repositories/snapshots/" + if (isSnapshot) repoUrlSnapshot else repoUrl + } + credentials { + username = System.getenv("USER") + password = System.getenv("PASSWORD") + } + } + } + } + + tasks.withType { + options.encoding = "UTF-8" + (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") + } + + publishing.publications.configureEach { + if (this is MavenPublication) { + pom { + name.set("gdx-jolt") + description.set("Java JNI based binding for jolt physics") + url.set("https://github.com/xpenatan/gdx-jolt") + developers { + developer { + id.set("Xpe") + name.set("Natan") + } + } + scm { + connection.set("scm:git:git://https://github.com/xpenatan/gdx-jolt.git") + developerConnection.set("scm:git:ssh://https://github.com/xpenatan/gdx-jolt.git") + url.set("http://https://github.com/xpenatan/gdx-jolt/tree/master") + } + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + } + } + } + + val signingKey = System.getenv("SIGNING_KEY") + val signingPassword = System.getenv("SIGNING_PASSWORD") + if (signingKey != null && signingPassword != null) { + signing { + useInMemoryPgpKeys(signingKey, signingPassword) + publishing.publications.configureEach { + sign(this) + } + } + } +} \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000..b22ed73 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt new file mode 100644 index 0000000..dddcae9 --- /dev/null +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -0,0 +1,37 @@ +import java.io.File +import java.util.* + +object LibExt { + const val groupId = "com.github.xpenatan.gdx-jolt" + val libVersion: String = getVersion() + + const val gdxVersion = "1.12.1" + const val teaVMVersion = "0.10.0" + const val gdxTeaVMVersion = "-SNAPSHOT" + const val jParserVersion = "1.0.0-b5" + const val jUnitVersion = "4.12" + + const val exampleUseRepoLibs = false +} + +private fun getVersion(): String { + val isReleaseStr = System.getenv("RELEASE") + val isRelease = isReleaseStr != null && isReleaseStr.toBoolean() + var libVersion = "-SNAPSHOT" + val file = File("gradle.properties") + if(file.exists()) { + val properties = Properties() + properties.load(file.inputStream()) + val version = properties.getProperty("version") + if(isRelease) { + libVersion = version + } + } + else { + if(isRelease) { + throw RuntimeException("properties should exist") + } + } + println("Lib Version: $libVersion") + return libVersion +} \ No newline at end of file diff --git a/examples/basic/android/build.gradle.kts b/examples/basic/android/build.gradle.kts new file mode 100644 index 0000000..b93cbab --- /dev/null +++ b/examples/basic/android/build.gradle.kts @@ -0,0 +1,83 @@ +plugins { + id("com.android.application") + id("kotlin-android") +} + +group = "jolt.example.basic.android" + +android { + namespace = "jolt.basic" + compileSdk = 33 + + defaultConfig { + applicationId = "jolt.basic" + minSdk = 24 + targetSdk = 33 + versionCode = 1 + versionName = "1.0" + } + + sourceSets { + named("main") { + assets.srcDirs(project.file("../assets")) + jniLibs.srcDirs("libs") + } + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } +} +val natives: Configuration by configurations.creating + +dependencies { + coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") + + if(LibExt.exampleUseRepoLibs) { + implementation("com.github.xpenatan.gdx-jolt:jolt-android:-SNAPSHOT") + } + else { + implementation(project(":jolt:jolt-android")) + } + + implementation("com.badlogicgames.gdx:gdx:${LibExt.gdxVersion}") + implementation("com.badlogicgames.gdx:gdx-backend-android:${LibExt.gdxVersion}") + natives("com.badlogicgames.gdx:gdx-platform:${LibExt.gdxVersion}:natives-armeabi-v7a") + natives("com.badlogicgames.gdx:gdx-platform:${LibExt.gdxVersion}:natives-arm64-v8a") + natives("com.badlogicgames.gdx:gdx-platform:${LibExt.gdxVersion}:natives-x86_64") + natives("com.badlogicgames.gdx:gdx-platform:${LibExt.gdxVersion}:natives-x86") + + implementation(project(":examples:basic:core")) +} + + +tasks.register("copyAndroidNatives") { + group = "basic-android" + doFirst { + natives.files.forEach { jar -> + val outputDir = file("libs/" + jar.nameWithoutExtension.substringAfterLast("natives-")) + outputDir.mkdirs() + copy { + from(zipTree(jar)) + into(outputDir) + include("*.so") + } + } + } +} + +tasks.whenTaskAdded { + if ("package" in name) { + dependsOn("copyAndroidNatives") + } +} \ No newline at end of file diff --git a/examples/basic/android/proguard-rules.pro b/examples/basic/android/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/examples/basic/android/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/basic/android/src/main/AndroidManifest.xml b/examples/basic/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9bf05c0 --- /dev/null +++ b/examples/basic/android/src/main/AndroidManifest.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/basic/android/src/main/kotlin/bullet/MainActivity.kt b/examples/basic/android/src/main/kotlin/bullet/MainActivity.kt new file mode 100644 index 0000000..6fbf3c7 --- /dev/null +++ b/examples/basic/android/src/main/kotlin/bullet/MainActivity.kt @@ -0,0 +1,16 @@ +package bullet + +import android.os.Bundle +import com.badlogic.gdx.backends.android.AndroidApplication +import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration +import jolt.example.basic.JoltGame + +class MainActivity : AndroidApplication() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + initialize(JoltGame(), AndroidApplicationConfiguration().apply { + // Configure your application here. + useImmersiveMode = true // Recommended, but not required. + }) + } +} \ No newline at end of file diff --git a/examples/basic/android/src/main/res/drawable-v24/ic_launcher_foreground.xml b/examples/basic/android/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..09b3616 --- /dev/null +++ b/examples/basic/android/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/examples/basic/android/src/main/res/drawable/ic_launcher_background.xml b/examples/basic/android/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..9c9f7c8 --- /dev/null +++ b/examples/basic/android/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/basic/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/examples/basic/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..bbd3e02 --- /dev/null +++ b/examples/basic/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/examples/basic/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/examples/basic/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..bbd3e02 --- /dev/null +++ b/examples/basic/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/examples/basic/android/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/examples/basic/android/src/main/res/mipmap-anydpi-v33/ic_launcher.xml new file mode 100644 index 0000000..50ec886 --- /dev/null +++ b/examples/basic/android/src/main/res/mipmap-anydpi-v33/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/basic/android/src/main/res/mipmap-hdpi/ic_launcher.webp b/examples/basic/android/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/examples/basic/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-mdpi/ic_launcher.webp b/examples/basic/android/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/examples/basic/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-xhdpi/ic_launcher.webp b/examples/basic/android/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/examples/basic/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/examples/basic/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/examples/basic/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/examples/basic/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/examples/basic/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/examples/basic/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/examples/basic/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/examples/basic/android/src/main/res/values/colors.xml b/examples/basic/android/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/examples/basic/android/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/examples/basic/android/src/main/res/values/strings.xml b/examples/basic/android/src/main/res/values/strings.xml new file mode 100644 index 0000000..d02373d --- /dev/null +++ b/examples/basic/android/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Jolt Basic Example + \ No newline at end of file diff --git a/examples/basic/assets/data/badlogicsmall.jpg b/examples/basic/assets/data/badlogicsmall.jpg new file mode 100644 index 0000000..148b30b Binary files /dev/null and b/examples/basic/assets/data/badlogicsmall.jpg differ diff --git a/examples/basic/core/build.gradle.kts b/examples/basic/core/build.gradle.kts new file mode 100644 index 0000000..9c7810f --- /dev/null +++ b/examples/basic/core/build.gradle.kts @@ -0,0 +1,13 @@ +dependencies { + implementation(project(":examples:basic:base")) + + if(LibExt.exampleUseRepoLibs) { + implementation("com.github.xpenatan.gdx-jolt:jolt-core:-SNAPSHOT") + } + else { + implementation(project(":jolt:jolt-core")) + } + + implementation("com.badlogicgames.gdx:gdx:${LibExt.gdxVersion}") + implementation("com.github.xpenatan.jParser:loader-core:${LibExt.jParserVersion}") +} diff --git a/examples/basic/core/src/main/java/jolt/example/basic/BasicExample.java b/examples/basic/core/src/main/java/jolt/example/basic/BasicExample.java new file mode 100644 index 0000000..7e08783 --- /dev/null +++ b/examples/basic/core/src/main/java/jolt/example/basic/BasicExample.java @@ -0,0 +1,12 @@ +package jolt.example.basic; + +import com.badlogic.gdx.ScreenAdapter; + +public class BasicExample extends ScreenAdapter { + + @Override + public void show() { + super.show(); + + } +} \ No newline at end of file diff --git a/examples/basic/core/src/main/java/jolt/example/basic/InitScreen.java b/examples/basic/core/src/main/java/jolt/example/basic/InitScreen.java new file mode 100644 index 0000000..e3aa3bb --- /dev/null +++ b/examples/basic/core/src/main/java/jolt/example/basic/InitScreen.java @@ -0,0 +1,28 @@ +package jolt.example.basic; + +import com.badlogic.gdx.ScreenAdapter; +import jolt.JoltLoader; + +public class InitScreen extends ScreenAdapter { + + private JoltGame game; + + private boolean init = false; + + public InitScreen(JoltGame game) { + this.game = game; + } + + @Override + public void show() { + JoltLoader.init(() -> init = true); + } + + @Override + public void render(float delta) { + if(init) { + init = false; + game.setScreen(new BasicExample()); + } + } +} diff --git a/examples/basic/core/src/main/java/jolt/example/basic/JoltGame.java b/examples/basic/core/src/main/java/jolt/example/basic/JoltGame.java new file mode 100644 index 0000000..793e550 --- /dev/null +++ b/examples/basic/core/src/main/java/jolt/example/basic/JoltGame.java @@ -0,0 +1,11 @@ +package jolt.example.basic; + +import com.badlogic.gdx.Game; + +public class JoltGame extends Game { + + @Override + public void create() { + setScreen(new InitScreen(this)); + } +} \ No newline at end of file diff --git a/examples/basic/desktop/build.gradle.kts b/examples/basic/desktop/build.gradle.kts new file mode 100644 index 0000000..fb5936b --- /dev/null +++ b/examples/basic/desktop/build.gradle.kts @@ -0,0 +1,30 @@ +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform + +dependencies { + implementation(project(":examples:basic:core")) + + if(LibExt.exampleUseRepoLibs) { + implementation("com.github.xpenatan.gdx-jolt:jolt-desktop:-SNAPSHOT") + } + else { + implementation(project(":jolt:jolt-desktop")) + } + + implementation("com.badlogicgames.gdx:gdx-backend-lwjgl3:${LibExt.gdxVersion}") + implementation("com.badlogicgames.gdx:gdx-platform:${LibExt.gdxVersion}:natives-desktop") +} + +val mainClassName = "jolt.example.basic.Main" +val assetsDir = File("../assets"); + +tasks.register("basic-run-desktop") { + group = "example-desktop" + description = "Run desktop app" + mainClass.set(mainClassName) + classpath = sourceSets["main"].runtimeClasspath + workingDir = assetsDir + + if(DefaultNativePlatform.getCurrentOperatingSystem().isMacOsX) { + jvmArgs("-XstartOnFirstThread") + } +} \ No newline at end of file diff --git a/examples/basic/desktop/src/main/java/jolt/example/basic/Main.java b/examples/basic/desktop/src/main/java/jolt/example/basic/Main.java new file mode 100644 index 0000000..c622270 --- /dev/null +++ b/examples/basic/desktop/src/main/java/jolt/example/basic/Main.java @@ -0,0 +1,15 @@ +package jolt.example.basic; + +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; + +public class Main { + public static void main(String[] args) { + Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); + config.setWindowedMode(1444, 800); + config.setTitle("Jolt Basic Example"); + config.useVsync(true); + config.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL30, 3, 2); + new Lwjgl3Application(new JoltGame(), config); + } +} \ No newline at end of file diff --git a/examples/basic/teavm/build.gradle.kts b/examples/basic/teavm/build.gradle.kts new file mode 100644 index 0000000..16d72bf --- /dev/null +++ b/examples/basic/teavm/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + id("org.gretty") version("3.1.0") +} + +gretty { + contextPath = "/" + extraResourceBase("build/dist/webapp") +} + +dependencies { + implementation(project(":examples:basic:core")) + + if(LibExt.exampleUseRepoLibs) { + implementation("com.github.xpenatan.gdx-jolt:jolt-teavm:-SNAPSHOT") + } + else { + implementation(project(":jolt:jolt-teavm")) + } + + implementation("com.badlogicgames.gdx:gdx:${LibExt.gdxVersion}") + implementation("com.github.xpenatan.gdx-teavm:backend-teavm:${LibExt.gdxTeaVMVersion}") +} + +val mainClassName = "jolt.example.basic.Build" + +tasks.register("basic-build") { + group = "example-teavm" + description = "Build basic example" + mainClass.set(mainClassName) + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("basic-run-teavm") { + group = "example-teavm" + description = "Run teavm app" + val list = listOf("basic-build", "jettyRun") + dependsOn(list) + + tasks.findByName("jettyRun")?.mustRunAfter("basic-build") +} \ No newline at end of file diff --git a/examples/basic/teavm/src/main/java/jolt/example/basic/Build.java b/examples/basic/teavm/src/main/java/jolt/example/basic/Build.java new file mode 100644 index 0000000..d040915 --- /dev/null +++ b/examples/basic/teavm/src/main/java/jolt/example/basic/Build.java @@ -0,0 +1,24 @@ +package jolt.example.basic; + +import com.github.xpenatan.gdx.backends.teavm.config.AssetFileHandle; +import com.github.xpenatan.gdx.backends.teavm.config.TeaBuildConfiguration; +import com.github.xpenatan.gdx.backends.teavm.config.TeaBuilder; +import com.github.xpenatan.gdx.backends.teavm.gen.SkipClass; +import java.io.File; +import java.io.IOException; +import org.teavm.tooling.TeaVMTool; + +@SkipClass +public class Build { + + public static void main(String[] args) throws IOException { + TeaBuildConfiguration teaBuildConfiguration = new TeaBuildConfiguration(); + teaBuildConfiguration.assetsPath.add(new AssetFileHandle("../desktop/assets")); + teaBuildConfiguration.webappPath = new File("build/dist").getCanonicalPath(); + + TeaVMTool tool = TeaBuilder.config(teaBuildConfiguration); + tool.setMainClass(Launcher.class.getName()); + tool.setObfuscated(false); + TeaBuilder.build(tool); + } +} diff --git a/examples/basic/teavm/src/main/java/jolt/example/basic/Launcher.java b/examples/basic/teavm/src/main/java/jolt/example/basic/Launcher.java new file mode 100644 index 0000000..6f09915 --- /dev/null +++ b/examples/basic/teavm/src/main/java/jolt/example/basic/Launcher.java @@ -0,0 +1,16 @@ +package jolt.example.basic; + +import com.github.xpenatan.gdx.backends.teavm.TeaApplication; +import com.github.xpenatan.gdx.backends.teavm.TeaApplicationConfiguration; + +public class Launcher { + + public static void main(String[] args) { + TeaApplicationConfiguration config = new TeaApplicationConfiguration("canvas"); + config.useDebugGL = false; + config.width = 0; + config.height = 0; + config.useGL30 = true; + new TeaApplication(new JoltGame(), config); + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..f365538 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +version=5.0.0.0 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..13372ae Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..f590b8b --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/jolt/jolt-android/build.gradle.kts b/jolt/jolt-android/build.gradle.kts new file mode 100644 index 0000000..37e4bec --- /dev/null +++ b/jolt/jolt-android/build.gradle.kts @@ -0,0 +1,42 @@ +plugins { + id("com.android.library") + kotlin("android") +} + +val moduleName = "jolt-android" + +android { + namespace = "jolt" + compileSdk = 33 + + defaultConfig { + minSdk = 21 + } + + sourceSets { + named("main") { + jniLibs.srcDirs("$projectDir/../jolt-build/build/c++/libs/android") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } +} + +dependencies { +} + +publishing { + publications { + create("maven") { + artifactId = moduleName + afterEvaluate { + from(components["release"]) + } + } + } +} \ No newline at end of file diff --git a/jolt/jolt-base/build.gradle.kts b/jolt/jolt-base/build.gradle.kts new file mode 100644 index 0000000..975061c --- /dev/null +++ b/jolt/jolt-base/build.gradle.kts @@ -0,0 +1,4 @@ +dependencies { + implementation("com.github.xpenatan.jParser:jParser-base:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:loader-core:${LibExt.jParserVersion}") +} \ No newline at end of file diff --git a/jolt/jolt-base/src/main/java/jolt/JoltLoader.java b/jolt/jolt-base/src/main/java/jolt/JoltLoader.java new file mode 100644 index 0000000..a6b3f1f --- /dev/null +++ b/jolt/jolt-base/src/main/java/jolt/JoltLoader.java @@ -0,0 +1,45 @@ +package jolt; + +import com.github.xpenatan.jparser.loader.JParserLibraryLoader; + +/** + * @author xpenatan + */ +public class JoltLoader { + + /*[-JNI;-NATIVE] + #include "JoltCustom.h" + */ + + /*[-TEAVM;-ADD] + @org.teavm.jso.JSFunctor + public interface OnInitFunction extends org.teavm.jso.JSObject { + void onInit(); + } + */ + + /*[-TEAVM;-REPLACE] + public static void init(Runnable onSuccess) { + JParserLibraryLoader libraryLoader = new JParserLibraryLoader(); + OnInitFunction onInitFunction = onSuccess::run; + setOnLoadInit(onInitFunction); + libraryLoader.load("[MODULE].wasm", isSuccess -> {}); + } + */ + public static void init(Runnable onSuccess) { + JParserLibraryLoader libraryLoader = new JParserLibraryLoader(); + libraryLoader.load("jolt", isSuccess -> { + if(isSuccess) { + onSuccess.run(); + } + }); + } + + /*[-TEAVM;-REPLACE] + @org.teavm.jso.JSBody(params = { "onInitFunction" }, script = "window.[MODULE]OnInit = onInitFunction;") + private static native void setOnLoadInit(OnInitFunction onInitFunction); + */ + /*[-JNI;-REMOVE] */ + public static native void setOnLoadInit(); + +} \ No newline at end of file diff --git a/jolt/jolt-build/build.gradle.kts b/jolt/jolt-build/build.gradle.kts new file mode 100644 index 0000000..b29de2e --- /dev/null +++ b/jolt/jolt-build/build.gradle.kts @@ -0,0 +1,116 @@ +import de.undercouch.gradle.tasks.download.Download +import org.gradle.kotlin.dsl.support.unzipTo + +plugins { + id("de.undercouch.download") version("5.4.0") +} + +val mainClassName = "Build" + +dependencies { + implementation(project(":jolt:jolt-base")) + implementation("com.github.xpenatan.jParser:jParser-core:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:jParser-build:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:jParser-build-tool:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:jParser-teavm:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:jParser-cpp:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:jParser-idl:${LibExt.jParserVersion}") +} + +val buildDir = layout.buildDirectory.get().asFile +val zippedPath = "${buildDir}/jolt-source.zip" +val sourcePath = "${buildDir}/jolt-source" +val sourceDestination = "${buildDir}/jolt/" + +tasks.register("download_source") { + group = "jolt" + description = "Download jolt source" + src("https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v5.0.0.zip") + dest(File(zippedPath)) + doLast { + unzipTo(File(sourcePath), dest) + copy{ + from(sourcePath) + into(sourceDestination) + + eachFile { + val paths = relativePath.segments.drop(1) + relativePath = RelativePath(true, *paths.toTypedArray()) + } + } + delete(sourcePath) + delete(zippedPath) + } +} + +tasks.register("build_project") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf() + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_all") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("teavm", "windows64", "linux64", "mac64", "macArm", "android", "ios") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_teavm") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("teavm") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_windows64") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("windows64") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_linux64") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("linux64") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_mac64") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("mac64") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_macArm") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("macArm") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_android") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("android") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("build_project_ios") { + group = "jolt" + description = "Generate native project" + mainClass.set(mainClassName) + args = mutableListOf("ios") + classpath = sourceSets["main"].runtimeClasspath +} \ No newline at end of file diff --git a/jolt/jolt-build/src/main/cpp/custom/JoltCustom.cpp b/jolt/jolt-build/src/main/cpp/custom/JoltCustom.cpp new file mode 100644 index 0000000..bc27832 --- /dev/null +++ b/jolt/jolt-build/src/main/cpp/custom/JoltCustom.cpp @@ -0,0 +1 @@ +#include "JoltCustom.h" \ No newline at end of file diff --git a/jolt/jolt-build/src/main/cpp/custom/JoltCustom.h b/jolt/jolt-build/src/main/cpp/custom/JoltCustom.h new file mode 100644 index 0000000..b1108cc --- /dev/null +++ b/jolt/jolt-build/src/main/cpp/custom/JoltCustom.h @@ -0,0 +1,744 @@ +#pragma once + +#include "Jolt/Jolt.h" +#include "Jolt/RegisterTypes.h" +#include "Jolt/Core/Factory.h" +#include "Jolt/Core/JobSystemThreadPool.h" +#include "Jolt/Math/Vec3.h" +#include "Jolt/Math/Quat.h" +#include "Jolt/Geometry/OrientedBox.h" +#include "Jolt/Physics/PhysicsSystem.h" +#include "Jolt/Physics/StateRecorderImpl.h" +#include "Jolt/Physics/Collision/RayCast.h" +#include "Jolt/Physics/Collision/CastResult.h" +#include "Jolt/Physics/Collision/AABoxCast.h" +#include "Jolt/Physics/Collision/ShapeCast.h" +#include "Jolt/Physics/Collision/CollidePointResult.h" +#include "Jolt/Physics/Collision/Shape/SphereShape.h" +#include "Jolt/Physics/Collision/Shape/BoxShape.h" +#include "Jolt/Physics/Collision/Shape/CapsuleShape.h" +#include "Jolt/Physics/Collision/Shape/TaperedCapsuleShape.h" +#include "Jolt/Physics/Collision/Shape/CylinderShape.h" +#include "Jolt/Physics/Collision/Shape/ConvexHullShape.h" +#include "Jolt/Physics/Collision/Shape/StaticCompoundShape.h" +#include "Jolt/Physics/Collision/Shape/MutableCompoundShape.h" +#include "Jolt/Physics/Collision/Shape/ScaledShape.h" +#include "Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h" +#include "Jolt/Physics/Collision/Shape/RotatedTranslatedShape.h" +#include "Jolt/Physics/Collision/Shape/MeshShape.h" +#include "Jolt/Physics/Collision/Shape/HeightFieldShape.h" +#include "Jolt/Physics/Collision/CollisionCollectorImpl.h" +#include "Jolt/Physics/Collision/GroupFilterTable.h" +#include "Jolt/Physics/Collision/CollideShape.h" +#include "Jolt/Physics/Constraints/FixedConstraint.h" +#include "Jolt/Physics/Constraints/PointConstraint.h" +#include "Jolt/Physics/Constraints/DistanceConstraint.h" +#include "Jolt/Physics/Constraints/HingeConstraint.h" +#include "Jolt/Physics/Constraints/ConeConstraint.h" +#include "Jolt/Physics/Constraints/PathConstraint.h" +#include "Jolt/Physics/Constraints/PathConstraintPath.h" +#include "Jolt/Physics/Constraints/PulleyConstraint.h" +#include "Jolt/Physics/Constraints/SliderConstraint.h" +#include "Jolt/Physics/Constraints/SwingTwistConstraint.h" +#include "Jolt/Physics/Constraints/SixDOFConstraint.h" +#include "Jolt/Physics/Constraints/GearConstraint.h" +#include "Jolt/Physics/Constraints/RackAndPinionConstraint.h" +#include "Jolt/Physics/Body/BodyInterface.h" +#include "Jolt/Physics/Body/BodyCreationSettings.h" +#include "Jolt/Physics/Ragdoll/Ragdoll.h" +#include "Jolt/Physics/SoftBody/SoftBodyCreationSettings.h" +#include "Jolt/Physics/SoftBody/SoftBodySharedSettings.h" +#include "Jolt/Physics/SoftBody/SoftBodyShape.h" +#include "Jolt/Physics/SoftBody/SoftBodyMotionProperties.h" +#include "Jolt/Physics/SoftBody/SoftBodyContactListener.h" +#include "Jolt/Physics/SoftBody/SoftBodyManifold.h" +#include "Jolt/Physics/Character/CharacterVirtual.h" +#include "Jolt/Physics/Vehicle/VehicleConstraint.h" +#include "Jolt/Physics/Vehicle/MotorcycleController.h" +#include "Jolt/Physics/Vehicle/TrackedVehicleController.h" +#include "Jolt/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceTable.h" +#include "Jolt/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterTable.h" +#include "Jolt/Physics/Collision/ObjectLayerPairFilterTable.h" +#include "Jolt/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceMask.h" +#include "Jolt/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterMask.h" +#include "Jolt/Physics/Collision/ObjectLayerPairFilterMask.h" +#include "Jolt/Physics/Body/BodyActivationListener.h" +#include "Jolt/Skeleton/SkeletalAnimation.h" +#include "Jolt/Skeleton/SkeletonPose.h" +#include "Jolt/Skeleton/Skeleton.h" + +#include +#include +#include +//#include + +using namespace JPH; +using namespace std; +// +//#ifdef JPH_DEBUG_RENDERER +// #include "JoltJS-DebugRenderer.h" +//#endif +// +//// Ensure that we use 32-bit object layers +//static_assert(sizeof(ObjectLayer) == 4); +// +//// Types that need to be exposed to JavaScript +//using JPHString = String; +using ArrayVec3 = Array; +//using ArrayFloat = Array; +//using ArrayUint = Array; +//using ArrayUint8 = Array; +//using Vec3MemRef = Vec3; +//using QuatMemRef = Quat; +//using ArrayQuat = Array; +//using Mat44MemRef = Mat44; +//using ArrayMat44 = Array; +//using FloatMemRef = float; +//using UintMemRef = uint; +//using Uint8MemRef = uint8; +//using SoftBodySharedSettingsVertex = SoftBodySharedSettings::Vertex; +//using SoftBodySharedSettingsFace = SoftBodySharedSettings::Face; +//using SoftBodySharedSettingsEdge = SoftBodySharedSettings::Edge; +//using SoftBodySharedSettingsDihedralBend = SoftBodySharedSettings::DihedralBend; +//using SoftBodySharedSettingsVolume = SoftBodySharedSettings::Volume; +//using SoftBodySharedSettingsInvBind = SoftBodySharedSettings::InvBind; +//using SoftBodySharedSettingsSkinWeight = SoftBodySharedSettings::SkinWeight; +//using SoftBodySharedSettingsSkinned = SoftBodySharedSettings::Skinned; +//using SoftBodySharedSettingsLRA = SoftBodySharedSettings::LRA; +//using SoftBodySharedSettingsVertexAttributes = SoftBodySharedSettings::VertexAttributes; +//using CollideShapeResultFace = CollideShapeResult::Face; +//using ArraySoftBodySharedSettingsVertex = Array; +//using ArraySoftBodySharedSettingsFace = Array; +//using ArraySoftBodySharedSettingsEdge = Array; +//using ArraySoftBodySharedSettingsDihedralBend = Array; +//using ArraySoftBodySharedSettingsVolume = Array; +//using ArraySoftBodySharedSettingsInvBind = Array; +//using ArraySoftBodySharedSettingsSkinWeight = Array; +//using ArraySoftBodySharedSettingsSkinned = Array; +//using ArraySoftBodySharedSettingsLRA = Array; +//using ArraySoftBodySharedSettingsVertexAttributes = Array; +//using ArraySoftBodyVertex = Array; +//using EGroundState = CharacterBase::EGroundState; +//using Vector2 = Vector<2>; +//using ArrayRayCastResult = Array; +//using CastRayAllHitCollisionCollector = AllHitCollisionCollector; +//using CastRayClosestHitCollisionCollector = ClosestHitCollisionCollector; +//using CastRayAnyHitCollisionCollector = AnyHitCollisionCollector; +//using ArrayCollidePointResult = Array; +//using CollidePointAllHitCollisionCollector = AllHitCollisionCollector; +//using CollidePointClosestHitCollisionCollector = ClosestHitCollisionCollector; +//using CollidePointAnyHitCollisionCollector = AnyHitCollisionCollector; +//using ArrayCollideShapeResult = Array; +//using CollideShapeAllHitCollisionCollector = AllHitCollisionCollector; +//using CollideShapeClosestHitCollisionCollector = ClosestHitCollisionCollector; +//using CollideShapeAnyHitCollisionCollector = AnyHitCollisionCollector; +//using ArrayShapeCastResult = Array; +//using CastShapeAllHitCollisionCollector = AllHitCollisionCollector; +//using CastShapeClosestHitCollisionCollector = ClosestHitCollisionCollector; +//using CastShapeAnyHitCollisionCollector = AnyHitCollisionCollector; +//using ArrayWheelSettings = Array>; +//using ArrayVehicleAntiRollBar = Array; +//using ArrayVehicleDifferentialSettings = Array; +//using SkeletalAnimationJointState = SkeletalAnimation::JointState; +//using SkeletalAnimationKeyframe = SkeletalAnimation::Keyframe; +//using SkeletalAnimationAnimatedJoint = SkeletalAnimation::AnimatedJoint; +//using ArraySkeletonKeyframe = Array; +//using ArraySkeletonAnimatedJoint = Array; +//using RagdollPart = RagdollSettings::Part; +//using RagdollAdditionalConstraint = RagdollSettings::AdditionalConstraint; +//using ArrayRagdollPart = Array; +//using ArrayRagdollAdditionalConstraint = Array; +//using CompoundShapeSubShape = CompoundShape::SubShape; +// +//// Alias for EBodyType values to avoid clashes +//constexpr EBodyType EBodyType_RigidBody = EBodyType::RigidBody; +//constexpr EBodyType EBodyType_SoftBody = EBodyType::SoftBody; +// +//// Alias for EMotionType values to avoid clashes +//constexpr EMotionType EMotionType_Static = EMotionType::Static; +//constexpr EMotionType EMotionType_Kinematic = EMotionType::Kinematic; +//constexpr EMotionType EMotionType_Dynamic = EMotionType::Dynamic; +// +//// Alias for EMotionQuality values to avoid clashes +//constexpr EMotionQuality EMotionQuality_Discrete = EMotionQuality::Discrete; +//constexpr EMotionQuality EMotionQuality_LinearCast = EMotionQuality::LinearCast; +// +//// Alias for EActivation values to avoid clashes +//constexpr EActivation EActivation_Activate = EActivation::Activate; +//constexpr EActivation EActivation_DontActivate = EActivation::DontActivate; +// +//// Alias for EShapeType values to avoid clashes +//constexpr EShapeType EShapeType_Convex = EShapeType::Convex; +//constexpr EShapeType EShapeType_Compound = EShapeType::Compound; +//constexpr EShapeType EShapeType_Decorated = EShapeType::Decorated; +//constexpr EShapeType EShapeType_Mesh = EShapeType::Mesh; +//constexpr EShapeType EShapeType_HeightField = EShapeType::HeightField; +// +//// Alias for EShapeSubType values to avoid clashes +//constexpr EShapeSubType EShapeSubType_Sphere = EShapeSubType::Sphere; +//constexpr EShapeSubType EShapeSubType_Box = EShapeSubType::Box; +//constexpr EShapeSubType EShapeSubType_Capsule = EShapeSubType::Capsule; +//constexpr EShapeSubType EShapeSubType_TaperedCapsule = EShapeSubType::TaperedCapsule; +//constexpr EShapeSubType EShapeSubType_Cylinder = EShapeSubType::Cylinder; +//constexpr EShapeSubType EShapeSubType_ConvexHull = EShapeSubType::ConvexHull; +//constexpr EShapeSubType EShapeSubType_StaticCompound = EShapeSubType::StaticCompound; +//constexpr EShapeSubType EShapeSubType_MutableCompound = EShapeSubType::MutableCompound; +//constexpr EShapeSubType EShapeSubType_RotatedTranslated = EShapeSubType::RotatedTranslated; +//constexpr EShapeSubType EShapeSubType_Scaled = EShapeSubType::Scaled; +//constexpr EShapeSubType EShapeSubType_OffsetCenterOfMass = EShapeSubType::OffsetCenterOfMass; +//constexpr EShapeSubType EShapeSubType_Mesh = EShapeSubType::Mesh; +//constexpr EShapeSubType EShapeSubType_HeightField = EShapeSubType::HeightField; +// +//// Alias for EConstraintSpace values to avoid clashes +//constexpr EConstraintSpace EConstraintSpace_LocalToBodyCOM = EConstraintSpace::LocalToBodyCOM; +//constexpr EConstraintSpace EConstraintSpace_WorldSpace = EConstraintSpace::WorldSpace; +// +//// Alias for ESpringMode values to avoid clashes +//constexpr ESpringMode ESpringMode_FrequencyAndDamping = ESpringMode::FrequencyAndDamping; +//constexpr ESpringMode ESpringMode_StiffnessAndDamping = ESpringMode::StiffnessAndDamping; +// +//// Alias for EOverrideMassProperties values to avoid clashes +//constexpr EOverrideMassProperties EOverrideMassProperties_CalculateMassAndInertia = EOverrideMassProperties::CalculateMassAndInertia; +//constexpr EOverrideMassProperties EOverrideMassProperties_CalculateInertia = EOverrideMassProperties::CalculateInertia; +//constexpr EOverrideMassProperties EOverrideMassProperties_MassAndInertiaProvided = EOverrideMassProperties::MassAndInertiaProvided; +// +//// Alias for EAllowedDOFs values to avoid clashes +//constexpr EAllowedDOFs EAllowedDOFs_TranslationX = EAllowedDOFs::TranslationX; +//constexpr EAllowedDOFs EAllowedDOFs_TranslationY = EAllowedDOFs::TranslationY; +//constexpr EAllowedDOFs EAllowedDOFs_TranslationZ = EAllowedDOFs::TranslationZ; +//constexpr EAllowedDOFs EAllowedDOFs_RotationX = EAllowedDOFs::RotationX; +//constexpr EAllowedDOFs EAllowedDOFs_RotationY = EAllowedDOFs::RotationY; +//constexpr EAllowedDOFs EAllowedDOFs_RotationZ = EAllowedDOFs::RotationZ; +//constexpr EAllowedDOFs EAllowedDOFs_Plane2D = EAllowedDOFs::Plane2D; +//constexpr EAllowedDOFs EAllowedDOFs_All = EAllowedDOFs::All; +// +//// Alias for EStateRecorderState values to avoid clashes +//constexpr EStateRecorderState EStateRecorderState_None = EStateRecorderState::None; +//constexpr EStateRecorderState EStateRecorderState_Global = EStateRecorderState::Global; +//constexpr EStateRecorderState EStateRecorderState_Bodies = EStateRecorderState::Bodies; +//constexpr EStateRecorderState EStateRecorderState_Contacts = EStateRecorderState::Contacts; +//constexpr EStateRecorderState EStateRecorderState_Constraints = EStateRecorderState::Constraints; +//constexpr EStateRecorderState EStateRecorderState_All = EStateRecorderState::All; +// +//// Alias for EBackFaceMode values to avoid clashes +//constexpr EBackFaceMode EBackFaceMode_IgnoreBackFaces = EBackFaceMode::IgnoreBackFaces; +//constexpr EBackFaceMode EBackFaceMode_CollideWithBackFaces = EBackFaceMode::CollideWithBackFaces; +// +//// Alias for EGroundState values to avoid clashes +//constexpr EGroundState EGroundState_OnGround = EGroundState::OnGround; +//constexpr EGroundState EGroundState_OnSteepGround = EGroundState::OnSteepGround; +//constexpr EGroundState EGroundState_NotSupported = EGroundState::NotSupported; +//constexpr EGroundState EGroundState_InAir = EGroundState::InAir; +// +//// Alias for ValidateResult values to avoid clashes +//constexpr ValidateResult ValidateResult_AcceptAllContactsForThisBodyPair = ValidateResult::AcceptAllContactsForThisBodyPair; +//constexpr ValidateResult ValidateResult_AcceptContact = ValidateResult::AcceptContact; +//constexpr ValidateResult ValidateResult_RejectContact = ValidateResult::RejectContact; +//constexpr ValidateResult ValidateResult_RejectAllContactsForThisBodyPair = ValidateResult::RejectAllContactsForThisBodyPair; +// +//// Alias for SoftBodyValidateResult values to avoid clashes +//constexpr SoftBodyValidateResult SoftBodyValidateResult_AcceptContact = SoftBodyValidateResult::AcceptContact; +//constexpr SoftBodyValidateResult SoftBodyValidateResult_RejectContact = SoftBodyValidateResult::RejectContact; +// +//// Alias for EActiveEdgeMode values to avoid clashes +//constexpr EActiveEdgeMode EActiveEdgeMode_CollideOnlyWithActive = EActiveEdgeMode::CollideOnlyWithActive; +//constexpr EActiveEdgeMode EActiveEdgeMode_CollideWithAll = EActiveEdgeMode::CollideWithAll; +// +//// Alias for ECollectFacesMode values to avoid clashes +//constexpr ECollectFacesMode ECollectFacesMode_CollectFaces = ECollectFacesMode::CollectFaces; +//constexpr ECollectFacesMode ECollectFacesMode_NoFaces = ECollectFacesMode::NoFaces; +// +//// Alias for EConstraintType values to avoid clashes +//constexpr EConstraintType EConstraintType_Constraint = EConstraintType::Constraint; +//constexpr EConstraintType EConstraintType_TwoBodyConstraint = EConstraintType::TwoBodyConstraint; +// +//// Alias for EConstraintSubType values to avoid clashes +//constexpr EConstraintSubType EConstraintSubType_Fixed = EConstraintSubType::Fixed; +//constexpr EConstraintSubType EConstraintSubType_Point = EConstraintSubType::Point; +//constexpr EConstraintSubType EConstraintSubType_Hinge = EConstraintSubType::Hinge; +//constexpr EConstraintSubType EConstraintSubType_Slider = EConstraintSubType::Slider; +//constexpr EConstraintSubType EConstraintSubType_Distance = EConstraintSubType::Distance; +//constexpr EConstraintSubType EConstraintSubType_Cone = EConstraintSubType::Cone; +//constexpr EConstraintSubType EConstraintSubType_SwingTwist = EConstraintSubType::SwingTwist; +//constexpr EConstraintSubType EConstraintSubType_SixDOF = EConstraintSubType::SixDOF; +//constexpr EConstraintSubType EConstraintSubType_Path = EConstraintSubType::Path; +//constexpr EConstraintSubType EConstraintSubType_Vehicle = EConstraintSubType::Vehicle; +//constexpr EConstraintSubType EConstraintSubType_RackAndPinion = EConstraintSubType::RackAndPinion; +//constexpr EConstraintSubType EConstraintSubType_Gear = EConstraintSubType::Gear; +//constexpr EConstraintSubType EConstraintSubType_Pulley = EConstraintSubType::Pulley; +// +///// Alias for EPathRotationConstraintType to avoid clash +//constexpr EPathRotationConstraintType EPathRotationConstraintType_Free = EPathRotationConstraintType::Free; +//constexpr EPathRotationConstraintType EPathRotationConstraintType_ConstrainAroundTangent = EPathRotationConstraintType::ConstrainAroundTangent; +//constexpr EPathRotationConstraintType EPathRotationConstraintType_ConstrainAroundNormal = EPathRotationConstraintType::ConstrainAroundNormal; +//constexpr EPathRotationConstraintType EPathRotationConstraintType_ConstrainAroundBinormal = EPathRotationConstraintType::ConstrainAroundBinormal; +//constexpr EPathRotationConstraintType EPathRotationConstraintType_ConstrainToPath = EPathRotationConstraintType::ConstrainToPath; +//constexpr EPathRotationConstraintType EPathRotationConstraintType_FullyConstrained = EPathRotationConstraintType::FullyConstrained; +// +//// Alias for SixDOFConstraintSettings::EAxis to avoid clashes +//using SixDOFConstraintSettings_EAxis = SixDOFConstraintSettings::EAxis; +//constexpr SixDOFConstraintSettings_EAxis SixDOFConstraintSettings_EAxis_TranslationX = SixDOFConstraintSettings_EAxis::TranslationX; +//constexpr SixDOFConstraintSettings_EAxis SixDOFConstraintSettings_EAxis_TranslationY = SixDOFConstraintSettings_EAxis::TranslationY; +//constexpr SixDOFConstraintSettings_EAxis SixDOFConstraintSettings_EAxis_TranslationZ = SixDOFConstraintSettings_EAxis::TranslationZ; +//constexpr SixDOFConstraintSettings_EAxis SixDOFConstraintSettings_EAxis_RotationX = SixDOFConstraintSettings_EAxis::RotationX; +//constexpr SixDOFConstraintSettings_EAxis SixDOFConstraintSettings_EAxis_RotationY = SixDOFConstraintSettings_EAxis::RotationY; +//constexpr SixDOFConstraintSettings_EAxis SixDOFConstraintSettings_EAxis_RotationZ = SixDOFConstraintSettings_EAxis::RotationZ; +// +//// Alias for EMotorState values to avoid clashes +//constexpr EMotorState EMotorState_Off = EMotorState::Off; +//constexpr EMotorState EMotorState_Velocity = EMotorState::Velocity; +//constexpr EMotorState EMotorState_Position = EMotorState::Position; +// +//// Alias for ETransmissionMode values to avoid clashes +//constexpr ETransmissionMode ETransmissionMode_Auto = ETransmissionMode::Auto; +//constexpr ETransmissionMode ETransmissionMode_Manual = ETransmissionMode::Manual; +// +//// Defining ETireFrictionDirection since we cannot pass references to float +//enum ETireFrictionDirection +//{ +// ETireFrictionDirection_Longitudinal, +// ETireFrictionDirection_Lateral +//}; +// +//// Alias for ESwingType values to avoid clashes +//constexpr ESwingType ESwingType_Cone = ESwingType::Cone; +//constexpr ESwingType ESwingType_Pyramid = ESwingType::Pyramid; +// +//// Alias for EBendType values to avoid clashes +//using SoftBodySharedSettings_EBendType = SoftBodySharedSettings::EBendType; +//constexpr SoftBodySharedSettings_EBendType SoftBodySharedSettings_EBendType_None = SoftBodySharedSettings::EBendType::None; +//constexpr SoftBodySharedSettings_EBendType SoftBodySharedSettings_EBendType_Distance = SoftBodySharedSettings::EBendType::Distance; +//constexpr SoftBodySharedSettings_EBendType SoftBodySharedSettings_EBendType_Dihedral = SoftBodySharedSettings::EBendType::Dihedral; +// +//// Alias for ELRAType values to avoid clashes +//using SoftBodySharedSettings_ELRAType = SoftBodySharedSettings::ELRAType; +//constexpr SoftBodySharedSettings_ELRAType SoftBodySharedSettings_ELRAType_None = SoftBodySharedSettings::ELRAType::None; +//constexpr SoftBodySharedSettings_ELRAType SoftBodySharedSettings_ELRAType_EuclideanDistance = SoftBodySharedSettings::ELRAType::EuclideanDistance; +//constexpr SoftBodySharedSettings_ELRAType SoftBodySharedSettings_ELRAType_GeodesicDistance = SoftBodySharedSettings::ELRAType::GeodesicDistance; +// +//// Helper class to store information about the memory layout of SoftBodyVertex +//class SoftBodyVertexTraits +//{ +//public: +// static constexpr uint mPreviousPositionOffset = offsetof(SoftBodyVertex, mPreviousPosition); +// static constexpr uint mPositionOffset = offsetof(SoftBodyVertex, mPosition); +// static constexpr uint mVelocityOffset = offsetof(SoftBodyVertex, mVelocity); +//}; +// +//// Callback for traces +//static void TraceImpl(const char *inFMT, ...) +//{ +// // Format the message +// va_list list; +// va_start(list, inFMT); +// char buffer[1024]; +// vsnprintf(buffer, sizeof(buffer), inFMT, list); +// +// // Print to the TTY +// cout << buffer << endl; +//} +// +//#ifdef JPH_ENABLE_ASSERTS +// +//// Callback for asserts +//static bool AssertFailedImpl(const char *inExpression, const char *inMessage, const char *inFile, uint inLine) +//{ +// // Print to the TTY +// cout << inFile << ":" << inLine << ": (" << inExpression << ") " << (inMessage != nullptr? inMessage : "") << endl; +// +// // Breakpoint +// return true; +//}; +// +//#endif // JPH_ENABLE_ASSERTS +// +///// Settings to pass to constructor +//class JoltSettings +//{ +//public: +// uint mMaxBodies = 10240; +// uint mMaxBodyPairs = 65536; +// uint mMaxContactConstraints = 10240; +// uint mTempAllocatorSize = 10 * 1024 * 1024; +// BroadPhaseLayerInterface *mBroadPhaseLayerInterface = nullptr; +// ObjectVsBroadPhaseLayerFilter *mObjectVsBroadPhaseLayerFilter = nullptr; +// ObjectLayerPairFilter * mObjectLayerPairFilter = nullptr; +//}; +// +///// Main API for JavaScript +////class JoltInterface +////{ +////public: +//// /// Constructor +//// JoltInterface(const JoltSettings &inSettings) +//// { +//// // Install callbacks +//// Trace = TraceImpl; +//// JPH_IF_ENABLE_ASSERTS(AssertFailed = AssertFailedImpl;) +//// +//// // Create a factory +//// Factory::sInstance = new Factory(); +//// +//// // Register all Jolt physics types +//// RegisterTypes(); +//// +//// // Init temp allocator +//// mTempAllocator = new TempAllocatorImpl(inSettings.mTempAllocatorSize); +//// +//// // Check required objects +//// if (inSettings.mBroadPhaseLayerInterface == nullptr || inSettings.mObjectVsBroadPhaseLayerFilter == nullptr || inSettings.mObjectLayerPairFilter == nullptr) +//// Trace("Error: BroadPhaseLayerInterface, ObjectVsBroadPhaseLayerFilter and ObjectLayerPairFilter must be provided"); +//// +//// // Store interfaces +//// mBroadPhaseLayerInterface = inSettings.mBroadPhaseLayerInterface; +//// mObjectVsBroadPhaseLayerFilter = inSettings.mObjectVsBroadPhaseLayerFilter; +//// mObjectLayerPairFilter = inSettings.mObjectLayerPairFilter; +//// +//// // Init the physics system +//// constexpr uint cNumBodyMutexes = 0; +//// mPhysicsSystem = new PhysicsSystem(); +//// mPhysicsSystem->Init(inSettings.mMaxBodies, cNumBodyMutexes, inSettings.mMaxBodyPairs, inSettings.mMaxContactConstraints, *inSettings.mBroadPhaseLayerInterface, *inSettings.mObjectVsBroadPhaseLayerFilter, *inSettings.mObjectLayerPairFilter); +//// } +//// +//// /// Destructor +//// ~JoltInterface() +//// { +//// // Destroy subsystems +//// delete mPhysicsSystem; +//// delete mBroadPhaseLayerInterface; +//// delete mObjectVsBroadPhaseLayerFilter; +//// delete mObjectLayerPairFilter; +//// delete mTempAllocator; +//// delete Factory::sInstance; +//// Factory::sInstance = nullptr; +//// UnregisterTypes(); +//// } +//// +//// /// Step the world +//// void Step(float inDeltaTime, int inCollisionSteps) +//// { +//// mPhysicsSystem->Update(inDeltaTime, inCollisionSteps, mTempAllocator, &mJobSystem); +//// } +//// +//// /// Access to the physics system +//// PhysicsSystem * GetPhysicsSystem() +//// { +//// return mPhysicsSystem; +//// } +//// +//// /// Access to the temp allocator +//// TempAllocator * GetTempAllocator() +//// { +//// return mTempAllocator; +//// } +//// +//// /// Access the default object layer pair filter +//// ObjectLayerPairFilter *GetObjectLayerPairFilter() +//// { +//// return mObjectLayerPairFilter; +//// } +//// +//// /// Access the default object vs broadphase layer filter +//// ObjectVsBroadPhaseLayerFilter *GetObjectVsBroadPhaseLayerFilter() +//// { +//// return mObjectVsBroadPhaseLayerFilter; +//// } +//// +//// /// Get the total reserved memory in bytes +//// /// See: https://github.com/emscripten-core/emscripten/blob/7459cab167138419168b5ac5eacf74702d5a3dae/test/core/test_mallinfo.c#L16-L18 +//// static size_t sGetTotalMemory() +//// { +//// return (size_t)EM_ASM_PTR(return HEAP8.length); +//// } +//// +//// /// Get the amount of free memory in bytes +//// /// See: https://github.com/emscripten-core/emscripten/blob/7459cab167138419168b5ac5eacf74702d5a3dae/test/core/test_mallinfo.c#L20-L25 +//// static size_t sGetFreeMemory() +//// { +//// struct mallinfo i = mallinfo(); +//// uintptr_t total_memory = sGetTotalMemory(); +//// uintptr_t dynamic_top = (uintptr_t)sbrk(0); +//// return total_memory - dynamic_top + i.fordblks; +//// } +//// +////private: +//// TempAllocatorImpl * mTempAllocator; +//// JobSystemThreadPool mJobSystem { cMaxPhysicsJobs, cMaxPhysicsBarriers, min(thread::hardware_concurrency() - 1, 16) }; // Limit to 16 threads since we limit the webworker thread pool size to this as well +//// BroadPhaseLayerInterface *mBroadPhaseLayerInterface = nullptr; +//// ObjectVsBroadPhaseLayerFilter *mObjectVsBroadPhaseLayerFilter = nullptr; +//// ObjectLayerPairFilter * mObjectLayerPairFilter = nullptr; +//// PhysicsSystem * mPhysicsSystem = nullptr; +////}; +// +///// Helper class to extract triangles from the shape +//class ShapeGetTriangles +//{ +//public: +// ShapeGetTriangles(const Shape *inShape, const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale) +// { +// const size_t cBlockSize = 8096; +// +// // First collect all leaf shapes +// AllHitCollisionCollector collector; +// inShape->CollectTransformedShapes(inBox, inPositionCOM, inRotation, inScale, SubShapeIDCreator(), collector, { }); +// +// size_t cur_pos = 0; +// +// // Iterate the leaf shapes +// for (const TransformedShape &ts : collector.mHits) +// { +// // Start iterating triangles +// Shape::GetTrianglesContext context; +// ts.GetTrianglesStart(context, inBox, RVec3::sZero()); +// +// for (;;) +// { +// // Ensure we have space to get more triangles +// size_t tri_left = mMaterials.size() - cur_pos; +// if (tri_left < Shape::cGetTrianglesMinTrianglesRequested) +// { +// mVertices.resize(mVertices.size() + 3 * cBlockSize); +// mMaterials.resize(mMaterials.size() + cBlockSize); +// tri_left = mMaterials.size() - cur_pos; +// } +// +// // Fetch next batch +// int count = ts.GetTrianglesNext(context, tri_left, mVertices.data() + 3 * cur_pos, mMaterials.data() + cur_pos); +// if (count == 0) +// { +// // We're done +// mVertices.resize(3 * cur_pos); +// mMaterials.resize(cur_pos); +// break; +// } +// +// cur_pos += count; +// } +// } +// +// // Free excess memory +// mVertices.shrink_to_fit(); +// mMaterials.shrink_to_fit(); +// } +// +// int GetNumTriangles() const +// { +// return (int)mMaterials.size(); +// } +// +// int GetVerticesSize() const +// { +// return (int)mVertices.size() * sizeof(Float3); +// } +// +// const Float3 * GetVerticesData() const +// { +// return mVertices.data(); +// } +// +// const PhysicsMaterial * GetMaterial(int inTriangle) const +// { +// return mMaterials[inTriangle]; +// } +// +//private: +// Array mVertices; +// Array mMaterials; +//}; +// +///// A wrapper around ContactListener that is compatible with JavaScript +//class ContactListenerEm: public ContactListener +//{ +//public: +// // JavaScript compatible virtual functions +// virtual int OnContactValidate(const Body &inBody1, const Body &inBody2, const RVec3 *inBaseOffset, const CollideShapeResult &inCollisionResult) = 0; +// +// // Functions that call the JavaScript compatible virtual functions +// virtual ValidateResult OnContactValidate(const Body &inBody1, const Body &inBody2, RVec3Arg inBaseOffset, const CollideShapeResult &inCollisionResult) override +// { +// return (ValidateResult)OnContactValidate(inBody1, inBody2, &inBaseOffset, inCollisionResult); +// } +//}; +// +///// A wrapper around SoftBodyContactListener that is compatible with JavaScript +//class SoftBodyContactListenerEm: public SoftBodyContactListener +//{ +//public: +// // JavaScript compatible virtual functions +// virtual int OnSoftBodyContactValidate(const Body &inSoftBody, const Body &inOtherBody, SoftBodyContactSettings *ioSettings) = 0; +// +// // Functions that call the JavaScript compatible virtual functions +// virtual SoftBodyValidateResult OnSoftBodyContactValidate(const Body &inSoftBody, const Body &inOtherBody, SoftBodyContactSettings &ioSettings) +// { +// return (SoftBodyValidateResult)OnSoftBodyContactValidate(inSoftBody, inOtherBody, &ioSettings); +// } +//}; +// +///// A wrapper around CharacterContactListener that is compatible with JavaScript +//class CharacterContactListenerEm: public CharacterContactListener +//{ +//public: +// // JavaScript compatible virtual functions +// virtual void OnContactAdded(const CharacterVirtual *inCharacter, const BodyID &inBodyID2, const SubShapeID &inSubShapeID2, const RVec3 *inContactPosition, const Vec3 *inContactNormal, CharacterContactSettings &ioSettings) = 0; +// virtual void OnCharacterContactAdded(const CharacterVirtual *inCharacter, const CharacterVirtual *inOtherCharacter, const SubShapeID &inSubShapeID2, const RVec3 *inContactPosition, const Vec3 *inContactNormal, CharacterContactSettings &ioSettings) = 0; +// virtual void OnContactSolve(const CharacterVirtual *inCharacter, const BodyID &inBodyID2, const SubShapeID &inSubShapeID2, const RVec3 *inContactPosition, const Vec3 *inContactNormal, const Vec3 *inContactVelocity, const PhysicsMaterial *inContactMaterial, const Vec3 *inCharacterVelocity, Vec3 &ioNewCharacterVelocity) = 0; +// virtual void OnCharacterContactSolve(const CharacterVirtual *inCharacter, const CharacterVirtual *inOtherCharacter, const SubShapeID &inSubShapeID2, const RVec3 *inContactPosition, const Vec3 *inContactNormal, const Vec3 *inContactVelocity, const PhysicsMaterial *inContactMaterial, const Vec3 *inCharacterVelocity, Vec3 &ioNewCharacterVelocity) = 0; +// +// // Functions that call the JavaScript compatible virtual functions +// virtual void OnContactAdded(const CharacterVirtual *inCharacter, const BodyID &inBodyID2, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, CharacterContactSettings &ioSettings) override +// { +// OnContactAdded(inCharacter, inBodyID2, inSubShapeID2, &inContactPosition, &inContactNormal, ioSettings); +// } +// +// virtual void OnCharacterContactAdded(const CharacterVirtual *inCharacter, const CharacterVirtual *inOtherCharacter, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, CharacterContactSettings &ioSettings) override +// { +// OnCharacterContactAdded(inCharacter, inOtherCharacter, inSubShapeID2, &inContactPosition, &inContactNormal, ioSettings); +// } +// +// virtual void OnContactSolve(const CharacterVirtual *inCharacter, const BodyID &inBodyID2, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, Vec3Arg inContactVelocity, const PhysicsMaterial *inContactMaterial, Vec3Arg inCharacterVelocity, Vec3 &ioNewCharacterVelocity) override +// { +// OnContactSolve(inCharacter, inBodyID2, inSubShapeID2, &inContactPosition, &inContactNormal, &inContactVelocity, inContactMaterial, &inCharacterVelocity, ioNewCharacterVelocity); +// } +// +// virtual void OnCharacterContactSolve(const CharacterVirtual *inCharacter, const CharacterVirtual *inOtherCharacter, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, Vec3Arg inContactVelocity, const PhysicsMaterial *inContactMaterial, Vec3Arg inCharacterVelocity, Vec3 &ioNewCharacterVelocity) override +// { +// OnCharacterContactSolve(inCharacter, inOtherCharacter, inSubShapeID2, &inContactPosition, &inContactNormal, &inContactVelocity, inContactMaterial, &inCharacterVelocity, ioNewCharacterVelocity); +// } +//}; +// +///// A wrapper around the physics step listener that is compatible with JavaScript (JS doesn't like multiple inheritance) +//class VehicleConstraintStepListener : public PhysicsStepListener +//{ +//public: +// VehicleConstraintStepListener(VehicleConstraint *inVehicleConstraint) +// { +// mInstance = inVehicleConstraint; +// } +// +// virtual void OnStep(float inDeltaTime, PhysicsSystem &inPhysicsSystem) override +// { +// PhysicsStepListener* instance = mInstance; +// instance->OnStep(inDeltaTime, inPhysicsSystem); +// } +// +//private: +// VehicleConstraint * mInstance; +//}; +// +///// Wrapper class around ObjectVsBroadPhaseLayerFilter to make it compatible with JavaScript (JS cannot pass parameter by value) +//class ObjectVsBroadPhaseLayerFilterEm : public ObjectVsBroadPhaseLayerFilter +//{ +//public: +// virtual bool ShouldCollide(ObjectLayer inLayer1, BroadPhaseLayer *inLayer2) const = 0; +// +// virtual bool ShouldCollide(ObjectLayer inLayer1, BroadPhaseLayer inLayer2) const +// { +// return ShouldCollide(inLayer1, &inLayer2); +// } +//}; +// +///// Wrapper class around BroadPhaseLayerInterface to make it compatible with JavaScript (JS cannot return parameter by value) +//class BroadPhaseLayerInterfaceEm : public BroadPhaseLayerInterface +//{ +//public: +// virtual unsigned short GetBPLayer(ObjectLayer inLayer) const = 0; +// +// virtual BroadPhaseLayer GetBroadPhaseLayer(ObjectLayer inLayer) const override +// { +// return BroadPhaseLayer(GetBPLayer(inLayer)); +// } +// +//#if defined(JPH_EXTERNAL_PROFILE) || defined(JPH_PROFILE_ENABLED) +// /// Get the user readable name of a broadphase layer (debugging purposes) +// virtual const char * GetBroadPhaseLayerName(BroadPhaseLayer inLayer) const override +// { +// return "Undefined"; +// } +//#endif // JPH_EXTERNAL_PROFILE || JPH_PROFILE_ENABLED +//}; +// +///// A wrapper around the vehicle constraint callbacks that is compatible with JavaScript +//class VehicleConstraintCallbacksEm +//{ +//public: +// virtual ~VehicleConstraintCallbacksEm() = default; +// +// void SetVehicleConstraint(VehicleConstraint &inConstraint) +// { +// inConstraint.SetCombineFriction([this](uint inWheelIndex, float &ioLongitudinalFriction, float &ioLateralFriction, const Body &inBody2, const SubShapeID &inSubShapeID2) { +// ioLongitudinalFriction = GetCombinedFriction(inWheelIndex, ETireFrictionDirection_Longitudinal, ioLongitudinalFriction, inBody2, inSubShapeID2); +// ioLateralFriction = GetCombinedFriction(inWheelIndex, ETireFrictionDirection_Lateral, ioLateralFriction, inBody2, inSubShapeID2); +// }); +// inConstraint.SetPreStepCallback([this](VehicleConstraint &inVehicle, float inDeltaTime, PhysicsSystem &inPhysicsSystem) { +// OnPreStepCallback(inVehicle, inDeltaTime, inPhysicsSystem); +// }); +// inConstraint.SetPostCollideCallback([this](VehicleConstraint &inVehicle, float inDeltaTime, PhysicsSystem &inPhysicsSystem) { +// OnPostCollideCallback(inVehicle, inDeltaTime, inPhysicsSystem); +// }); +// inConstraint.SetPostStepCallback([this](VehicleConstraint &inVehicle, float inDeltaTime, PhysicsSystem &inPhysicsSystem) { +// OnPostStepCallback(inVehicle, inDeltaTime, inPhysicsSystem); +// }); +// } +// +// virtual float GetCombinedFriction(unsigned int inWheelIndex, ETireFrictionDirection inTireFrictionDirection, float inTireFriction, const Body &inBody2, const SubShapeID &inSubShapeID2) = 0; +// virtual void OnPreStepCallback(VehicleConstraint &inVehicle, float inDeltaTime, PhysicsSystem &inPhysicsSystem) = 0; +// virtual void OnPostCollideCallback(VehicleConstraint &inVehicle, float inDeltaTime, PhysicsSystem &inPhysicsSystem) = 0; +// virtual void OnPostStepCallback(VehicleConstraint &inVehicle, float inDeltaTime, PhysicsSystem &inPhysicsSystem) = 0; +//}; +// +///// The tire max impulse callback returns multiple parameters, so we need to store them in a class +//class TireMaxImpulseCallbackResult +//{ +//public: +// float mLongitudinalImpulse; +// float mLateralImpulse; +//}; +// +///// A wrapper around the wheeled vehicle controller callbacks that is compatible with JavaScript +//class WheeledVehicleControllerCallbacksEm +//{ +//public: +// virtual ~WheeledVehicleControllerCallbacksEm() = default; +// +// void SetWheeledVehicleController(WheeledVehicleController &inController) +// { +// inController.SetTireMaxImpulseCallback([this](uint inWheelIndex, float &outLongitudinalImpulse, float &outLateralImpulse, float inSuspensionImpulse, float inLongitudinalFriction, float inLateralFriction, float inLongitudinalSlip, float inLateralSlip, float inDeltaTime) { +// // Pre-fill the structure with default calculated values +// TireMaxImpulseCallbackResult result; +// result.mLongitudinalImpulse = inLongitudinalFriction * inSuspensionImpulse; +// result.mLateralImpulse = inLateralFriction * inSuspensionImpulse; +// +// OnTireMaxImpulseCallback(inWheelIndex, &result, inSuspensionImpulse, inLongitudinalFriction, inLateralFriction, inLongitudinalSlip, inLateralSlip, inDeltaTime); +// +// // Read the results +// outLongitudinalImpulse = result.mLongitudinalImpulse; +// outLateralImpulse = result.mLateralImpulse; +// }); +// } +// +// virtual void OnTireMaxImpulseCallback(uint inWheelIndex, TireMaxImpulseCallbackResult *outResult, float inSuspensionImpulse, float inLongitudinalFriction, float inLateralFriction, float inLongitudinalSlip, float inLateralSlip, float inDeltaTime) = 0; +//}; +// +//class PathConstraintPathEm: public PathConstraintPath +//{ +//public: +// virtual float GetClosestPoint(Vec3Arg inPosition, float inFractionHint) const +// { +// return GetClosestPoint(&inPosition, inFractionHint); +// } +// +// virtual void GetPointOnPath(float inFraction, Vec3 &outPathPosition, Vec3 &outPathTangent, Vec3 &outPathNormal, Vec3 &outPathBinormal) const +// { +// GetPointOnPath(inFraction, &outPathPosition, &outPathTangent, &outPathNormal, &outPathBinormal); +// } +// +// virtual float GetClosestPoint(const Vec3 *inPosition, float inFractionHint) const = 0; +// virtual void GetPointOnPath(float inFraction, Vec3 *outPathPosition, Vec3 *outPathTangent, Vec3 *outPathNormal, Vec3 *outPathBinormal) const = 0; +//}; +// +//class HeightFieldShapeConstantValues +//{ +//public: +// /// Value used to create gaps in the height field +// static constexpr float cNoCollisionValue = HeightFieldShapeConstants::cNoCollisionValue; +//}; \ No newline at end of file diff --git a/jolt/jolt-build/src/main/cpp/jolt.idl b/jolt/jolt-build/src/main/cpp/jolt.idl new file mode 100644 index 0000000..52827e8 --- /dev/null +++ b/jolt/jolt-build/src/main/cpp/jolt.idl @@ -0,0 +1,3567 @@ +//interface JPHString { +// void JPHString(DOMString str, long length); +// [Const] DOMString c_str(); // TODO: This is not a nice way to get a string from an interface +// unsigned long size(); +//}; +// +interface ArrayVec3 { + boolean empty(); + long size(); + [Ref] Vec3 at(long inIndex); + void push_back([Const, Ref] Vec3 inValue); + void reserve(unsigned long inSize); + void resize(unsigned long inSize); + void clear(); + Vec3MemRef data(); +}; + +//interface ArrayQuat { +// boolean empty(); +// long size(); +// [Ref] Quat at(long inIndex); +// void push_back([Const, Ref] Quat inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +// QuatMemRef data(); +//}; +// +//interface ArrayMat44 { +// boolean empty(); +// long size(); +// [Ref] Mat44 at(long inIndex); +// void push_back([Const, Ref] Mat44 inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +// Mat44MemRef data(); +//}; +// +//enum EBodyType { +// "EBodyType_RigidBody", +// "EBodyType_SoftBody" +//}; +// +//enum EMotionType { +// "EMotionType_Static", +// "EMotionType_Kinematic", +// "EMotionType_Dynamic" +//}; +// +//enum EMotionQuality { +// "EMotionQuality_Discrete", +// "EMotionQuality_LinearCast" +//}; +// +//enum EActivation { +// "EActivation_Activate", +// "EActivation_DontActivate" +//}; +// +//enum EShapeType { +// "EShapeType_Convex", +// "EShapeType_Compound", +// "EShapeType_Decorated", +// "EShapeType_Mesh", +// "EShapeType_HeightField" +//}; +// +//enum EShapeSubType { +// "EShapeSubType_Sphere", +// "EShapeSubType_Box", +// "EShapeSubType_Capsule", +// "EShapeSubType_TaperedCapsule", +// "EShapeSubType_Cylinder", +// "EShapeSubType_ConvexHull", +// "EShapeSubType_StaticCompound", +// "EShapeSubType_MutableCompound", +// "EShapeSubType_RotatedTranslated", +// "EShapeSubType_Scaled", +// "EShapeSubType_OffsetCenterOfMass", +// "EShapeSubType_Mesh", +// "EShapeSubType_HeightField" +//}; +// +//enum EConstraintSpace { +// "EConstraintSpace_LocalToBodyCOM", +// "EConstraintSpace_WorldSpace" +//}; +// +//enum ESpringMode { +// "ESpringMode_FrequencyAndDamping", +// "ESpringMode_StiffnessAndDamping", +//}; +// +//enum EOverrideMassProperties { +// "EOverrideMassProperties_CalculateMassAndInertia", +// "EOverrideMassProperties_CalculateInertia", +// "EOverrideMassProperties_MassAndInertiaProvided" +//}; +// +//enum EAllowedDOFs { +// "EAllowedDOFs_TranslationX", +// "EAllowedDOFs_TranslationY", +// "EAllowedDOFs_TranslationZ", +// "EAllowedDOFs_RotationX", +// "EAllowedDOFs_RotationY", +// "EAllowedDOFs_RotationZ", +// "EAllowedDOFs_Plane2D", +// "EAllowedDOFs_All" +//}; +// +//enum EStateRecorderState { +// "EStateRecorderState_None", +// "EStateRecorderState_Global", +// "EStateRecorderState_Bodies", +// "EStateRecorderState_Contacts", +// "EStateRecorderState_Constraints", +// "EStateRecorderState_All" +//}; +// +//enum EBackFaceMode { +// "EBackFaceMode_IgnoreBackFaces", +// "EBackFaceMode_CollideWithBackFaces" +//}; +// +//enum EGroundState { +// "EGroundState_OnGround", +// "EGroundState_OnSteepGround", +// "EGroundState_NotSupported", +// "EGroundState_InAir" +//}; +// +//enum ValidateResult { +// "ValidateResult_AcceptAllContactsForThisBodyPair", +// "ValidateResult_AcceptContact", +// "ValidateResult_RejectContact", +// "ValidateResult_RejectAllContactsForThisBodyPair" +//}; +// +//enum SoftBodyValidateResult { +// "SoftBodyValidateResult_AcceptContact", +// "SoftBodyValidateResult_RejectContact", +//}; +// +//enum EActiveEdgeMode { +// "EActiveEdgeMode_CollideOnlyWithActive", +// "EActiveEdgeMode_CollideWithAll" +//}; +// +//enum ECollectFacesMode { +// "ECollectFacesMode_CollectFaces", +// "ECollectFacesMode_NoFaces" +//}; +// +//enum SixDOFConstraintSettings_EAxis { +// "SixDOFConstraintSettings_EAxis_TranslationX", +// "SixDOFConstraintSettings_EAxis_TranslationY", +// "SixDOFConstraintSettings_EAxis_TranslationZ", +// "SixDOFConstraintSettings_EAxis_RotationX", +// "SixDOFConstraintSettings_EAxis_RotationY", +// "SixDOFConstraintSettings_EAxis_RotationZ" +//}; +// +//enum EConstraintType { +// "EConstraintType_Constraint", +// "EConstraintType_TwoBodyConstraint", +//}; +// +//enum EConstraintSubType { +// "EConstraintSubType_Fixed", +// "EConstraintSubType_Point", +// "EConstraintSubType_Hinge", +// "EConstraintSubType_Slider", +// "EConstraintSubType_Distance", +// "EConstraintSubType_Cone", +// "EConstraintSubType_SwingTwist", +// "EConstraintSubType_SixDOF", +// "EConstraintSubType_Path", +// "EConstraintSubType_Vehicle", +// "EConstraintSubType_RackAndPinion", +// "EConstraintSubType_Gear", +// "EConstraintSubType_Pulley", +//}; +// +//enum EMotorState { +// "EMotorState_Off", +// "EMotorState_Velocity", +// "EMotorState_Position" +//}; +// +//enum ETransmissionMode { +// "ETransmissionMode_Auto", +// "ETransmissionMode_Manual", +//}; +// +//enum ETireFrictionDirection { +// "ETireFrictionDirection_Longitudinal", +// "ETireFrictionDirection_Lateral", +//}; +// +//enum ESwingType { +// "ESwingType_Cone", +// "ESwingType_Pyramid", +//}; +// +//enum EPathRotationConstraintType { +// "EPathRotationConstraintType_Free", +// "EPathRotationConstraintType_ConstrainAroundTangent", +// "EPathRotationConstraintType_ConstrainAroundNormal", +// "EPathRotationConstraintType_ConstrainAroundBinormal", +// "EPathRotationConstraintType_ConstrainToPath", +// "EPathRotationConstraintType_FullyConstrained" +//}; +// +//enum SoftBodySharedSettings_EBendType { +// "SoftBodySharedSettings_EBendType_None", +// "SoftBodySharedSettings_EBendType_Distance", +// "SoftBodySharedSettings_EBendType_Dihedral" +//}; +// +//enum SoftBodySharedSettings_ELRAType { +// "SoftBodySharedSettings_ELRAType_None", +// "SoftBodySharedSettings_ELRAType_EuclideanDistance", +// "SoftBodySharedSettings_ELRAType_GeodesicDistance" +//}; +// +//interface Vec3MemRef { +//}; +// +//interface QuatMemRef { +//}; +// +//interface Mat44MemRef { +//}; +// +//interface FloatMemRef { +//}; +// +//interface Uint8MemRef { +//}; +// +//interface UintMemRef { +//}; +// +//interface Vec3 { +// void Vec3(); +// void Vec3([Const, Ref] Float3 inV); +// void Vec3(float inX, float inY, float inZ); +// [Value] static Vec3 sZero(); +// [Value] static Vec3 sAxisX(); +// [Value] static Vec3 sAxisY(); +// [Value] static Vec3 sAxisZ(); +// [Value] static Vec3 sReplicate(float inValue); +// [Value] static Vec3 sMin([Const, Ref] Vec3 inLHS, [Const, Ref] Vec3 inRHS); +// [Value] static Vec3 sMax([Const, Ref] Vec3 inLHS, [Const, Ref] Vec3 inRHS); +// [Value] static Vec3 sClamp([Const, Ref] Vec3 inValue, [Const, Ref] Vec3 inMin, [Const, Ref] Vec3 inMax); +// [Value] static Vec3 sUnitSpherical(float inTheta, float inPhi); +// [Operator="[]"] float GetComponent(unsigned long inCoordinate); +// [Operator="=="] boolean Equals([Const, Ref] Vec3 inV); +// [Operator="!="] boolean NotEquals([Const, Ref] Vec3 inV); +// float LengthSq(); +// float Length(); +// [Value] Vec3 Normalized(); +// [Value] Vec3 NormalizedOr([Const, Ref] Vec3 inZeroValue); +// [Value] Vec3 GetNormalizedPerpendicular(); +// float GetX(); +// float GetY(); +// float GetZ(); +// void SetX(float inX); +// void SetY(float inY); +// void SetZ(float inZ); +// void Set(float inX, float inY, float inZ); +// void SetComponent(unsigned long inCoordinate, float inValue); +// boolean IsNearZero(optional float inMaxDistSq); +// boolean IsClose([Const, Ref] Vec3 inV, optional float inMaxDistSq); +// boolean IsNormalized(optional float inTolerance); +// long GetLowestComponentIndex(); +// long GetHighestComponentIndex(); +// [Const, Value] Vec3 Abs(); +// [Const, Value] Vec3 Reciprocal(); +// [Const, Value] Vec3 Cross([Const, Ref] Vec3 inRHS); +// float Dot([Const, Ref] Vec3 inRHS); +// [Operator="+=", Ref] Vec3 Add([Const, Ref] Vec3 inV); +// [Operator="-=", Ref] Vec3 Sub([Const, Ref] Vec3 inV); +// [Operator="*=", Ref] Vec3 Mul(float inV); +// [Operator="/=", Ref] Vec3 Div(float inV); +// float ReduceMin(); +// float ReduceMax(); +// [Const, Value] Vec3 Sqrt(); +// [Const, Value] Vec3 GetSign(); +//}; +// +//interface RVec3 { +// void RVec3(); +// void RVec3(double inX, double inY, double inZ); +// [Value] static RVec3 sZero(); +// [Value] static RVec3 sAxisX(); +// [Value] static RVec3 sAxisY(); +// [Value] static RVec3 sAxisZ(); +// [Value] static RVec3 sReplicate(double inValue); +// [Value] static RVec3 sMin([Const, Ref] RVec3 inLHS, [Const, Ref] RVec3 inRHS); +// [Value] static RVec3 sMax([Const, Ref] RVec3 inLHS, [Const, Ref] RVec3 inRHS); +// [Value] static RVec3 sClamp([Const, Ref] RVec3 inValue, [Const, Ref] RVec3 inMin, [Const, Ref] RVec3 inMax); +// [Operator="[]"] double GetComponent(unsigned long inCoordinate); +// [Operator="=="] boolean Equals([Const, Ref] RVec3 inV); +// [Operator="!="] boolean NotEquals([Const, Ref] RVec3 inV); +// double LengthSq(); +// double Length(); +// [Value] RVec3 Normalized(); +// double GetX(); +// double GetY(); +// double GetZ(); +// void SetX(double inX); +// void SetY(double inY); +// void SetZ(double inZ); +// void Set(double inX, double inY, double inZ); +// void SetComponent(unsigned long inCoordinate, double inValue); +// boolean IsNearZero(optional double inMaxDistSq); +// boolean IsClose([Const, Ref] RVec3 inV, optional double inMaxDistSq); +// boolean IsNormalized(optional double inTolerance); +// [Const, Value] RVec3 Abs(); +// [Const, Value] RVec3 Reciprocal(); +// [Const, Value] RVec3 Cross([Const, Ref] RVec3 inRHS); +// double Dot([Const, Ref] RVec3 inRHS); +// [Operator="+=", Ref] RVec3 Add([Const, Ref] Vec3 inV); +// [Operator="-=", Ref] RVec3 Sub([Const, Ref] Vec3 inV); +// [Operator="*=", Ref] RVec3 Mul(double inV); +// [Operator="/=", Ref] RVec3 Div(double inV); +// [Const, Value] RVec3 Sqrt(); +// [Const, Value] RVec3 GetSign(); +//}; +// +//interface Vec4 { +// void Vec4(); +// void Vec4([Const, Ref] Vec4 inV); +// void Vec4([Ref] Vec3 inV, float inW); +// void Vec4(float inX, float inY, float inZ, float inW); +// float GetX(); +// float GetY(); +// float GetZ(); +// float GetW(); +// void SetX(float inX); +// void SetY(float inY); +// void SetZ(float inZ); +// void SetW(float inW); +// void Set(float inX, float inY, float inZ, float inW); +// [Operator="[]"] float GetComponent(unsigned long inCoordinate); +//}; +// +//interface Vector2 { +// void Vector2(); +// void SetZero(); +// void IsZero(); +// void IsClose([Const, Ref] Vector2 inV, optional float inMaxDistSq); +// void IsNormalized(optional float inTolerance); +// [Const, Value] Vector2 Normalized(); +// [Operator="[]"] float GetComponent(unsigned long inCoordinate); +// [Operator="+=", Ref] Vector2 Add([Const, Ref] Vector2 inV); +// [Operator="-=", Ref] Vector2 Sub([Const, Ref] Vector2 inV); +// [Operator="*=", Ref] Vector2 Mul(float inV); +// [Operator="/=", Ref] Vector2 Div(float inV); +// float Dot([Const, Ref] Vector2 inRHS); +//}; +// +//interface Quat { +// void Quat(); +// void Quat(float inX, float inY, float inZ, float inW); +// [Value] static Quat sZero(); +// [Value] static Quat sIdentity(); +// [Value] static Quat sRotation([Const, Ref] Vec3 inRotation, float inAngle); +// [Value] static Quat sFromTo([Const, Ref] Vec3 inFrom, [Const, Ref] Vec3 inTo); +// [Operator="=="] boolean Equals([Const, Ref] Quat inQ); +// [Operator="!="] boolean NotEquals([Const, Ref] Quat inQ); +// boolean IsClose([Const, Ref] Quat inQ, optional float inMaxDistSq); +// boolean IsNormalized(optional float inTolerance); +// float Length(); +// float LengthSq(); +// [Value] Quat Normalized(); +// [Value] static Quat sEulerAngles([Const, Ref] Vec3 inInput); +// [Const, Value] Vec3 GetEulerAngles(); +// float GetX(); +// float GetY(); +// float GetZ(); +// float GetW(); +// [Const, Value] Vec3 GetXYZ(); +// void SetX(float inX); +// void SetY(float inY); +// void SetZ(float inZ); +// void SetW(float inW); +// void Set(float inX, float inY, float inZ, float inW); +// [Const, Value] Vec3 InverseRotate([Const, Ref] Vec3 inV); +// [Const, Value] Vec3 RotateAxisX(); +// [Const, Value] Vec3 RotateAxisY(); +// [Const, Value] Vec3 RotateAxisZ(); +// float Dot([Const, Ref] Quat inQ); +// [Const, Value] Quat Conjugated(); +// [Const, Value] Quat Inversed(); +// [Const, Value] Quat EnsureWPositive(); +// [Const, Value] Quat GetPerpendicular(); +// float GetRotationAngle([Const, Ref] Vec3 inAxis); +// [Const, Value] Quat GetTwist([Const, Ref] Vec3 inAxis); +// void GetSwingTwist([Ref] Quat outSwing, [Ref] Quat outTwist); +// [Const, Value] Quat LERP([Const, Ref] Quat inDestination, float inFraction); +// [Const, Value] Quat SLERP([Const, Ref] Quat inDestination, float inFraction); +//}; +// +//interface Float3 { +// void Float3(float inX, float inY, float inZ); +// [Operator="=="] boolean Equals([Const, Ref] Float3 inV); +// [Operator="!="] boolean NotEquals([Const, Ref] Float3 inV); +// +// attribute float x; +// attribute float y; +// attribute float z; +//}; +// +//interface Mat44 { +// void Mat44(); +// [Value] static Mat44 sZero(); +// [Value] static Mat44 sIdentity(); +// [Value] static Mat44 sRotationX(float inX); +// [Value] static Mat44 sRotationY(float inY); +// [Value] static Mat44 sRotationZ(float inZ); +// [Value] static Mat44 sRotation([Const, Ref] Quat inQ); +// [Value] static Mat44 sTranslation([Const, Ref] Vec3 inTranslation); +// [Value] static Mat44 sRotationTranslation([Const, Ref] Quat inRotation, [Const, Ref] Vec3 inTranslation); +// [Value] static Mat44 sInverseRotationTranslation([Const, Ref] Quat inRotation, [Const, Ref] Vec3 inTranslation); +// [Value] static Mat44 sScale(float inScale); +// [Value] static Mat44 sPerspective(float inFovY, float inAspect, float inNear, float inFar); +// [Value] Vec3 GetAxisX(); +// [Value] Vec3 GetAxisY(); +// [Value] Vec3 GetAxisZ(); +// [Value] Mat44 GetRotation(); +// [Value] Quat GetQuaternion(); +// [Value] Vec3 GetTranslation(); +// boolean IsClose([Const, Ref] Mat44 inM, optional float inMaxDistSq); +// [Value] Vec3 Multiply3x3([Const, Ref] Vec3 inV); +// [Value] Vec3 Multiply3x3Transposed([Const, Ref] Vec3 inV); +// [Value] Mat44 Transposed(); +// [Value] Mat44 Transposed3x3(); +// [Value] Mat44 Inversed(); +// [Value] Mat44 InversedRotationTranslation(); +// float GetDeterminant3x3(); +// [Value] Mat44 Inversed3x3(); +// [Value] Mat44 GetDirectionPreservingMatrix(); +// [Value] Mat44 PreTranslated([Const, Ref] Vec3 inTranslation); +// [Value] Mat44 PostTranslated([Const, Ref] Vec3 inTranslation); +// [Value] Mat44 PreScaled([Const, Ref] Vec3 inScale); +// [Value] Mat44 PostScaled([Const, Ref] Vec3 inScale); +// void SetColumn3(long inCol, [Const, Ref] Vec3 inV); +// void SetAxisX([Const, Ref] Vec3 inV); +// void SetAxisY([Const, Ref] Vec3 inV); +// void SetAxisZ([Const, Ref] Vec3 inV); +// void SetTranslation([Const, Ref] Vec3 inV); +// void SetColumn4(long inCol, [Const, Ref] Vec4 inV); +// [Value] Vec4 GetColumn4(long inCol); +//}; +// +//interface RMat44 { +// void RMat44(); +// [Value] static RMat44 sZero(); +// [Value] static RMat44 sIdentity(); +// [Value] static RMat44 sRotation([Const, Ref] Quat inQ); +// [Value] static RMat44 sTranslation([Const, Ref] RVec3 inTranslation); +// [Value] static RMat44 sRotationTranslation([Const, Ref] Quat inRotation, [Const, Ref] RVec3 inTranslation); +// [Value] static RMat44 sInverseRotationTranslation([Const, Ref] Quat inRotation, [Const, Ref] RVec3 inTranslation); +// [Value] Vec3 GetAxisX(); +// [Value] Vec3 GetAxisY(); +// [Value] Vec3 GetAxisZ(); +// [Value] Mat44 GetRotation(); +// [Value] Quat GetQuaternion(); +// [Value] RVec3 GetTranslation(); +// boolean IsClose([Const, Ref] RMat44 inM, optional double inMaxDistSq); +// [Value] Vec3 Multiply3x3([Const, Ref] Vec3 inV); +// [Value] Vec3 Multiply3x3Transposed([Const, Ref] Vec3 inV); +// [Value] Mat44 Transposed3x3(); +// [Value] RMat44 Inversed(); +// [Value] RMat44 InversedRotationTranslation(); +// [Value] RMat44 PreTranslated([Const, Ref] Vec3 inTranslation); +// [Value] RMat44 PostTranslated([Const, Ref] Vec3 inTranslation); +// [Value] RMat44 PreScaled([Const, Ref] Vec3 inScale); +// [Value] RMat44 PostScaled([Const, Ref] Vec3 inScale); +// void SetColumn3(long inCol, [Const, Ref] Vec3 inV); +// void SetAxisX([Const, Ref] Vec3 inV); +// void SetAxisY([Const, Ref] Vec3 inV); +// void SetAxisZ([Const, Ref] Vec3 inV); +// void SetTranslation([Const, Ref] RVec3 inV); +// void SetColumn4(long inCol, [Const, Ref] Vec4 inV); +// [Value] Vec4 GetColumn4(long inCol); +//}; +// +//interface AABox { +// void AABox(); +// void AABox([Const, Ref] Vec3 inMin, [Const, Ref] Vec3 inMax); +// [Value] static AABox sBiggest(); +// +// [Value] attribute Vec3 mMin; +// [Value] attribute Vec3 mMax; +// boolean Overlaps([Const, Ref] AABox inOther); +//}; +// +//interface OrientedBox { +// void OrientedBox(); +// void OrientedBox([Const, Ref] Mat44 inOrientation, [Const, Ref] Vec3 inHalfExtents); +// +// [Value] attribute Mat44 mOrientation; +// [Value] attribute Vec3 mHalfExtents; +//}; +// +//interface RayCast { +// void RayCast(); +// void RayCast([Const, Ref] Vec3 inOrigin, [Const, Ref] Vec3 inDirection); +// [Const, Value] RayCast Transformed([Const, Ref] Mat44 inTransform); +// [Const, Value] RayCast Translated([Const, Ref] Vec3 inTranslation); +// [Const, Value] Vec3 GetPointOnRay(float inFraction); +// +// [Value] attribute Vec3 mOrigin; +// [Value] attribute Vec3 mDirection; +//}; +// +//interface RRayCast { +// void RRayCast(); +// void RRayCast([Const, Ref] RVec3 inOrigin, [Const, Ref] Vec3 inDirection); +// [Const, Value] RRayCast Transformed([Const, Ref] RMat44 inTransform); +// [Const, Value] RRayCast Translated([Const, Ref] RVec3 inTranslation); +// [Const, Value] RVec3 GetPointOnRay(float inFraction); +// +// [Value] attribute RVec3 mOrigin; +// [Value] attribute Vec3 mDirection; +//}; +// +//interface BroadPhaseCastResult { +// void BroadPhaseCastResult(); +// void Reset(); +// +// [Value] attribute BodyID mBodyID; +// attribute float mFraction; +//}; +// +//interface RayCastResult { +// void RayCastResult(); +// +// [Value] attribute SubShapeID mSubShapeID2; +//}; +// +//RayCastResult implements BroadPhaseCastResult; +// +//interface AABoxCast { +// void AABoxCast(); +// +// [Value] attribute AABox mBox; +// [Value] attribute Vec3 mDirection; +//}; +// +//interface ShapeCast { +// void ShapeCast([Const] Shape inShape, [Const, Ref] Vec3 inScale, [Const, Ref] Mat44 inCenterOfMassStart, [Const, Ref] Vec3 inDirection); +// +// [Const] readonly attribute Shape mShape; +// [Const, Value] readonly attribute Vec3 mScale; +// [Const, Value] readonly attribute Mat44 mCenterOfMassStart; +// [Const, Value] readonly attribute Vec3 mDirection; +// [Const, Value] Vec3 GetPointOnRay(float inFraction); +//}; +// +//interface RShapeCast { +// void RShapeCast([Const] Shape inShape, [Const, Ref] Vec3 inScale, [Const, Ref] RMat44 inCenterOfMassStart, [Const, Ref] Vec3 inDirection); +// +// [Const] readonly attribute Shape mShape; +// [Const, Value] readonly attribute Vec3 mScale; +// [Const, Value] readonly attribute RMat44 mCenterOfMassStart; +// [Const, Value] readonly attribute Vec3 mDirection; +// [Const, Value] RVec3 GetPointOnRay(float inFraction); +//}; +// +//interface Plane { +// void Plane([Const, Ref] Vec3 inNormal, float inConstant); +// [Value] Vec3 GetNormal(); +// void SetNormal([Const, Ref] Vec3 inNormal); +// float GetConstant(); +// void SetConstant(float inConstant); +// [Const, Value] Plane sFromPointAndNormal([Const, Ref] Vec3 inPoint, [Const, Ref] Vec3 inNormal); +// [Const, Value] Plane sFromPointsCCW([Const, Ref] Vec3 inPoint1, [Const, Ref] Vec3 inPoint2, [Const, Ref] Vec3 inPoint3); +// [Const, Value] Plane Offset(float inDistance); +// [Const, Value] Plane GetTransformed([Const, Ref] Mat44 inTransform); +// float SignedDistance([Const, Ref] Vec3 inPoint); +//}; +// +//interface TransformedShape { +// void TransformedShape(); +// void CastRay([Const, Ref] RRayCast inRay, [Ref] RayCastResult ioHit); +// void CastRay([Const, Ref] RRayCast inRay, [Const, Ref] RayCastSettings inRayCastSettings, [Ref] CastRayCollector ioCollector, [Const, Ref] ShapeFilter inShapeFilter); +// void CollidePoint([Const, Ref] RVec3 inPoint, [Ref] CollidePointCollector ioCollector, [Const, Ref] ShapeFilter inShapeFilter); +// void CollideShape([Const] Shape inShape, [Const, Ref] Vec3 inShapeScale, [Const, Ref] RMat44 inCenterOfMassTransform, [Const, Ref] CollideShapeSettings inCollideShapeSettings, [Const, Ref] RVec3 inBaseOffset, [Ref] CollideShapeCollector ioCollector, [Const, Ref] ShapeFilter inShapeFilter); +// void CastShape([Const, Ref] RShapeCast inShapeCast, [Const, Ref] ShapeCastSettings inShapeCastSettings, [Const, Ref] RVec3 inBaseOffset, [Ref] CastShapeCollector ioCollector, [Const, Ref] ShapeFilter inShapeFilter); +// void CollectTransformedShapes([Const, Ref] AABox inBox, [Ref] TransformedShapeCollector ioCollector, [Const, Ref] ShapeFilter inShapeFilter); +// [Value] Vec3 GetShapeScale(); +// void SetShapeScale([Const, Ref] Vec3 inScale); +// [Value] RMat44 GetCenterOfMassTransform(); +// [Value] RMat44 GetInverseCenterOfMassTransform(); +// void SetWorldTransform([Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, [Const, Ref] Vec3 inScale); +// void SetWorldTransform([Const, Ref] RMat44 inTransform); +// [Value] RMat44 GetWorldTransform(); +// [Value] AABox GetWorldSpaceBounds(); +// [Value] Vec3 GetWorldSpaceSurfaceNormal([Const, Ref] SubShapeID inSubShapeID, [Const, Ref] RVec3 inPosition); +// [Const] PhysicsMaterial GetMaterial([Const, Ref] SubShapeID inSubShapeID); +// +// [Value] attribute RVec3 mShapePositionCOM; +// [Value] attribute Quat mShapeRotation; +// [Const] attribute Shape mShape; +// [Value] attribute Float3 mShapeScale; +// [Value] attribute BodyID mBodyID; +//}; +// +//interface PhysicsMaterial { +// void PhysicsMaterial(); +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +//}; +// +//interface PhysicsMaterialList { +// void PhysicsMaterialList(); +// boolean empty(); +// long size(); +// [Const] PhysicsMaterial at(long inIndex); +// void push_back([Const] PhysicsMaterial inMaterial); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface Triangle { +// void Triangle(); +// void Triangle([Const, Ref] Vec3 inV1, [Const, Ref] Vec3 inV2, [Const, Ref] Vec3 inV3); +// +// [Value] attribute Float3[] mV; +// attribute unsigned long mMaterialIndex; +//}; +// +//interface TriangleList { +// void TriangleList(); +// boolean empty(); +// long size(); +// [Ref] Triangle at(long inIndex); +// void push_back([Const, Ref] Triangle inTriangle); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface VertexList { +// void VertexList(); +// boolean empty(); +// long size(); +// [Ref] Float3 at(long inIndex); +// void push_back([Const, Ref] Float3 inVertex); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface IndexedTriangle { +// void IndexedTriangle(); +// void IndexedTriangle(unsigned long inI1, unsigned long inI2, unsigned long inI3, unsigned long inMaterialIndex); +// +// attribute unsigned long[] mIdx; +// attribute unsigned long mMaterialIndex; +//}; +// +//interface IndexedTriangleList { +// void IndexedTriangleList(); +// boolean empty(); +// long size(); +// [Ref] IndexedTriangle at(long inIndex); +// void push_back([Const, Ref] IndexedTriangle inTriangle); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//[Prefix="Shape::"] +//interface ShapeResult { +// boolean IsValid(); +// boolean HasError(); +// [Const, Ref] JPHString GetError(); +// Shape Get(); +// void Clear(); +//}; +// +//// Shape +//interface ShapeSettings { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// [Value] ShapeResult Create(); +// void ClearCachedResult(); +// +// attribute unsigned long long mUserData; +//}; +// +//interface Shape { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// EShapeType GetType(); +// EShapeSubType GetSubType(); +// boolean MustBeStatic(); +// [Value] AABox GetLocalBounds(); +// [Value] AABox GetWorldSpaceBounds([Const, Ref] Mat44 inCenterOfMassTransform, [Const, Ref] Vec3 inScale); +// [Value] Vec3 GetCenterOfMass(); +// unsigned long long GetUserData(); +// void SetUserData(unsigned long long inUserData); +// unsigned long GetSubShapeIDBitsRecursive(); +// float GetInnerRadius(); +// [Value] MassProperties GetMassProperties(); +// [Const] PhysicsMaterial GetMaterial([Const, Ref] SubShapeID inSubShapeID); +// [Value] Vec3 GetSurfaceNormal([Const, Ref] SubShapeID inSubShapeID, [Const, Ref] Vec3 inLocalSurfacePosition); +// unsigned long long GetSubShapeUserData([Const, Ref] SubShapeID inSubShapeID); +// [Value] TransformedShape GetSubShapeTransformedShape([Const, Ref] SubShapeID inSubShapeID, [Const, Ref] Vec3 inPositionCOM, [Const, Ref] Quat inRotation, [Const, Ref] Vec3 inScale, [Ref] SubShapeID outRemainder); +// float GetVolume(); +// boolean IsValidScale([Const, Ref] Vec3 inScale); +// [Value] Vec3 MakeScaleValid([Const, Ref] Vec3 inScale); +// [Value] ShapeResult ScaleShape([Const, Ref] Vec3 inScale); +//}; +// +//interface ShapeGetTriangles { +// void ShapeGetTriangles(Shape inShape, [Const, Ref] AABox inBox, [Const, Ref] Vec3 inPositionCOM, [Const, Ref] Quat inRotation, [Const, Ref] Vec3 inScale); +// long GetNumTriangles(); +// long GetVerticesSize(); +// [Const] any GetVerticesData(); +// [Const] PhysicsMaterial GetMaterial(long inTriangle); +//}; +// +//// Convex shape +//interface ConvexShapeSettings { +// [Const] attribute PhysicsMaterial mMaterial; +// attribute float mDensity; +//}; +// +//ConvexShapeSettings implements ShapeSettings; +// +//interface ConvexShape { +// float GetDensity(); +// void SetDensity(float inDensity); +//}; +// +//ConvexShape implements Shape; +// +//// Sphere +//interface SphereShapeSettings { +// void SphereShapeSettings(float inRadius, [Const] optional PhysicsMaterial inMaterial); +// +// attribute float mRadius; +//}; +// +//SphereShapeSettings implements ConvexShapeSettings; +// +//interface SphereShape { +// void SphereShape(float inRadius, [Const] optional PhysicsMaterial inMaterial); +// float GetRadius(); +//}; +// +//SphereShape implements ConvexShape; +// +//// Box +//interface BoxShapeSettings { +// void BoxShapeSettings([Ref] Vec3 inHalfExtent, optional float inConvexRadius, [Const] optional PhysicsMaterial inMaterial); +// +// [Value] attribute Vec3 mHalfExtent; +// attribute float mConvexRadius; +//}; +// +//BoxShapeSettings implements ConvexShapeSettings; +// +//interface BoxShape { +// void BoxShape([Ref] Vec3 inHalfExtent, optional float inConvexRadius, [Const] optional PhysicsMaterial inMaterial); +// [Value] Vec3 GetHalfExtent(); +//}; +// +//BoxShape implements ConvexShape; +// +//// Cylinder +//interface CylinderShapeSettings { +// void CylinderShapeSettings(float inHalfHeight, float inRadius, optional float inConvexRadius, [Const] optional PhysicsMaterial inMaterial); +// +// attribute float mHalfHeight; +// attribute float mRadius; +// attribute float mConvexRadius; +//}; +// +//CylinderShapeSettings implements ConvexShapeSettings; +// +//interface CylinderShape { +// void CylinderShape(float inHalfHeight, float inRadius, float inConvexRadius, [Const] optional PhysicsMaterial inMaterial); +// float GetRadius(); +// float GetHalfHeight(); +//}; +// +//CylinderShape implements ConvexShape; +// +//// Capsule +//interface CapsuleShapeSettings { +// void CapsuleShapeSettings(float inHalfHeight, float inRadius, [Const] optional PhysicsMaterial inMaterial); +// +// attribute float mRadius; +// attribute float mHalfHeightOfCylinder; +//}; +// +//CapsuleShapeSettings implements ConvexShapeSettings; +// +//interface CapsuleShape { +// void CapsuleShape(float inHalfHeight, float inRadius, [Const] optional PhysicsMaterial inMaterial); +// float GetRadius(); +// float GetHalfHeightOfCylinder(); +//}; +// +//CapsuleShape implements ConvexShape; +// +//// Tapered capsule +//interface TaperedCapsuleShapeSettings { +// void TaperedCapsuleShapeSettings(float inHalfHeightOfTaperedCylinder, float inTopRadius, float inBottomRadius, [Const] optional PhysicsMaterial inMaterial); +// +// attribute float mHalfHeightOfTaperedCylinder; +// attribute float mTopRadius; +// attribute float mBottomRadius; +//}; +// +//TaperedCapsuleShapeSettings implements ConvexShapeSettings; +// +//interface TaperedCapsuleShape { +//}; +// +//TaperedCapsuleShape implements ConvexShape; +// +//// Convex hull +//interface ConvexHullShapeSettings { +// void ConvexHullShapeSettings(); +// +// [Value] attribute ArrayVec3 mPoints; +// attribute float mMaxConvexRadius; +// attribute float mMaxErrorConvexRadius; +// attribute float mHullTolerance; +//}; +// +//ConvexHullShapeSettings implements ConvexShapeSettings; +// +//interface ConvexHullShape { +//}; +// +//ConvexHullShape implements ConvexShape; +// +//// Compound shape +//interface CompoundShapeSettings { +// void AddShape([Const, Ref] Vec3 inPosition, [Const, Ref] Quat inRotation, [Const] ShapeSettings inShape, unsigned long inUserData); +//}; +// +//CompoundShapeSettings implements ShapeSettings; +// +//interface CompoundShapeSubShape { +// [Value] Vec3 GetPositionCOM(); +// [Value] Quat GetRotation(); +// +// [Const] attribute Shape mShape; +// attribute unsigned long mUserData; +//}; +// +//interface CompoundShape { +// long GetNumSubShapes(); +// [Const, Ref] CompoundShapeSubShape GetSubShape(long inIdx); +//}; +// +//CompoundShape implements Shape; +// +//// Static compound +//interface StaticCompoundShapeSettings { +// void StaticCompoundShapeSettings(); +//}; +// +//StaticCompoundShapeSettings implements CompoundShapeSettings; +// +//interface StaticCompoundShape { +//}; +// +//StaticCompoundShape implements CompoundShape; +// +//// Mutable compound +//interface MutableCompoundShapeSettings { +// void MutableCompoundShapeSettings(); +//}; +// +//MutableCompoundShapeSettings implements CompoundShapeSettings; +// +//interface MutableCompoundShape { +// unsigned long AddShape([Const, Ref] Vec3 inPosition, [Const, Ref] Quat inRotation, Shape inShape, unsigned long inUserData); +// void RemoveShape(unsigned long inIndex); +// void ModifyShape(unsigned long inIndex, [Const, Ref] Vec3 inPosition, [Const, Ref] Quat inRotation); +// void ModifyShape(unsigned long inIndex, [Const, Ref] Vec3 inPosition, [Const, Ref] Quat inRotation, Shape inShape); +// void ModifyShapes(unsigned long inStartIndex, unsigned long inNumber, Vec3MemRef inPositions, QuatMemRef inRotations); +// void AdjustCenterOfMass(); +//}; +// +//MutableCompoundShape implements CompoundShape; +// +//// Decorated shape +//interface DecoratedShapeSettings { +//}; +// +//DecoratedShapeSettings implements ShapeSettings; +// +//interface DecoratedShape { +// [Const] Shape GetInnerShape(); +//}; +// +//DecoratedShape implements Shape; +// +//// Scaled shape +//interface ScaledShapeSettings { +// void ScaledShapeSettings(ShapeSettings inShape, [Ref, Const] Vec3 inScale); +// +// [Value] attribute Vec3 mScale; +//}; +// +//ScaledShapeSettings implements DecoratedShapeSettings; +// +//interface ScaledShape { +// void ScaledShape(Shape inShape, [Ref, Const] Vec3 inScale); +// [Value] Vec3 GetScale(); +//}; +// +//ScaledShape implements DecoratedShape; +// +//// Offset COM +//interface OffsetCenterOfMassShapeSettings { +// void OffsetCenterOfMassShapeSettings([Ref, Const] Vec3 inOffset, ShapeSettings inShape); +// +// [Value] attribute Vec3 mOffset; +//}; +// +//OffsetCenterOfMassShapeSettings implements DecoratedShapeSettings; +// +//interface OffsetCenterOfMassShape { +// void OffsetCenterOfMassShape([Const] Shape inShape, [Const, Ref] Vec3 inOffset); +//}; +// +//OffsetCenterOfMassShape implements DecoratedShape; +// +//// Rotated translated +//interface RotatedTranslatedShapeSettings { +// void RotatedTranslatedShapeSettings([Ref, Const] Vec3 inPosition, [Ref, Const] Quat inRotation, ShapeSettings inShape); +// +// [Value] attribute Vec3 mPosition; +// [Value] attribute Quat mRotation; +//}; +// +//RotatedTranslatedShapeSettings implements DecoratedShapeSettings; +// +//interface RotatedTranslatedShape { +// [Value] Quat GetRotation(); +// [Value] Vec3 GetPosition(); +//}; +// +//RotatedTranslatedShape implements DecoratedShape; +// +//// Mesh shape +//interface MeshShapeSettings { +// void MeshShapeSettings(); +// void MeshShapeSettings([Ref, Const] TriangleList inTriangleList, [Ref, Const] optional PhysicsMaterialList inMaterialList); +// void MeshShapeSettings([Ref, Const] VertexList inVertices, [Ref, Const] IndexedTriangleList inTriangles, [Ref, Const] PhysicsMaterialList inMaterialList); +// void Sanitize(); +// +// [Value] attribute VertexList mTriangleVertices; +// [Value] attribute IndexedTriangleList mIndexedTriangles; +// [Value] attribute PhysicsMaterialList mMaterials; +// attribute unsigned long mMaxTrianglesPerLeaf; +// attribute float mActiveEdgeCosThresholdAngle; +//}; +// +//MeshShapeSettings implements ShapeSettings; +// +//interface MeshShape { +//}; +// +//MeshShape implements Shape; +// +//interface HeightFieldShapeConstantValues { +// [Const] static readonly attribute float cNoCollisionValue; +//}; +// +//interface HeightFieldShapeSettings { +// void HeightFieldShapeSettings(); +// +// [Value] attribute Vec3 mOffset; +// [Value] attribute Vec3 mScale; +// attribute long mSampleCount; +// attribute float mMinHeightValue; +// attribute float mMaxHeightValue; +// attribute unsigned long mMaterialsCapacity; +// attribute long mBlockSize; +// attribute long mBitsPerSample; +// [Value] attribute ArrayFloat mHeightSamples; +// [Value] attribute ArrayUint8 mMaterialIndices; +// [Value] attribute PhysicsMaterialList mMaterials; +// attribute float mActiveEdgeCosThresholdAngle; +//}; +// +//HeightFieldShapeSettings implements ShapeSettings; +// +//interface HeightFieldShape { +// long GetSampleCount(); +// long GetBlockSize(); +// [Value] Vec3 GetPosition(long inX, long inY); +// boolean IsNoCollision(long inX, long inY); +// float GetMinHeightValue(); +// float GetMaxHeightValue(); +// void GetHeights(long inX, long inY, long inSizeX, long inSizeY, FloatMemRef outHeights, long inHeightsStride); +// void SetHeights(long inX, long inY, long inSizeX, long inSizeY, FloatMemRef inHeights, long inHeightsStride, [Ref] TempAllocator inAllocator, optional float inActiveEdgeCosThresholdAngle); +// void GetMaterials(long inX, long inY, long inSizeX, long inSizeY, Uint8MemRef outMaterials, long inMaterialsStride); +// boolean SetMaterials(long inX, long inY, long inSizeX, long inSizeY, Uint8MemRef inMaterials, long inMaterialsStride, PhysicsMaterialList inMaterialList, [Ref] TempAllocator inAllocator); +//}; +// +//HeightFieldShape implements Shape; +// +//// Constraint +//interface ConstraintSettings { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// +// attribute boolean mEnabled; +// attribute long mNumVelocityStepsOverride; +// attribute long mNumPositionStepsOverride; +//}; +// +//interface Constraint { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// EConstraintType GetType(); +// EConstraintSubType GetSubType(); +// unsigned long GetConstraintPriority(); +// void SetConstraintPriority(unsigned long inPriority); +// void SetNumVelocityStepsOverride(long inN); +// long GetNumVelocityStepsOverride(); +// void SetNumPositionStepsOverride(long inN); +// long GetNumPositionStepsOverride(); +// void SetEnabled(boolean inEnabled); +// boolean GetEnabled(); +// boolean IsActive(); +// unsigned long long GetUserData(); +// void SetUserData(unsigned long long inUserData); +// void ResetWarmStart(); +//}; +// +//// Two body constraint +//interface TwoBodyConstraintSettings { +// Constraint Create([Ref] Body inBody1, [Ref] Body inBody2); +//}; +// +//TwoBodyConstraintSettings implements ConstraintSettings; +// +//interface TwoBodyConstraint { +// Body GetBody1(); +// Body GetBody2(); +// [Value] Mat44 GetConstraintToBody1Matrix(); +// [Value] Mat44 GetConstraintToBody2Matrix(); +//}; +// +//TwoBodyConstraint implements Constraint; +// +//// Fixed constraint +//interface FixedConstraintSettings { +// void FixedConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// attribute boolean mAutoDetectPoint; +// [Value] attribute RVec3 mPoint1; +// [Value] attribute Vec3 mAxisX1; +// [Value] attribute Vec3 mAxisY1; +// [Value] attribute RVec3 mPoint2; +// [Value] attribute Vec3 mAxisX2; +// [Value] attribute Vec3 mAxisY2; +//}; +// +//FixedConstraintSettings implements TwoBodyConstraintSettings; +// +//// Spring settings +//interface SpringSettings { +// void SpringSettings(); +// boolean HasStiffness(); +// +// attribute ESpringMode mMode; +// attribute float mFrequency; +// attribute float mStiffness; +// attribute float mDamping; +//}; +// +//// Motor settings +//interface MotorSettings { +// void MotorSettings(); +// +// [Value] attribute SpringSettings mSpringSettings; +// attribute float mMinForceLimit; +// attribute float mMaxForceLimit; +// attribute float mMinTorqueLimit; +// attribute float mMaxTorqueLimit; +//}; +// +//// Distance constraint +//interface DistanceConstraintSettings { +// void DistanceConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute RVec3 mPoint1; +// [Value] attribute RVec3 mPoint2; +// attribute float mMinDistance; +// attribute float mMaxDistance; +// [Value] attribute SpringSettings mLimitsSpringSettings; +//}; +// +//DistanceConstraintSettings implements TwoBodyConstraintSettings; +// +//interface DistanceConstraint { +// void SetDistance(float inMinDistance, float inMaxDistance); +// float GetMinDistance(); +// float GetMaxDistance(); +// [Ref] SpringSettings GetLimitsSpringSettings(); +// void SetLimitsSpringSettings([Const, Ref] SpringSettings inSettings); +// float GetTotalLambdaPosition(); +//}; +// +//DistanceConstraint implements TwoBodyConstraint; +// +//// Point constraint +//interface PointConstraintSettings { +// void PointConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute RVec3 mPoint1; +// [Value] attribute RVec3 mPoint2; +//}; +// +//PointConstraintSettings implements TwoBodyConstraintSettings; +// +//interface PointConstraint { +// [Value] Vec3 GetLocalSpacePoint1(); +// [Value] Vec3 GetLocalSpacePoint2(); +// [Value] Vec3 GetTotalLambdaPosition(); +//}; +// +//PointConstraint implements TwoBodyConstraint; +// +//// Hinge constraint +//interface HingeConstraintSettings { +// void HingeConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute RVec3 mPoint1; +// [Value] attribute Vec3 mHingeAxis1; +// [Value] attribute Vec3 mNormalAxis1; +// [Value] attribute RVec3 mPoint2; +// [Value] attribute Vec3 mHingeAxis2; +// [Value] attribute Vec3 mNormalAxis2; +// attribute float mLimitsMin; +// attribute float mLimitsMax; +// [Value] attribute SpringSettings mLimitsSpringSettings; +// attribute float mMaxFrictionTorque; +// [Value] attribute MotorSettings mMotorSettings; +//}; +// +//HingeConstraintSettings implements TwoBodyConstraintSettings; +// +//interface HingeConstraint { +// float GetCurrentAngle(); +// void SetMaxFrictionTorque(float inFrictionTorque); +// float GetMaxFrictionTorque(); +// [Ref] MotorSettings GetMotorSettings(); +// void SetMotorState(EMotorState inState); +// EMotorState GetMotorState(); +// void SetTargetAngularVelocity(float inAngularVelocity); +// float GetTargetAngularVelocity(); +// void SetTargetAngle(float inAngle); +// float GetTargetAngle(); +// void SetLimits(float inLimitsMin, float inLimitsMax); +// float GetLimitsMin(); +// float GetLimitsMax(); +// boolean HasLimits(); +// [Ref] SpringSettings GetLimitsSpringSettings(); +// void SetLimitsSpringSettings([Const, Ref] SpringSettings inLimitsSpringSettings); +// [Value] Vec3 GetTotalLambdaPosition(); +// [Value] Vector2 GetTotalLambdaRotation(); +// float GetTotalLambdaRotationLimits(); +// float GetTotalLambdaMotor(); +//}; +// +//HingeConstraint implements TwoBodyConstraint; +// +//// Cone constraint +//interface ConeConstraintSettings { +// void ConeConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute RVec3 mPoint1; +// [Value] attribute Vec3 mTwistAxis1; +// [Value] attribute RVec3 mPoint2; +// [Value] attribute Vec3 mTwistAxis2; +// attribute float mHalfConeAngle; +//}; +// +//ConeConstraintSettings implements TwoBodyConstraintSettings; +// +//interface ConeConstraint { +// void SetHalfConeAngle(float inHalfConeAngle); +// float GetCosHalfConeAngle(); +// [Value] Vec3 GetTotalLambdaPosition(); +// float GetTotalLambdaRotation(); +//}; +// +//ConeConstraint implements TwoBodyConstraint; +// +//// Slider constraint +//interface SliderConstraintSettings { +// void SliderConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// attribute boolean mAutoDetectPoint; +// [Value] attribute RVec3 mPoint1; +// [Value] attribute Vec3 mSliderAxis1; +// [Value] attribute Vec3 mNormalAxis1; +// [Value] attribute RVec3 mPoint2; +// [Value] attribute Vec3 mSliderAxis2; +// [Value] attribute Vec3 mNormalAxis2; +// attribute float mLimitsMin; +// attribute float mLimitsMax; +// [Value] attribute SpringSettings mLimitsSpringSettings; +// attribute float mMaxFrictionForce; +// [Value] attribute MotorSettings mMotorSettings; +//}; +// +//SliderConstraintSettings implements TwoBodyConstraintSettings; +// +//interface SliderConstraint { +// float GetCurrentPosition(); +// void SetMaxFrictionForce(float inFrictionForce); +// float GetMaxFrictionForce(); +// [Ref] MotorSettings GetMotorSettings(); +// void SetMotorState(EMotorState inState); +// EMotorState GetMotorState(); +// void SetTargetVelocity(float inVelocity); +// float GetTargetVelocity(); +// void SetTargetPosition(float inPosition); +// float GetTargetPosition(); +// void SetLimits(float inLimitsMin, float inLimitsMax); +// float GetLimitsMin(); +// float GetLimitsMax(); +// boolean HasLimits(); +// [Ref] SpringSettings GetLimitsSpringSettings(); +// void SetLimitsSpringSettings([Const, Ref] SpringSettings inLimitsSpringSettings); +// [Value] Vector2 GetTotalLambdaPosition(); +// float GetTotalLambdaPositionLimits(); +// [Value] Vec3 GetTotalLambdaRotation(); +// float GetTotalLambdaMotor(); +//}; +// +//SliderConstraint implements TwoBodyConstraint; +// +//// Swing twist constraint +//interface SwingTwistConstraintSettings { +// void SwingTwistConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute RVec3 mPosition1; +// [Value] attribute Vec3 mTwistAxis1; +// [Value] attribute Vec3 mPlaneAxis1; +// [Value] attribute RVec3 mPosition2; +// [Value] attribute Vec3 mTwistAxis2; +// [Value] attribute Vec3 mPlaneAxis2; +// attribute ESwingType mSwingType; +// attribute float mNormalHalfConeAngle; +// attribute float mPlaneHalfConeAngle; +// attribute float mTwistMinAngle; +// attribute float mTwistMaxAngle; +// attribute float mMaxFrictionTorque; +// [Value] attribute MotorSettings mSwingMotorSettings; +// [Value] attribute MotorSettings mTwistMotorSettings; +//}; +// +//SwingTwistConstraintSettings implements TwoBodyConstraintSettings; +// +//interface SwingTwistConstraint { +// [Value] Vec3 GetLocalSpacePosition1(); +// [Value] Vec3 GetLocalSpacePosition2(); +// [Value] Quat GetConstraintToBody1(); +// [Value] Quat GetConstraintToBody2(); +// float GetNormalHalfConeAngle(); +// void SetNormalHalfConeAngle(float inAngle); +// float GetPlaneHalfConeAngle(); +// void SetPlaneHalfConeAngle(float inAngle); +// float GetTwistMinAngle(); +// void SetTwistMinAngle(float inAngle); +// float GetTwistMaxAngle(); +// void SetTwistMaxAngle(float inAngle); +// [Ref] MotorSettings GetSwingMotorSettings(); +// [Ref] MotorSettings GetTwistMotorSettings(); +// void SetMaxFrictionTorque(float inFrictionTorque); +// float GetMaxFrictionTorque(); +// void SetSwingMotorState(EMotorState inState); +// EMotorState GetSwingMotorState(); +// void SetTwistMotorState(EMotorState inState); +// EMotorState GetTwistMotorState(); +// void SetTargetAngularVelocityCS([Const, Ref] Vec3 inAngularVelocity); +// [Value] Vec3 GetTargetAngularVelocityCS(); +// void SetTargetOrientationCS([Const, Ref] Quat inOrientation); +// [Value] Quat GetTargetOrientationCS(); +// void SetTargetOrientationBS([Const, Ref] Quat inOrientation); +// [Value] Quat GetRotationInConstraintSpace(); +// [Value] Vec3 GetTotalLambdaPosition(); +// float GetTotalLambdaTwist(); +// float GetTotalLambdaSwingY(); +// float GetTotalLambdaSwingZ(); +// [Value] Vec3 GetTotalLambdaMotor(); +//}; +// +//SwingTwistConstraint implements TwoBodyConstraint; +// +//// Six DOF constraint +//interface SixDOFConstraintSettings { +// void SixDOFConstraintSettings(); +// void MakeFreeAxis(SixDOFConstraintSettings_EAxis inAxis); +// boolean IsFreeAxis(SixDOFConstraintSettings_EAxis inAxis); +// void MakeFixedAxis(SixDOFConstraintSettings_EAxis inAxis); +// boolean IsFixedAxis(SixDOFConstraintSettings_EAxis inAxis); +// void SetLimitedAxis(SixDOFConstraintSettings_EAxis inAxis, float inMin, float inMax); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute RVec3 mPosition1; +// [Value] attribute Vec3 mAxisX1; +// [Value] attribute Vec3 mAxisY1; +// [Value] attribute RVec3 mPosition2; +// [Value] attribute Vec3 mAxisX2; +// [Value] attribute Vec3 mAxisY2; +// attribute float[] mMaxFriction; +// attribute ESwingType mSwingType; +// attribute float[] mLimitMin; +// attribute float[] mLimitMax; +// [Value] attribute SpringSettings[] mLimitsSpringSettings; +// [Value] attribute MotorSettings[] mMotorSettings; +//}; +// +//SixDOFConstraintSettings implements TwoBodyConstraintSettings; +// +//interface SixDOFConstraint { +// void SetTranslationLimits([Const, Ref] Vec3 inLimitMin, [Const, Ref] Vec3 inLimitMax); +// void SetRotationLimits([Const, Ref] Vec3 inLimitMin, [Const, Ref] Vec3 inLimitMax); +// float GetLimitsMin(SixDOFConstraintSettings_EAxis inAxis); +// float GetLimitsMax(SixDOFConstraintSettings_EAxis inAxis); +// [Const, Value] Vec3 GetTranslationLimitsMin(); +// [Const, Value] Vec3 GetTranslationLimitsMax(); +// [Const, Value] Vec3 GetRotationLimitsMin(); +// [Const, Value] Vec3 GetRotationLimitsMax(); +// boolean IsFixedAxis(SixDOFConstraintSettings_EAxis inAxis); +// boolean IsFreeAxis(SixDOFConstraintSettings_EAxis inAxis); +// [Const, Ref] SpringSettings GetLimitsSpringSettings(SixDOFConstraintSettings_EAxis inAxis); +// void SetLimitsSpringSettings(SixDOFConstraintSettings_EAxis inAxis, [Const, Ref] SpringSettings inLimitsSpringSettings); +// void SetMaxFriction(SixDOFConstraintSettings_EAxis inAxis, float inFriction); +// float GetMaxFriction(SixDOFConstraintSettings_EAxis inAxis); +// [Value] Quat GetRotationInConstraintSpace(); +// [Ref] MotorSettings GetMotorSettings(SixDOFConstraintSettings_EAxis inAxis); +// void SetMotorState(SixDOFConstraintSettings_EAxis inAxis, EMotorState inState); +// EMotorState GetMotorState(SixDOFConstraintSettings_EAxis inAxis); +// [Value] Vec3 GetTargetVelocityCS(); +// void SetTargetVelocityCS([Const, Ref] Vec3 inVelocity); +// void SetTargetAngularVelocityCS([Const, Ref] Vec3 inAngularVelocity); +// [Value] Vec3 GetTargetAngularVelocityCS(); +// [Value] Vec3 GetTargetPositionCS(); +// void SetTargetPositionCS([Const, Ref] Vec3 inPosition); +// void SetTargetOrientationCS([Const, Ref] Quat inOrientation); +// [Value] Quat GetTargetOrientationCS(); +// void SetTargetOrientationBS([Const, Ref] Quat inOrientation); +// [Value] Vec3 GetTotalLambdaPosition(); +// [Value] Vec3 GetTotalLambdaRotation(); +// [Value] Vec3 GetTotalLambdaMotorTranslation(); +// [Value] Vec3 GetTotalLambdaMotorRotation(); +//}; +// +//SixDOFConstraint implements TwoBodyConstraint; +// +//interface PathConstraintSettings { +// void PathConstraintSettings(); +// +// [Const] attribute PathConstraintPath mPath; +// [Value] attribute Vec3 mPathPosition; +// [Value] attribute Quat mPathRotation; +// attribute float mPathFraction; +// attribute float mMaxFrictionForce; +// attribute EPathRotationConstraintType mRotationConstraintType; +// [Value] attribute MotorSettings mPositionMotorSettings; +//}; +// +//PathConstraintSettings implements TwoBodyConstraintSettings; +// +//interface PathConstraintPath { +// boolean IsLooping(); +// void SetIsLooping(boolean inIsLooping); +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +//}; +// +//interface PathConstraintPathEm { +//}; +// +//PathConstraintPathEm implements PathConstraintPath; +// +//[JSImplementation="PathConstraintPathEm"] +//interface PathConstraintPathJS { +// [Const] void PathConstraintPathJS(); +// [Const] float GetPathMaxFraction(); +// [Const] float GetClosestPoint([Const] Vec3 inPosition, float inFractionHint); +// [Const] void GetPointOnPath(float inFraction, Vec3 outPathPosition, Vec3 outPathTangent, Vec3 outPathNormal, Vec3 outPathBinormal); +//}; +// +//interface PathConstraint { +// void SetPath([Const] PathConstraintPath inPath, float inPathFraction); +// [Const] PathConstraintPath GetPath(); +// float GetPathFraction(); +// void SetMaxFrictionForce(float inFrictionForce); +// float GetMaxFrictionForce(); +// [Ref] MotorSettings GetPositionMotorSettings(); +// void SetPositionMotorState(EMotorState inState); +// EMotorState GetPositionMotorState(); +// void SetTargetVelocity(float inVelocity); +// float GetTargetVelocity(); +// void SetTargetPathFraction(float inFraction); +// float GetTargetPathFraction(); +//}; +// +//PathConstraint implements TwoBodyConstraint; +// +//interface PulleyConstraintSettings { +// void PulleyConstraintSettings(); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute RVec3 mBodyPoint1; +// [Value] attribute RVec3 mFixedPoint1; +// [Value] attribute RVec3 mBodyPoint2; +// [Value] attribute RVec3 mFixedPoint2; +// attribute float mRatio; +// attribute float mMinLength; +// attribute float mMaxLength; +//}; +// +//PulleyConstraintSettings implements TwoBodyConstraintSettings; +// +//interface PulleyConstraint { +// void SetLength(float inMinLength, float inMaxLength); +// float GetMinLength(); +// float GetMaxLength(); +// float GetCurrentLength(); +//}; +// +//PulleyConstraint implements TwoBodyConstraint; +// +//interface GearConstraintSettings { +// void GearConstraintSettings(); +// void SetRatio(long inNumTeethGear1, long inNumTeethGear2); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute Vec3 mHingeAxis1; +// [Value] attribute Vec3 mHingeAxis2; +// attribute float mRatio; +//}; +// +//GearConstraintSettings implements TwoBodyConstraintSettings; +// +//interface GearConstraint { +// void SetConstraints([Const] Constraint inGear1, [Const] Constraint inGear2); +// float GetTotalLambda(); +//}; +// +//GearConstraint implements TwoBodyConstraint; +// +//interface RackAndPinionConstraintSettings { +// void RackAndPinionConstraintSettings(); +// void SetRatio(long inNumTeethRack, float inRackLength, long inNumTeethPinion); +// +// attribute EConstraintSpace mSpace; +// [Value] attribute Vec3 mHingeAxis; +// [Value] attribute Vec3 mSliderAxis; +// attribute float mRatio; +//}; +// +//RackAndPinionConstraintSettings implements TwoBodyConstraintSettings; +// +//interface RackAndPinionConstraint { +// void SetConstraints([Const] Constraint inPinion, [Const] Constraint inRack); +// float GetTotalLambda(); +//}; +// +//RackAndPinionConstraint implements TwoBodyConstraint; +// +//interface BodyID { +// void BodyID(); +// void BodyID(unsigned long inIndexAndSequenceNumber); +// unsigned long GetIndex(); +// unsigned long GetIndexAndSequenceNumber(); +//}; +// +//interface SubShapeID { +// void SubShapeID(); +// [Const] long GetValue(); +// void SetValue(long inValue); +//}; +// +//interface MotionProperties { +// EMotionQuality GetMotionQuality(); +// EAllowedDOFs GetAllowedDOFs(); +// boolean GetAllowSleeping(); +// [Value] Vec3 GetLinearVelocity(); +// void SetLinearVelocity([Const, Ref] Vec3 inVelocity); +// void SetLinearVelocityClamped([Const, Ref] Vec3 inVelocity); +// [Value] Vec3 GetAngularVelocity(); +// void SetAngularVelocity([Const, Ref] Vec3 inVelocity); +// void SetAngularVelocityClamped([Const, Ref] Vec3 inVelocity); +// void MoveKinematic([Const, Ref] Vec3 inPosition, [Const, Ref] Quat inRotation, float inDeltaTime); +// float GetMaxLinearVelocity(); +// void SetMaxLinearVelocity(float inVelocity); +// float GetMaxAngularVelocity(); +// void SetMaxAngularVelocity(float inVelocity); +// void ClampLinearVelocity(); +// void ClampAngularVelocity(); +// float GetLinearDamping(); +// void SetLinearDamping(float inDamping); +// float GetAngularDamping(); +// void SetAngularDamping(float inDamping); +// float GetGravityFactor(); +// void SetGravityFactor(float inFactor); +// void SetMassProperties(EAllowedDOFs inAllowedDOFs, [Const, Ref] MassProperties inMassProperties); +// float GetInverseMass(); +// float GetInverseMassUnchecked(); +// void SetInverseMass(float inInvM); +// [Value] Vec3 GetInverseInertiaDiagonal(); +// [Value] Quat GetInertiaRotation(); +// void SetInverseInertia([Const, Ref] Vec3 inInvI, [Const, Ref] Quat inRotation); +// [Value] Mat44 GetLocalSpaceInverseInertia(); +// [Value] Mat44 GetInverseInertiaForRotation([Const, Ref] Mat44 inRotation); +// [Value] Vec3 MultiplyWorldSpaceInverseInertiaByVector([Const, Ref] Quat inRotation, [Const, Ref] Vec3 inV); +// [Value] Vec3 GetPointVelocityCOM([Const, Ref] Vec3 inPointRelativeToCOM); +// [Value] Vec3 GetAccumulatedForce(); +// [Value] Vec3 GetAccumulatedTorque(); +// void ResetForce(); +// void ResetTorque(); +// void ResetMotion(); +// [Const, Value] Vec3 LockTranslation([Const, Ref] Vec3 inV); +// [Const, Value] Vec3 LockAngular([Const, Ref] Vec3 inV); +// void SetNumVelocityStepsOverride(unsigned long inN); +// unsigned long GetNumVelocityStepsOverride(); +// void SetNumPositionStepsOverride(unsigned long inN); +// unsigned long GetNumPositionStepsOverride(); +//}; +// +//interface GroupFilter { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +//}; +// +//[JSImplementation="GroupFilter"] +//interface GroupFilterJS { +// void GroupFilterJS(); +// [Const] boolean CanCollide([Const, Ref] CollisionGroup inGroup1, [Const, Ref] CollisionGroup inGroup2); +//}; +// +//interface GroupFilterTable { +// void GroupFilterTable(unsigned long inNumGroups); +// void DisableCollision(unsigned long inSubGroup1, unsigned long inSubGroup2); +// void EnableCollision(unsigned long inSubGroup1, unsigned long inSubGroup2); +// boolean IsCollisionEnabled(unsigned long inSubGroup1, unsigned long inSubGroup2); +//}; +// +//GroupFilterTable implements GroupFilter; +// +//interface CollisionGroup { +// void CollisionGroup(); +// void CollisionGroup(GroupFilter inFilter, unsigned long inGroupID, unsigned long inSubGroupID); +// void SetGroupFilter(GroupFilter inFilter); +// [Const] GroupFilter GetGroupFilter(); +// void SetGroupID(unsigned long inGroupID); +// unsigned long GetGroupID(); +// void SetSubGroupID(unsigned long inSubGroupID); +// unsigned long GetSubGroupID(); +//}; +// +//[NoDelete] +//interface Body { +// [Const, Ref] BodyID GetID(); +// boolean IsActive(); +// boolean IsRigidBody(); +// boolean IsSoftBody(); +// boolean IsStatic(); +// boolean IsKinematic(); +// boolean IsDynamic(); +// boolean CanBeKinematicOrDynamic(); +// EBodyType GetBodyType(); +// EMotionType GetMotionType(); +// void SetIsSensor(boolean inIsSensor); +// boolean IsSensor(); +// void SetCollideKinematicVsNonDynamic(boolean inCollide); +// boolean GetCollideKinematicVsNonDynamic(); +// void SetUseManifoldReduction(boolean inUseReduction); +// boolean GetUseManifoldReduction(); +// void SetApplyGyroscopicForce(boolean inApply); +// boolean GetApplyGyroscopicForce(); +// void SetEnhancedInternalEdgeRemoval(boolean inApply); +// boolean GetEnhancedInternalEdgeRemoval(); +// unsigned long GetObjectLayer(); +// [Ref] CollisionGroup GetCollisionGroup(); +// boolean GetAllowSleeping(); +// void SetAllowSleeping(boolean inAllow); +// void ResetSleepTimer(); +// float GetFriction(); +// void SetFriction(float inFriction); +// float GetRestitution(); +// void SetRestitution(float inRestitution); +// [Value] Vec3 GetLinearVelocity(); +// void SetLinearVelocity([Const, Ref] Vec3 inVelocity); +// void SetLinearVelocityClamped([Const, Ref] Vec3 inVelocity); +// [Value] Vec3 GetAngularVelocity(); +// void SetAngularVelocity([Const, Ref] Vec3 inVelocity); +// void SetAngularVelocityClamped([Const, Ref] Vec3 inVelocity); +// void AddForce([Const, Ref] Vec3 inForce); +// void AddForce([Const, Ref] Vec3 inForce, [Const, Ref] RVec3 inPosition); +// void AddTorque([Const, Ref] Vec3 inTorque); +// [Const, Value] Vec3 GetAccumulatedForce(); +// [Const, Value] Vec3 GetAccumulatedTorque(); +// void ResetForce(); +// void ResetTorque(); +// void ResetMotion(); +// void AddImpulse([Const, Ref] Vec3 inImpulse); +// void AddImpulse([Const, Ref] Vec3 inImpulse, [Const, Ref] RVec3 inPosition); +// void AddAngularImpulse([Const, Ref] Vec3 inAngularImpulse); +// void MoveKinematic([Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, float inDeltaTime); +// boolean ApplyBuoyancyImpulse([Const, Ref] RVec3 inSurfacePosition, [Const, Ref] Vec3 inSurfaceNormal, float inBuoyancy, float inLinearDrag, float inAngularDrag, [Const, Ref] Vec3 inFluidVelocity, [Const, Ref] Vec3 inGravity, float inDeltaTime); +// boolean IsInBroadPhase(); +// [Const, Value] Mat44 GetInverseInertia(); +// [Const] Shape GetShape(); +// [Value] RVec3 GetPosition(); +// [Value] Quat GetRotation(); +// [Value] RMat44 GetWorldTransform(); +// [Value] RVec3 GetCenterOfMassPosition(); +// [Value] RMat44 GetCenterOfMassTransform(); +// [Value] RMat44 GetInverseCenterOfMassTransform(); +// [Value] AABox GetWorldSpaceBounds(); +// [Value] TransformedShape GetTransformedShape(); +// [Value] BodyCreationSettings GetBodyCreationSettings(); +// [Value] SoftBodyCreationSettings GetSoftBodyCreationSettings(); +// MotionProperties GetMotionProperties(); +// [Const, Value] Vec3 GetWorldSpaceSurfaceNormal([Const, Ref] SubShapeID inSubShapeID, [Const, Ref] RVec3 inPosition); +// unsigned long long GetUserData(); +// void SetUserData(unsigned long long inUserData); +//}; +// +//interface BodyInterface { +// Body CreateBody([Const, Ref] BodyCreationSettings inSettings); +// Body CreateSoftBody([Const, Ref] SoftBodyCreationSettings inSettings); +// void CreateBodyWithID([Const, Ref] BodyID inBodyID, [Const, Ref] BodyCreationSettings inSettings); +// void CreateSoftBodyWithID([Const, Ref] BodyID inBodyID, [Const, Ref] SoftBodyCreationSettings inSettings); +// Body CreateBodyWithoutID([Const, Ref] BodyCreationSettings inSettings); +// Body CreateSoftBodyWithoutID([Const, Ref] SoftBodyCreationSettings inSettings); +// void DestroyBodyWithoutID(Body inBody); +// boolean AssignBodyID(Body ioBody); +// boolean AssignBodyID(Body ioBody, [Const, Ref] BodyID inBodyID); +// Body UnassignBodyID([Const, Ref] BodyID inBodyID); +// void DestroyBody([Const, Ref] BodyID inBodyID); +// void AddBody([Const, Ref] BodyID inBodyID, EActivation inActivationMode); +// void RemoveBody([Const, Ref] BodyID inBodyID); +// boolean IsAdded([Const, Ref] BodyID inBodyID); +// [Value] BodyID CreateAndAddBody([Const, Ref] BodyCreationSettings inSettings, EActivation inActivationMode); +// [Value] BodyID CreateAndAddSoftBody([Const, Ref] SoftBodyCreationSettings inSettings, EActivation inActivationMode); +// TwoBodyConstraint CreateConstraint([Const] TwoBodyConstraintSettings inSettings, [Const, Ref] BodyID inBodyID1, [Const, Ref] BodyID inBodyID2); +// void ActivateConstraint([Const] TwoBodyConstraint inConstraint); +// [Const] Shape GetShape([Const, Ref] BodyID inBodyID); +// void SetShape([Const, Ref] BodyID inBodyID, [Const] Shape inShape, boolean inUpdateMassProperties, EActivation inActivationMode); +// void NotifyShapeChanged([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inPreviousCenterOfMass, boolean inUpdateMassProperties, EActivation inActivationMode); +// void SetObjectLayer([Const, Ref] BodyID inBodyID, unsigned long inLayer); +// unsigned long GetObjectLayer([Const, Ref] BodyID inBodyID); +// void SetPositionAndRotation([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, EActivation inActivationMode); +// void SetPositionAndRotationWhenChanged([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, EActivation inActivationMode); +// void GetPositionAndRotation([Const, Ref] BodyID inBodyID, [Ref] RVec3 outPosition, [Ref] Quat outRotation); +// void SetPosition([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPosition, EActivation inActivationMode); +// [Value] RVec3 GetPosition([Const, Ref] BodyID inBodyID); +// void SetRotation([Const, Ref] BodyID inBodyID, [Const, Ref] Quat inRotation, EActivation inActivationMode); +// [Value] Quat GetRotation([Const, Ref] BodyID inBodyID); +// [Value] RMat44 GetWorldTransform([Const, Ref] BodyID inBodyID); +// [Value] RMat44 GetCenterOfMassTransform([Const, Ref] BodyID inBodyID); +// void SetLinearVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inLinearVelocity); +// [Value] Vec3 GetLinearVelocity([Const, Ref] BodyID inBodyID); +// void AddLinearVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inLinearVelocity); +// void AddLinearAndAngularVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inLinearVelocity, [Const, Ref] Vec3 inAngularVelocity); +// void SetAngularVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inAngularVelocity); +// [Value] Vec3 GetAngularVelocity([Const, Ref] BodyID inBodyID); +// [Value] Vec3 GetPointVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPoint); +// void SetPositionRotationAndVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, [Const, Ref] Vec3 inLinearVelocity, [Const, Ref] Vec3 inAngularVelocity); +// void MoveKinematic([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, float inDeltaTime); +// void ActivateBody([Const, Ref] BodyID inBodyID); +// void ActivateBodiesInAABox([Const, Ref] AABox inBox, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter); +// void DeactivateBody([Const, Ref] BodyID inBodyID); +// boolean IsActive([Const, Ref] BodyID inBodyID); +// void ResetSleepTimer([Const, Ref] BodyID inBodyID); +// EBodyType GetBodyType([Const, Ref] BodyID inBodyID); +// void SetMotionType([Const, Ref] BodyID inBodyID, EMotionType inMotionType, EActivation inActivationMode); +// EMotionType GetMotionType([Const, Ref] BodyID inBodyID); +// void SetMotionQuality([Const, Ref] BodyID inBodyID, EMotionQuality inMotionQuality); +// EMotionQuality GetMotionQuality([Const, Ref] BodyID inBodyID); +// [Value] Mat44 GetInverseInertia([Const, Ref] BodyID inBodyID); +// void SetRestitution([Const, Ref] BodyID inBodyID, float inRestitution); +// float GetRestitution([Const, Ref] BodyID inBodyID); +// void SetFriction([Const, Ref] BodyID inBodyID, float inFriction); +// float GetFriction([Const, Ref] BodyID inBodyID); +// void SetGravityFactor([Const, Ref] BodyID inBodyID, float inFactor); +// float GetGravityFactor([Const, Ref] BodyID inBodyID); +// void SetUseManifoldReduction([Const, Ref] BodyID inBodyID, boolean inUseReduction); +// boolean GetUseManifoldReduction([Const, Ref] BodyID inBodyID); +// void AddForce([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inForce, EActivation inActivationMode); +// void AddForce([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inForce, [Const, Ref] RVec3 inPoint, EActivation inActivationMode); +// void AddTorque([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inTorque, EActivation inActivationMode); +// void AddForceAndTorque([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inForce, [Const, Ref] Vec3 inTorque, EActivation inActivationMode); +// boolean ApplyBuoyancyImpulse([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inSurfacePosition, [Const, Ref] Vec3 inSurfaceNormal, float inBuoyancy, float inLinearDrag, float inAngularDrag, [Const, Ref] Vec3 inFluidVelocity, [Const, Ref] Vec3 inGravity, float inDeltaTime); +// void AddImpulse([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inImpulse); +// void AddImpulse([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inImpulse, [Const, Ref] RVec3 inPosition); +// void AddAngularImpulse([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inAngularImpulse); +// [Value] TransformedShape GetTransformedShape([Const, Ref] BodyID inBodyID); +// unsigned long long GetUserData([Const, Ref] BodyID inBodyID); +// void SetUserData([Const, Ref] BodyID inBodyID, unsigned long long inUserData); +// [Const] PhysicsMaterial GetMaterial([Const, Ref] BodyID inBodyID, [Const, Ref] SubShapeID inSubShapeID); +// void InvalidateContactCache([Const, Ref] BodyID inBodyID); +//}; +// +//interface StateRecorder { +// void SetValidating(boolean inValidating); +// boolean IsValidating(); +//}; +// +//interface StateRecorderImpl { +// void StateRecorderImpl(); +// void Clear(); +// void Rewind(); +// boolean IsEqual([Ref] StateRecorderImpl inReference); +//}; +// +//StateRecorderImpl implements StateRecorder; +// +//interface BodyLockInterface { +// Body TryGetBody([Const, Ref] BodyID inBodyID); +//}; +// +//interface BodyLockInterfaceNoLock { +//}; +// +//BodyLockInterfaceNoLock implements BodyLockInterface; +// +//interface BodyLockInterfaceLocking { +//}; +// +//BodyLockInterfaceLocking implements BodyLockInterface; +// +//interface PhysicsSettings { +// void PhysicsSettings(); +// +// attribute long mMaxInFlightBodyPairs; +// attribute long mStepListenersBatchSize; +// attribute long mStepListenerBatchesPerJob; +// attribute float mBaumgarte; +// attribute float mSpeculativeContactDistance; +// attribute float mPenetrationSlop; +// attribute float mLinearCastThreshold; +// attribute float mLinearCastMaxPenetration; +// attribute float mManifoldToleranceSq; +// attribute float mMaxPenetrationDistance; +// attribute float mBodyPairCacheMaxDeltaPositionSq; +// attribute float mBodyPairCacheCosMaxDeltaRotationDiv2; +// attribute float mContactNormalCosMaxDeltaRotation; +// attribute float mContactPointPreserveLambdaMaxDistSq; +// attribute long mNumVelocitySteps; +// attribute long mNumPositionSteps; +// attribute float mMinVelocityForRestitution; +// attribute float mTimeBeforeSleep; +// attribute float mPointVelocitySleepThreshold; +// attribute boolean mDeterministicSimulation; +// attribute boolean mConstraintWarmStart; +// attribute boolean mUseBodyPairContactCache; +// attribute boolean mUseManifoldReduction; +// attribute boolean mUseLargeIslandSplitter; +// attribute boolean mAllowSleeping; +// attribute boolean mCheckActiveEdges; +//}; +// +//interface CollideShapeResultFace { +// boolean empty(); +// long size(); +// [Ref] Vec3 at(long inIndex); +// void push_back([Const, Ref] Vec3 inValue); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface CollideShapeResult { +// void CollideShapeResult(); +// +// [Value] attribute Vec3 mContactPointOn1; +// [Value] attribute Vec3 mContactPointOn2; +// [Value] attribute Vec3 mPenetrationAxis; +// attribute float mPenetrationDepth; +// [Value] attribute SubShapeID mSubShapeID1; +// [Value] attribute SubShapeID mSubShapeID2; +// [Value] attribute BodyID mBodyID2; +// [Value] attribute CollideShapeResultFace mShape1Face; +// [Value] attribute CollideShapeResultFace mShape2Face; +//}; +// +//interface ContactPoints { +// boolean empty(); +// long size(); +// [Ref] Vec3 at(long inIndex); +// void push_back([Const, Ref] Vec3 inValue); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ContactManifold { +// void ContactManifold(); +// [Value] ContactManifold SwapShapes(); +// [Value] RVec3 GetWorldSpaceContactPointOn1(unsigned long inIndex); +// [Value] RVec3 GetWorldSpaceContactPointOn2(unsigned long inIndex); +// +// [Value] attribute RVec3 mBaseOffset; +// [Value] attribute Vec3 mWorldSpaceNormal; +// attribute float mPenetrationDepth; +// [Value] attribute SubShapeID mSubShapeID1; +// [Value] attribute SubShapeID mSubShapeID2; +// [Value] attribute ContactPoints mRelativeContactPointsOn1; +// [Value] attribute ContactPoints mRelativeContactPointsOn2; +//}; +// +//interface ContactSettings { +// void ContactSettings(); +// attribute float mCombinedFriction; +// attribute float mCombinedRestitution; +// attribute float mInvMassScale1; +// attribute float mInvInertiaScale1; +// attribute float mInvMassScale2; +// attribute float mInvInertiaScale2; +// attribute boolean mIsSensor; +// [Value] attribute Vec3 mRelativeLinearSurfaceVelocity; +// [Value] attribute Vec3 mRelativeAngularSurfaceVelocity; +//}; +// +//interface SubShapeIDPair { +// void SubShapeIDPair(); +// [Const, Ref] BodyID GetBody1ID(); +// [Const, Ref] SubShapeID GetSubShapeID1(); +// [Const, Ref] BodyID GetBody2ID(); +// [Const, Ref] SubShapeID GetSubShapeID2(); +//}; +// +//interface ContactListener { +//}; +// +//interface ContactListenerEm { +//}; +// +//ContactListenerEm implements ContactListener; +// +//[JSImplementation="ContactListenerEm"] +//interface ContactListenerJS { +// void ContactListenerJS(); +// long OnContactValidate([Const, Ref] Body inBody1, [Const, Ref] Body inBody2, [Const] RVec3 inBaseOffset, [Const, Ref] CollideShapeResult inCollisionResult); // Return value ValidateResult doesn't work with emscripten +// void OnContactAdded([Const, Ref] Body inBody1, [Const, Ref] Body inBody2, [Const, Ref] ContactManifold inManifold, [Ref] ContactSettings ioSettings); +// void OnContactPersisted([Const, Ref] Body inBody1, [Const, Ref] Body inBody2, [Const, Ref] ContactManifold inManifold, [Ref] ContactSettings ioSettings); +// void OnContactRemoved([Const, Ref] SubShapeIDPair inSubShapePair); +//}; +// +//interface SoftBodyManifold { +// [Const, Ref] ArraySoftBodyVertex GetVertices(); +// boolean HasContact([Const, Ref] SoftBodyVertex inVertex); +// [Value] Vec3 GetLocalContactPoint([Const, Ref] SoftBodyVertex inVertex); +// [Value] Vec3 GetContactNormal([Const, Ref] SoftBodyVertex inVertex); +// [Value] BodyID GetContactBodyID([Const, Ref] SoftBodyVertex inVertex); +//}; +// +//interface SoftBodyContactSettings { +// attribute float mInvMassScale1; +// attribute float mInvMassScale2; +// attribute float mInvInertiaScale2; +// attribute boolean mIsSensor; +//}; +// +//interface SoftBodyContactListener { +//}; +// +//interface SoftBodyContactListenerEm { +//}; +// +//SoftBodyContactListenerEm implements SoftBodyContactListener; +// +//[JSImplementation="SoftBodyContactListenerEm"] +//interface SoftBodyContactListenerJS { +// void SoftBodyContactListenerJS(); +// long OnSoftBodyContactValidate([Const, Ref] Body inSoftBody, [Const, Ref] Body inOtherBody, SoftBodyContactSettings ioSettings); +// void OnSoftBodyContactAdded([Const, Ref] Body inSoftBody, [Const, Ref] SoftBodyManifold inManifold); +//}; +// +//interface RayCastBodyCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="RayCastBodyCollector"] +//interface RayCastBodyCollectorJS { +// void RayCastBodyCollectorJS(); +// void Reset(); +// void AddHit([Const, Ref] BroadPhaseCastResult inResult); +//}; +// +//interface CollideShapeBodyCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="CollideShapeBodyCollector"] +//interface CollideShapeBodyCollectorJS { +// void CollideShapeBodyCollectorJS(); +// void Reset(); +// void AddHit([Const, Ref] BodyID inResult); +//}; +// +//interface CastShapeBodyCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="CastShapeBodyCollector"] +//interface CastShapeBodyCollectorJS { +// void CastShapeBodyCollectorJS(); +// void Reset(); +// void AddHit([Const, Ref] BroadPhaseCastResult inResult); +//}; +// +//interface BroadPhaseQuery { +// void CastRay([Const, Ref] RayCast inRay, [Ref] RayCastBodyCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter); +// void CollideAABox([Const, Ref] AABox inBox, [Ref] CollideShapeBodyCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter); +// void CollideSphere([Const, Ref] Vec3 inCenter, float inRadius, [Ref] CollideShapeBodyCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter); +// void CollidePoint([Const, Ref] Vec3 inPoint, [Ref] CollideShapeBodyCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter); +// void CollideOrientedBox([Const, Ref] OrientedBox inBox, [Ref] CollideShapeBodyCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter); +// void CastAABox([Const, Ref] AABoxCast inBox, [Ref] CastShapeBodyCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter); +//}; +// +//interface RayCastSettings { +// void RayCastSettings(); +// +// attribute EBackFaceMode mBackFaceMode; +// attribute boolean mTreatConvexAsSolid; +//}; +// +//interface CastRayCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="CastRayCollector"] +//interface CastRayCollectorJS { +// void CastRayCollectorJS(); +// void Reset(); +// void OnBody([Const, Ref] Body inBody); +// void AddHit([Const, Ref] RayCastResult inResult); +//}; +// +//interface ArrayRayCastResult { +// boolean empty(); +// long size(); +// [Ref] RayCastResult at(long inIndex); +// void push_back([Const, Ref] RayCastResult inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface CastRayAllHitCollisionCollector { +// void CastRayAllHitCollisionCollector(); +// void Sort(); +// boolean HadHit(); +// [Value] attribute ArrayRayCastResult mHits; +//}; +// +//CastRayAllHitCollisionCollector implements CastRayCollector; +// +//interface CastRayClosestHitCollisionCollector { +// void CastRayClosestHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute RayCastResult mHit; +//}; +// +//CastRayClosestHitCollisionCollector implements CastRayCollector; +// +//interface CastRayAnyHitCollisionCollector { +// void CastRayAnyHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute RayCastResult mHit; +//}; +// +//CastRayAnyHitCollisionCollector implements CastRayCollector; +// +//interface CollidePointResult { +// void CollidePointResult(); +// +// [Value] attribute BodyID mBodyID; +// [Value] attribute SubShapeID mSubShapeID2; +//}; +// +//interface CollidePointCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="CollidePointCollector"] +//interface CollidePointCollectorJS { +// void CollidePointCollectorJS(); +// void Reset(); +// void OnBody([Const, Ref] Body inBody); +// void AddHit([Const, Ref] CollidePointResult inResult); +//}; +// +//interface ArrayCollidePointResult { +// boolean empty(); +// long size(); +// [Ref] CollidePointResult at(long inIndex); +// void push_back([Const, Ref] CollidePointResult inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface CollidePointAllHitCollisionCollector { +// void CollidePointAllHitCollisionCollector(); +// void Sort(); +// boolean HadHit(); +// [Value] attribute ArrayCollidePointResult mHits; +//}; +// +//CollidePointAllHitCollisionCollector implements CollidePointCollector; +// +//interface CollidePointClosestHitCollisionCollector { +// void CollidePointClosestHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute CollidePointResult mHit; +//}; +// +//CollidePointClosestHitCollisionCollector implements CollidePointCollector; +// +//interface CollidePointAnyHitCollisionCollector { +// void CollidePointAnyHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute CollidePointResult mHit; +//}; +// +//CollidePointAnyHitCollisionCollector implements CollidePointCollector; +// +//interface CollideSettingsBase { +// attribute EActiveEdgeMode mActiveEdgeMode; +// attribute ECollectFacesMode mCollectFacesMode; +// attribute float mCollisionTolerance; +// attribute float mPenetrationTolerance; +// [Value] attribute Vec3 mActiveEdgeMovementDirection; +//}; +// +//interface CollideShapeSettings { +// void CollideShapeSettings(); +// +// attribute float mMaxSeparationDistance; +// attribute EBackFaceMode mBackFaceMode; +//}; +// +//CollideShapeSettings implements CollideSettingsBase; +// +//interface CollideShapeCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="CollideShapeCollector"] +//interface CollideShapeCollectorJS { +// void CollideShapeCollectorJS(); +// void Reset(); +// void OnBody([Const, Ref] Body inBody); +// void AddHit([Const, Ref] CollideShapeResult inResult); +//}; +// +//interface ArrayCollideShapeResult { +// boolean empty(); +// long size(); +// [Ref] CollideShapeResult at(long inIndex); +// void push_back([Const, Ref] CollideShapeResult inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface CollideShapeAllHitCollisionCollector { +// void CollideShapeAllHitCollisionCollector(); +// void Sort(); +// boolean HadHit(); +// [Value] attribute ArrayCollideShapeResult mHits; +//}; +// +//CollideShapeAllHitCollisionCollector implements CollideShapeCollector; +// +//interface CollideShapeClosestHitCollisionCollector { +// void CollideShapeClosestHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute CollideShapeResult mHit; +//}; +// +//CollideShapeClosestHitCollisionCollector implements CollideShapeCollector; +// +//interface CollideShapeAnyHitCollisionCollector { +// void CollideShapeAnyHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute CollideShapeResult mHit; +//}; +// +//CollideShapeAnyHitCollisionCollector implements CollideShapeCollector; +// +//interface ShapeCastSettings { +// void ShapeCastSettings(); +// +// attribute EBackFaceMode mBackFaceModeTriangles; +// attribute EBackFaceMode mBackFaceModeConvex; +// attribute boolean mUseShrunkenShapeAndConvexRadius; +// attribute boolean mReturnDeepestPoint; +//}; +// +//ShapeCastSettings implements CollideSettingsBase; +// +//interface ShapeCastResult { +// void ShapeCastResult(); +// +// attribute float mFraction; +// attribute boolean mIsBackFaceHit; +//}; +// +//ShapeCastResult implements CollideShapeResult; +// +//interface CastShapeCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="CastShapeCollector"] +//interface CastShapeCollectorJS { +// void CastShapeCollectorJS(); +// void Reset(); +// void OnBody([Const, Ref] Body inBody); +// void AddHit([Const, Ref] ShapeCastResult inResult); +//}; +// +//interface ArrayShapeCastResult { +// boolean empty(); +// long size(); +// [Ref] ShapeCastResult at(long inIndex); +// void push_back([Const, Ref] ShapeCastResult inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface CastShapeAllHitCollisionCollector { +// void CastShapeAllHitCollisionCollector(); +// void Sort(); +// boolean HadHit(); +// [Value] attribute ArrayShapeCastResult mHits; +//}; +// +//CastShapeAllHitCollisionCollector implements CastShapeCollector; +// +//interface CastShapeClosestHitCollisionCollector { +// void CastShapeClosestHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute ShapeCastResult mHit; +//}; +// +//CastShapeClosestHitCollisionCollector implements CastShapeCollector; +// +//interface CastShapeAnyHitCollisionCollector { +// void CastShapeAnyHitCollisionCollector(); +// boolean HadHit(); +// [Value] attribute ShapeCastResult mHit; +//}; +// +//CastShapeAnyHitCollisionCollector implements CastShapeCollector; +// +//interface TransformedShapeCollector { +// void Reset(); +// void SetContext([Const] TransformedShape inContext); +// [Const] TransformedShape GetContext(); +// void UpdateEarlyOutFraction(float inFraction); +// void ResetEarlyOutFraction(optional float inFraction); +// void ForceEarlyOut(); +// boolean ShouldEarlyOut(); +// float GetEarlyOutFraction(); +// float GetPositiveEarlyOutFraction(); +//}; +// +//[JSImplementation="TransformedShapeCollector"] +//interface TransformedShapeCollectorJS { +// void TransformedShapeCollectorJS(); +// void Reset(); +// void OnBody([Const, Ref] Body inBody); +// void AddHit([Const, Ref] TransformedShape inResult); +//}; +// +//interface NarrowPhaseQuery { +// void CastRay([Const, Ref] RRayCast inRay, [Const, Ref] RayCastSettings inRayCastSettings, [Ref] CastRayCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter); +// void CollidePoint([Const, Ref] RVec3 inPoint, [Ref] CollidePointCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter); +// void CollideShape([Const] Shape inShape, [Const, Ref] Vec3 inShapeScale, [Const, Ref] RMat44 inCenterOfMassTransform, [Const, Ref] CollideShapeSettings inCollideShapeSettings, [Const, Ref] RVec3 inBaseOffset, [Ref] CollideShapeCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter); +// void CastShape([Const, Ref] RShapeCast inShapeCast, [Const, Ref] ShapeCastSettings inShapeCastSettings, [Const, Ref] RVec3 inBaseOffset, [Ref] CastShapeCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter); +// void CollectTransformedShapes([Const, Ref] AABox inBox, [Ref] TransformedShapeCollector ioCollector, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter); +//}; +// +//interface PhysicsStepListener { +//}; +// +//[JSImplementation="PhysicsStepListener"] +//interface PhysicsStepListenerJS { +// void PhysicsStepListenerJS(); +// void OnStep(float inDeltaTime, [Ref] PhysicsSystem inSystem); +//}; +// +//interface BodyActivationListener { +//}; +// +//[JSImplementation="BodyActivationListener"] +//interface BodyActivationListenerJS { +// void BodyActivationListenerJS(); +// void OnBodyActivated([Const, Ref] BodyID inBodyID, unsigned long long inBodyUserData); +// void OnBodyDeactivated([Const, Ref] BodyID inBodyID, unsigned long long inBodyUserData); +//}; +// +//interface BodyIDVector { +// void BodyIDVector(); +// boolean empty(); +// long size(); +// [Ref] BodyID at(long inIndex); +// void push_back([Const, Ref] BodyID inBodyID); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface PhysicsSystem { +// void SetGravity([Const, Ref] Vec3 inGravity); +// [Value] Vec3 GetGravity(); +// [Const, Ref] PhysicsSettings GetPhysicsSettings(); +// void SetPhysicsSettings([Const, Ref] PhysicsSettings inPhysicsSettings); +// unsigned long GetNumBodies(); +// unsigned long GetNumActiveBodies(EBodyType inBodyType); +// unsigned long GetMaxBodies(); +// void GetBodies([Ref] BodyIDVector outBodies); +// void GetActiveBodies(EBodyType inBodyType, [Ref] BodyIDVector outBodies); +// [Const, Value] AABox GetBounds(); +// void AddConstraint(Constraint inConstraint); +// void RemoveConstraint(Constraint inConstraint); +// void SetContactListener(ContactListener inListener); +// ContactListener GetContactListener(); +// void SetSoftBodyContactListener(SoftBodyContactListener inListener); +// SoftBodyContactListener GetSoftBodyContactListener(); +// void OptimizeBroadPhase(); +// [Ref] BodyInterface GetBodyInterface(); +// [Ref] BodyInterface GetBodyInterfaceNoLock(); +// [Const, Ref] BodyLockInterfaceNoLock GetBodyLockInterfaceNoLock(); +// [Const, Ref] BodyLockInterfaceLocking GetBodyLockInterface(); +// [Const, Ref] BroadPhaseQuery GetBroadPhaseQuery(); +// [Const, Ref] NarrowPhaseQuery GetNarrowPhaseQuery(); +// [Const, Ref] NarrowPhaseQuery GetNarrowPhaseQueryNoLock(); +// void SaveState([Ref] StateRecorder inStream, optional EStateRecorderState inState = "EStateRecorderState_All"); +// boolean RestoreState([Ref] StateRecorder inStream); +// void AddStepListener(PhysicsStepListener inListener); +// void RemoveStepListener(PhysicsStepListener inListener); +// void SetBodyActivationListener(BodyActivationListener inListener); +// [Const] BodyActivationListener GetBodyActivationListener(); +// boolean WereBodiesInContact([Const, Ref] BodyID inBodyID1, [Const, Ref] BodyID inBodyID2); +//}; +// +//interface MassProperties { +// void MassProperties(); +// void SetMassAndInertiaOfSolidBox([Const, Ref] Vec3 inBoxSize, float inDensity); +// void ScaleToMass(float inMass); +// [Value] static Vec3 sGetEquivalentSolidBoxSize(float inMass, [Const, Ref] Vec3 inInertiaDiagonal); +// void Rotate([Const, Ref] Mat44 inRotation); +// void Translate([Const, Ref] Vec3 inTranslation); +// void Scale([Const, Ref] Vec3 inScale); +// +// attribute float mMass; +// [Value] attribute Mat44 mInertia; +//}; +// +//interface BodyCreationSettings { +// void BodyCreationSettings(); +// void BodyCreationSettings([Const] Shape inShape, [Ref] RVec3 inPosition, [Ref] Quat inRotation, EMotionType inMotionType, unsigned long inObjectLayer); +// [Const] ShapeSettings GetShapeSettings(); +// void SetShapeSettings([Const] ShapeSettings inShape); +// [Value] ShapeResult ConvertShapeSettings(); +// [Const] Shape GetShape(); +// void SetShape([Const] Shape inShape); +// boolean HasMassProperties(); +// [Value] MassProperties GetMassProperties(); +// +// [Value] attribute RVec3 mPosition; +// [Value] attribute Quat mRotation; +// [Value] attribute Vec3 mLinearVelocity; +// [Value] attribute Vec3 mAngularVelocity; +// attribute unsigned long long mUserData; +// attribute unsigned long mObjectLayer; +// [Value] attribute CollisionGroup mCollisionGroup; +// attribute EMotionType mMotionType; +// attribute EAllowedDOFs mAllowedDOFs; +// attribute boolean mAllowDynamicOrKinematic; +// attribute boolean mIsSensor; +// attribute boolean mUseManifoldReduction; +// attribute boolean mCollideKinematicVsNonDynamic; +// attribute boolean mApplyGyroscopicForce; +// attribute EMotionQuality mMotionQuality; +// attribute boolean mEnhancedInternalEdgeRemoval; +// attribute boolean mAllowSleeping; +// attribute float mFriction; +// attribute float mRestitution; +// attribute float mLinearDamping; +// attribute float mAngularDamping; +// attribute float mMaxLinearVelocity; +// attribute float mMaxAngularVelocity; +// attribute float mGravityFactor; +// attribute unsigned long mNumVelocityStepsOverride; +// attribute unsigned long mNumPositionStepsOverride; +// attribute EOverrideMassProperties mOverrideMassProperties; +// attribute float mInertiaMultiplier; +// [Value] attribute MassProperties mMassPropertiesOverride; +//}; +// +//interface SoftBodySharedSettingsVertex { +// void SoftBodySharedSettingsVertex(); +// +// [Value] attribute Float3 mPosition; +// [Value] attribute Float3 mVelocity; +// attribute float mInvMass; +//}; +// +//interface SoftBodySharedSettingsFace { +// void SoftBodySharedSettingsFace(unsigned long inVertex1, unsigned long inVertex2, unsigned long inVertex3, unsigned long inMaterialIndex); +// +// attribute unsigned long[] mVertex; +// attribute unsigned long mMaterialIndex; +//}; +// +//interface SoftBodySharedSettingsEdge { +// void SoftBodySharedSettingsEdge(unsigned long inVertex1, unsigned long inVertex2, float inCompliance); +// +// attribute unsigned long[] mVertex; +// attribute float mRestLength; +// attribute float mCompliance; +//}; +// +//interface SoftBodySharedSettingsDihedralBend { +// void SoftBodySharedSettingsDihedralBend(unsigned long inVertex1, unsigned long inVertex2, unsigned long inVertex3, unsigned long inVertex4, float inCompliance); +// +// attribute unsigned long[] mVertex; +// attribute float mCompliance; +// attribute float mInitialAngle; +//}; +// +//interface SoftBodySharedSettingsVolume { +// void SoftBodySharedSettingsVolume(unsigned long inVertex1, unsigned long inVertex2, unsigned long inVertex3, unsigned long inVertex4, float inCompliance); +// +// attribute unsigned long[] mVertex; +// attribute float mSixRestVolume; +// attribute float mCompliance; +//}; +// +//interface SoftBodySharedSettingsInvBind +//{ +// attribute unsigned long mJointIndex; +// [Value] attribute Mat44 mInvBind; +//}; +// +//interface SoftBodySharedSettingsSkinWeight +//{ +// attribute unsigned long mInvBindIndex; +// attribute float mWeight; +//}; +// +//interface SoftBodySharedSettingsSkinned +//{ +// attribute unsigned long mVertex; +// [Value] attribute SoftBodySharedSettingsSkinWeight[] mWeights; +// attribute float mMaxDistance; +// attribute float mBackStopDistance; +// attribute float mBackStopRadius; +//}; +// +//interface SoftBodySharedSettingsLRA { +// void SoftBodySharedSettingsLRA(unsigned long inVertex1, unsigned long inVertex2, float inMaxDistance); +// +// attribute unsigned long[] mVertex; +// attribute float mMaxDistance; +//}; +// +//interface ArraySoftBodySharedSettingsVertex { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsVertex at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsVertex inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArraySoftBodySharedSettingsFace { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsFace at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsFace inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArraySoftBodySharedSettingsEdge { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsEdge at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsEdge inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArraySoftBodySharedSettingsDihedralBend { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsDihedralBend at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsDihedralBend inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArraySoftBodySharedSettingsVolume { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsVolume at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsVolume inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArraySoftBodySharedSettingsInvBind { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsInvBind at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsInvBind inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArraySoftBodySharedSettingsSkinned { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsSkinned at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsSkinned inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArraySoftBodySharedSettingsLRA { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsLRA at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsLRA inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface SoftBodySharedSettingsVertexAttributes { +// void SoftBodySharedSettingsVertexAttributes(); +// +// attribute float mCompliance; +// attribute float mShearCompliance; +// attribute float mBendCompliance; +// attribute SoftBodySharedSettings_ELRAType mLRAType; +// attribute float mLRAMaxDistanceMultiplier; +//}; +// +//interface ArraySoftBodySharedSettingsVertexAttributes { +// boolean empty(); +// long size(); +// [Ref] SoftBodySharedSettingsVertexAttributes at(long inIndex); +// void push_back([Const, Ref] SoftBodySharedSettingsVertexAttributes inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +// SoftBodySharedSettingsVertexAttributes data(); +//}; +// +//interface SoftBodySharedSettings { +// void SoftBodySharedSettings(); +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// void CreateConstraints(SoftBodySharedSettingsVertexAttributes inVertexAttributes, unsigned long inVertexAttributesLength, optional SoftBodySharedSettings_EBendType inBendType, optional float inAngleTolerance); +// void AddFace([Const, Ref] SoftBodySharedSettingsFace inFace); +// void CalculateEdgeLengths(); +// void CalculateLRALengths(); +// void CalculateBendConstraintConstants(); +// void CalculateVolumeConstraintVolumes(); +// void CalculateSkinnedConstraintNormals(); +// void Optimize(); +// SoftBodySharedSettings Clone(); +// +// [Value] attribute ArraySoftBodySharedSettingsVertex mVertices; +// [Value] attribute ArraySoftBodySharedSettingsFace mFaces; +// [Value] attribute ArraySoftBodySharedSettingsEdge mEdgeConstraints; +// [Value] attribute ArraySoftBodySharedSettingsDihedralBend mDihedralBendConstraints; +// [Value] attribute ArraySoftBodySharedSettingsVolume mVolumeConstraints; +// [Value] attribute ArraySoftBodySharedSettingsSkinned mSkinnedConstraints; +// [Value] attribute ArraySoftBodySharedSettingsInvBind mInvBindMatrices; +// [Value] attribute ArraySoftBodySharedSettingsLRA mLRAConstraints; +// [Value] attribute PhysicsMaterialList mMaterials; +// attribute float mVertexRadius; +//}; +// +//interface SoftBodyCreationSettings { +// void SoftBodyCreationSettings([Const] SoftBodySharedSettings inSettings, [Ref] RVec3 inPosition, [Ref] Quat inRotation, unsigned long inObjectLayer); +// +// [Value] attribute RVec3 mPosition; +// [Value] attribute Quat mRotation; +// attribute unsigned long long mUserData; +// attribute unsigned long mObjectLayer; +// [Value] attribute CollisionGroup mCollisionGroup; +// attribute unsigned long mNumIterations; +// attribute float mLinearDamping; +// attribute float mMaxLinearVelocity; +// attribute float mRestitution; +// attribute float mFriction; +// attribute float mPressure; +// attribute float mGravityFactor; +// attribute boolean mUpdatePosition; +// attribute boolean mMakeRotationIdentity; +// attribute boolean mAllowSleeping; +//}; +// +//interface SoftBodyVertex { +// [Value] attribute Vec3 mPreviousPosition; +// [Value] attribute Vec3 mPosition; +// [Value] attribute Vec3 mVelocity; +// attribute float mInvMass; +//}; +// +//interface SoftBodyVertexTraits { +// static readonly attribute unsigned long mPreviousPositionOffset; +// static readonly attribute unsigned long mPositionOffset; +// static readonly attribute unsigned long mVelocityOffset; +//}; +// +//interface ArraySoftBodyVertex { +// boolean empty(); +// long size(); +// [Ref] SoftBodyVertex at(long inIndex); +// void push_back([Const, Ref] SoftBodyVertex inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface SoftBodyMotionProperties { +// [Const] SoftBodySharedSettings GetSettings(); +// [Ref] ArraySoftBodyVertex GetVertices(); +// [Ref] SoftBodyVertex GetVertex(unsigned long inIndex); +// [Const, Ref] PhysicsMaterialList GetMaterials(); +// [Const, Ref] ArraySoftBodySharedSettingsFace GetFaces(); +// [Const, Ref] SoftBodySharedSettingsFace GetFace(unsigned long inIndex); +// unsigned long GetNumIterations(); +// void SetNumIterations(unsigned long inNumIterations); +// float GetPressure(); +// void SetPressure(float inPressure); +// boolean GetUpdatePosition(); +// void SetUpdatePosition(boolean inUpdatePosition); +// boolean GetEnableSkinConstraints(); +// void SetEnableSkinConstraints(boolean inEnableSkinConstraints); +// float GetSkinnedMaxDistanceMultiplier(); +// void SetSkinnedMaxDistanceMultiplier(float inSkinnedMaxDistanceMultiplier); +// [Const, Ref] AABox GetLocalBounds(); +// void CustomUpdate(float inDeltaTime, [Ref] Body ioSoftBody, [Ref] PhysicsSystem inSystem); +// void SkinVertices([Const, Ref] RMat44 inRootTransform, Mat44MemRef inJointMatrices, unsigned long inNumJoints, boolean inHardSkinAll, [Ref] TempAllocator ioTempAllocator); +//}; +// +//SoftBodyMotionProperties implements MotionProperties; +// +//interface SoftBodyShape { +// [Const] unsigned long GetSubShapeIDBits(); +// [Const] unsigned long GetFaceIndex([Const, Ref] SubShapeID inSubShapeID); +//}; +// +//SoftBodyShape implements Shape; +// +//interface CharacterBaseSettings { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// +// [Value] attribute Vec3 mUp; +// [Value] attribute Plane mSupportingVolume; +// attribute float mMaxSlopeAngle; +// attribute boolean mEnhancedInternalEdgeRemoval; +// [Const] attribute Shape mShape; +//}; +// +//interface CharacterVirtualSettings { +// void CharacterVirtualSettings(); +// +// attribute float mMass; +// attribute float mMaxStrength; +// [Value] attribute Vec3 mShapeOffset; +// attribute EBackFaceMode mBackFaceMode; +// attribute float mPredictiveContactDistance; +// attribute unsigned long mMaxCollisionIterations; +// attribute unsigned long mMaxConstraintIterations; +// attribute float mMinTimeRemaining; +// attribute float mCollisionTolerance; +// attribute float mCharacterPadding; +// attribute unsigned long mMaxNumHits; +// attribute float mHitReductionCosMaxAngle; +// attribute float mPenetrationRecoverySpeed; +//}; +// +//CharacterVirtualSettings implements CharacterBaseSettings; +// +//interface CharacterContactSettings { +// void CharacterContactSettings(); +// +// attribute boolean mCanPushCharacter; +// attribute boolean mCanReceiveImpulses; +//}; +// +//interface CharacterContactListener { +//}; +// +//interface CharacterContactListenerEm { +//}; +// +//CharacterContactListenerEm implements CharacterContactListener; +// +//[JSImplementation="CharacterContactListenerEm"] +//interface CharacterContactListenerJS { +// void CharacterContactListenerJS(); +// void OnAdjustBodyVelocity([Const] CharacterVirtual inCharacter, [Const, Ref] Body inBody2, [Ref] Vec3 ioLinearVelocity, [Ref] Vec3 ioAngularVelocity); +// boolean OnContactValidate([Const] CharacterVirtual inCharacter, [Const, Ref] BodyID inBodyID2, [Const, Ref] SubShapeID inSubShapeID2); +// boolean OnCharacterContactValidate([Const] CharacterVirtual inCharacter, [Const] CharacterVirtual inOtherCharacter, [Const, Ref] SubShapeID inSubShapeID2); +// void OnContactAdded([Const] CharacterVirtual inCharacter, [Const, Ref] BodyID inBodyID2, [Const, Ref] SubShapeID inSubShapeID2, [Const] RVec3 inContactPosition, [Const] Vec3 inContactNormal, [Ref] CharacterContactSettings ioSettings); +// void OnCharacterContactAdded([Const] CharacterVirtual inCharacter, [Const] CharacterVirtual inOtherCharacter, [Const, Ref] SubShapeID inSubShapeID2, [Const] RVec3 inContactPosition, [Const] Vec3 inContactNormal, [Ref] CharacterContactSettings ioSettings); +// void OnContactSolve([Const] CharacterVirtual inCharacter, [Const, Ref] BodyID inBodyID2, [Const, Ref] SubShapeID inSubShapeID2, [Const] RVec3 inContactPosition, [Const] Vec3 inContactNormal, [Const] Vec3 inContactVelocity, [Const] PhysicsMaterial inContactMaterial, [Const] Vec3 inCharacterVelocity, [Ref] Vec3 ioNewCharacterVelocity); +// void OnCharacterContactSolve([Const] CharacterVirtual inCharacter, [Const] CharacterVirtual inOtherCharacter, [Const, Ref] SubShapeID inSubShapeID2, [Const] RVec3 inContactPosition, [Const] Vec3 inContactNormal, [Const] Vec3 inContactVelocity, [Const] PhysicsMaterial inContactMaterial, [Const] Vec3 inCharacterVelocity, [Ref] Vec3 ioNewCharacterVelocity); +//}; +// +//interface CharacterVsCharacterCollision { +//}; +// +//interface CharacterVsCharacterCollisionSimple { +// void Add(CharacterVirtual inCharacter); +// void Remove(CharacterVirtual inCharacter); +//}; +// +//CharacterVsCharacterCollisionSimple implements CharacterVsCharacterCollision; +// +//[Prefix="CharacterVirtual::"] +//interface ExtendedUpdateSettings { +// void ExtendedUpdateSettings(); +// +// [Value] attribute Vec3 mStickToFloorStepDown; +// [Value] attribute Vec3 mWalkStairsStepUp; +// attribute float mWalkStairsMinStepForward; +// attribute float mWalkStairsStepForwardTest; +// attribute float mWalkStairsCosAngleForwardContact; +// [Value] attribute Vec3 mWalkStairsStepDownExtra; +//}; +// +//interface TempAllocator { +//}; +// +//interface BroadPhaseLayerFilter { +// void BroadPhaseLayerFilter(); +//}; +// +//interface ObjectVsBroadPhaseLayerFilter { +// void ObjectVsBroadPhaseLayerFilter(); +//}; +// +//interface ObjectVsBroadPhaseLayerFilterEm { +//}; +// +//ObjectVsBroadPhaseLayerFilterEm implements ObjectVsBroadPhaseLayerFilter; +// +//[JSImplementation="ObjectVsBroadPhaseLayerFilterEm"] +//interface ObjectVsBroadPhaseLayerFilterJS { +// void ObjectVsBroadPhaseLayerFilterJS(); +// [Const] boolean ShouldCollide(unsigned long inLayer1, BroadPhaseLayer inLayer2); +//}; +// +//interface DefaultBroadPhaseLayerFilter { +// void DefaultBroadPhaseLayerFilter([Const, Ref] ObjectVsBroadPhaseLayerFilter inFilter, unsigned long inObjectLayer); +//}; +// +//DefaultBroadPhaseLayerFilter implements ObjectLayerFilter; +// +//interface ObjectLayerFilter { +// void ObjectLayerFilter(); +//}; +// +//[JSImplementation="ObjectLayerFilter"] +//interface ObjectLayerFilterJS { +// void ObjectLayerFilterJS(); +// [Const] boolean ShouldCollide(unsigned long inLayer); +//}; +// +//interface ObjectLayerPairFilter { +// void ObjectLayerPairFilter(); +// boolean ShouldCollide(unsigned long inLayer1, unsigned long inLayer2); +//}; +// +//[JSImplementation="ObjectLayerPairFilter"] +//interface ObjectLayerPairFilterJS { +// void ObjectLayerPairFilterJS(); +// [Const] boolean ShouldCollide(unsigned long inLayer1, unsigned long inLayer2); +//}; +// +//interface DefaultObjectLayerFilter { +// void DefaultObjectLayerFilter([Const, Ref] ObjectLayerPairFilter inFilter, unsigned long inObjectLayer); +//}; +// +//DefaultObjectLayerFilter implements ObjectLayerFilter; +// +//interface SpecifiedObjectLayerFilter { +// void SpecifiedObjectLayerFilter(unsigned long inObjectLayer); +//}; +// +//SpecifiedObjectLayerFilter implements ObjectLayerFilter; +// +//interface BodyFilter { +// void BodyFilter(); +//}; +// +//[JSImplementation="BodyFilter"] +//interface BodyFilterJS { +// void BodyFilterJS(); +// [Const] boolean ShouldCollide([Const, Ref] BodyID inBodyID); +// [Const] boolean ShouldCollideLocked([Const, Ref] Body inBody); +//}; +// +//interface IgnoreSingleBodyFilter { +// void IgnoreSingleBodyFilter([Const, Ref] BodyID inBodyID); +//}; +// +//IgnoreSingleBodyFilter implements BodyFilter; +// +//interface IgnoreMultipleBodiesFilter { +// void IgnoreMultipleBodiesFilter(); +// void Clear(); +// void Reserve(unsigned long inSize); +// void IgnoreBody([Const, Ref] BodyID inBodyID); +//}; +// +//IgnoreMultipleBodiesFilter implements BodyFilter; +// +//interface ShapeFilter { +// void ShapeFilter(); +//}; +// +//[JSImplementation="ShapeFilter"] +//interface ShapeFilterJS { +// void ShapeFilterJS(); +// [Const] boolean ShouldCollide([Const] Shape inShape2, [Const, Ref] SubShapeID inSubShapeIDOfShape2); +//}; +// +//[JSImplementation="ShapeFilter"] +//interface ShapeFilterJS2 { +// void ShapeFilterJS2(); +// [Const] boolean ShouldCollide([Const] Shape inShape1, [Const, Ref] SubShapeID inSubShapeIDOfShape1, [Const] Shape inShape2, [Const, Ref] SubShapeID inSubShapeIDOfShape2); +//}; +// +//interface CharacterBase { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// void SetMaxSlopeAngle(float inMaxSlopeAngle); +// float GetCosMaxSlopeAngle(); +// void SetUp([Const, Ref] Vec3 inUp); +// [Value] Vec3 GetUp(); +// [Const] Shape GetShape(); +// EGroundState GetGroundState(); +// boolean IsSlopeTooSteep([Ref] Vec3 inNormal); +// boolean IsSupported(); +// [Value] RVec3 GetGroundPosition(); +// [Value] Vec3 GetGroundNormal(); +// [Value] Vec3 GetGroundVelocity(); +// [Const] PhysicsMaterial GetGroundMaterial(); +// [Value] BodyID GetGroundBodyID(); +//}; +// +//interface CharacterVirtual { +// void CharacterVirtual([Const] CharacterVirtualSettings inSettings, [Ref] RVec3 inPosition, [Ref] Quat inRotation, PhysicsSystem inSystem); +// void SetListener(CharacterContactListener inListener); +// void SetCharacterVsCharacterCollision(CharacterVsCharacterCollision inCharacterVsCharacterCollision); +// CharacterContactListener GetListener(); +// [Value] Vec3 GetLinearVelocity(); +// void SetLinearVelocity([Const, Ref] Vec3 inLinearVelocity); +// [Value] RVec3 GetPosition(); +// void SetPosition([Const, Ref] RVec3 inPosition); +// [Value] Quat GetRotation(); +// void SetRotation([Const, Ref] Quat inRotation); +// [Value] RMat44 GetWorldTransform(); +// [Value] RMat44 GetCenterOfMassTransform(); +// float GetMass(); +// void SetMass(float inMass); +// float GetMaxStrength(); +// void SetMaxStrength(float inMaxStrength); +// float GetPenetrationRecoverySpeed(); +// void SetPenetrationRecoverySpeed(float inSpeed); +// float GetCharacterPadding(); +// unsigned long GetMaxNumHits(); +// void SetMaxNumHits(unsigned long inMaxHits); +// float GetHitReductionCosMaxAngle(); +// void SetHitReductionCosMaxAngle(float inCosMaxAngle); +// boolean GetMaxHitsExceeded(); +// [Value] Vec3 GetShapeOffset(); +// void SetShapeOffset([Const, Ref] Vec3 inShapeOffset); +// unsigned long long GetUserData(); +// void SetUserData(unsigned long long inUserData); +// [Value] Vec3 CancelVelocityTowardsSteepSlopes([Const, Ref] Vec3 inDesiredVelocity); +// void Update(float inDeltaTime, [Const, Ref] Vec3 inGravity, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter, [Ref] TempAllocator inAllocator); +// boolean CanWalkStairs([Const, Ref] Vec3 inLinearVelocity); +// boolean WalkStairs(float inDeltaTime, [Const, Ref] Vec3 inStepUp, [Const, Ref] Vec3 inStepForward, [Const, Ref] Vec3 inStepForwardTest, [Const, Ref] Vec3 inStepDownExtra, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter, [Ref] TempAllocator inAllocator); +// boolean StickToFloor([Const, Ref] Vec3 inStepDown, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter, [Ref] TempAllocator inAllocator); +// void ExtendedUpdate(float inDeltaTime, [Const, Ref] Vec3 inGravity, [Const, Ref] ExtendedUpdateSettings inSettings, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter, [Ref] TempAllocator inAllocator); +// void RefreshContacts([Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter, [Ref] TempAllocator inAllocator); +// void UpdateGroundVelocity(); +// boolean SetShape([Const] Shape inShape, float inMaxPenetrationDepth, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter, [Ref] TempAllocator inAllocator); +//}; +// +//CharacterVirtual implements CharacterBase; +// +//interface LinearCurve { +// void LinearCurve(); +// void Clear(); +// void Reserve(unsigned long inSize); +// void AddPoint(float inX, float inY); +// void Sort(); +// float GetMinX(); +// float GetMaxX(); +// float GetValue(float inX); +//}; +// +//interface ArrayFloat { +// boolean empty(); +// long size(); +// float at(long inIndex); +// void push_back(float inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +// FloatMemRef data(); +//}; +// +//interface ArrayUint { +// boolean empty(); +// long size(); +// unsigned long at(long inIndex); +// void push_back(unsigned long inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +// UintMemRef data(); +//}; +// +//interface ArrayUint8 { +// boolean empty(); +// long size(); +// octet at(long inIndex); +// void push_back(octet inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +// Uint8MemRef data(); +//}; +// +//interface ArrayVehicleAntiRollBar { +// boolean empty(); +// long size(); +// [Ref] VehicleAntiRollBar at(long inIndex); +// void push_back([Ref] VehicleAntiRollBar inValue); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArrayWheelSettings { +// boolean empty(); +// long size(); +// WheelSettings at(long inIndex); +// void push_back(WheelSettings inValue); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface ArrayVehicleDifferentialSettings { +// boolean empty(); +// long size(); +// [Ref] VehicleDifferentialSettings at(long inIndex); +// void push_back([Ref] VehicleDifferentialSettings inValue); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface VehicleCollisionTester { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +//}; +// +//interface VehicleCollisionTesterRay { +// void VehicleCollisionTesterRay(unsigned long inObjectLayer, [Ref] optional Vec3 inUp, optional float inMaxSlopeAngle); +//}; +// +//VehicleCollisionTesterRay implements VehicleCollisionTester; +// +//interface VehicleCollisionTesterCastSphere { +// void VehicleCollisionTesterCastSphere(unsigned long inObjectLayer, float inRadius, [Ref] optional Vec3 inUp, optional float inMaxSlopeAngle); +//}; +// +//VehicleCollisionTesterCastSphere implements VehicleCollisionTester; +// +//interface VehicleCollisionTesterCastCylinder { +// void VehicleCollisionTesterCastCylinder(unsigned long inObjectLayer, optional float inConvexRadiusFraction); +//}; +// +//VehicleCollisionTesterCastCylinder implements VehicleCollisionTester; +// +//interface VehicleConstraintSettings { +// void VehicleConstraintSettings(); +// +// [Value] attribute Vec3 mUp; +// [Value] attribute Vec3 mForward; +// attribute float mMaxPitchRollAngle; +// [Value] attribute ArrayWheelSettings mWheels; +// [Value] attribute ArrayVehicleAntiRollBar mAntiRollBars; +// attribute VehicleControllerSettings mController; +//}; +// +//VehicleConstraintSettings implements ConstraintSettings; +// +//interface VehicleConstraint { +// void VehicleConstraint([Ref] Body inVehicleBody, [Const, Ref] VehicleConstraintSettings inSettings); +// void SetMaxPitchRollAngle(float inMaxPitchRollAngle); +// void SetVehicleCollisionTester([Const] VehicleCollisionTester inTester); +// void OverrideGravity([Const, Ref] Vec3 inGravity); +// boolean IsGravityOverridden(); +// [Value] Vec3 GetGravityOverride(); +// void ResetGravityOverride(); +// [Value] Vec3 GetLocalUp(); +// [Value] Vec3 GetLocalForward(); +// [Value] Vec3 GetWorldUp(); +// Body GetVehicleBody(); +// VehicleController GetController(); +// [Const] Wheel GetWheel(unsigned long inIdx); +// [Value] Mat44 GetWheelLocalTransform(unsigned long inWheelIndex, [Ref] Vec3 inWheelRight, [Ref] Vec3 inWheelUp); +// [Value] RMat44 GetWheelWorldTransform(unsigned long inWheelIndex, [Ref] Vec3 inWheelRight, [Ref] Vec3 inWheelUp); +// void SetNumStepsBetweenCollisionTestActive(unsigned long inSteps); +// [Const] unsigned long GetNumStepsBetweenCollisionTestActive(); +// void SetNumStepsBetweenCollisionTestInactive(unsigned long inSteps); +// [Const] unsigned long GetNumStepsBetweenCollisionTestInactive(); +//}; +// +//VehicleConstraint implements Constraint; +// +//interface VehicleConstraintStepListener { +// void VehicleConstraintStepListener(VehicleConstraint inConstraint); +//}; +// +//VehicleConstraintStepListener implements PhysicsStepListener; +// +//interface VehicleConstraintCallbacksEm { +// void SetVehicleConstraint([Ref] VehicleConstraint inConstraint); +//}; +// +//[JSImplementation="VehicleConstraintCallbacksEm"] +//interface VehicleConstraintCallbacksJS { +// void VehicleConstraintCallbacksJS(); +// float GetCombinedFriction(unsigned long inWheelIndex, ETireFrictionDirection inTireFrictionDirection, float inTireFriction, [Const, Ref] Body inBody2, [Const, Ref] SubShapeID inSubShapeID2); +// void OnPreStepCallback([Ref] VehicleConstraint inVehicle, float inDeltaTime, [Ref] PhysicsSystem inPhysicsSystem); +// void OnPostCollideCallback([Ref] VehicleConstraint inVehicle, float inDeltaTime, [Ref] PhysicsSystem inPhysicsSystem); +// void OnPostStepCallback([Ref] VehicleConstraint inVehicle, float inDeltaTime, [Ref] PhysicsSystem inPhysicsSystem); +//}; +// +//interface TireMaxImpulseCallbackResult { +// attribute float mLongitudinalImpulse; +// attribute float mLateralImpulse; +//}; +// +//interface WheeledVehicleControllerCallbacksEm { +// void SetWheeledVehicleController([Ref] WheeledVehicleController inController); +//}; +// +//[JSImplementation="WheeledVehicleControllerCallbacksEm"] +//interface WheeledVehicleControllerCallbacksJS { +// void WheeledVehicleControllerCallbacksJS(); +// void OnTireMaxImpulseCallback(unsigned long inWheelIndex, TireMaxImpulseCallbackResult outResult, float inSuspensionImpulse, float inLongitudinalFriction, float inLateralFriction, float inLongitudinalSlip, float inLateralSlip, float inDeltaTime); +//}; +// +//interface WheelSettings { +// void WheelSettings(); +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +// +// [Value] attribute Vec3 mPosition; +// [Value] attribute Vec3 mSuspensionForcePoint; +// [Value] attribute Vec3 mSuspensionDirection; +// [Value] attribute Vec3 mSteeringAxis; +// [Value] attribute Vec3 mWheelUp; +// [Value] attribute Vec3 mWheelForward; +// [Value] attribute SpringSettings mSuspensionSpring; +// attribute float mSuspensionMinLength; +// attribute float mSuspensionMaxLength; +// attribute float mSuspensionPreloadLength; +// attribute float mRadius; +// attribute float mWidth; +// attribute boolean mEnableSuspensionForcePoint; +//}; +// +//interface VehicleAntiRollBar { +// void VehicleAntiRollBar(); +// +// attribute long mLeftWheel; +// attribute long mRightWheel; +// attribute float mStiffness; +//}; +// +//interface Wheel { +// void Wheel([Const, Ref] WheelSettings inSettings); +// [Const] WheelSettings GetSettings(); +// float GetAngularVelocity(); +// void SetAngularVelocity(float inVel); +// float GetRotationAngle(); +// void SetRotationAngle(float inAngle); +// float GetSteerAngle(); +// void SetSteerAngle(float inAngle); +// boolean HasContact(); +// [Value] BodyID GetContactBodyID(); +// [Value] RVec3 GetContactPosition(); +// [Value] Vec3 GetContactPointVelocity(); +// [Value] Vec3 GetContactNormal(); +// [Value] Vec3 GetContactLongitudinal(); +// [Value] Vec3 GetContactLateral(); +// float GetSuspensionLength(); +// boolean HasHitHardPoint(); +// float GetSuspensionLambda(); +// float GetLongitudinalLambda(); +// float GetLateralLambda(); +//}; +// +//interface WheelSettingsWV { +// void WheelSettingsWV(); +// +// attribute float mInertia; +// attribute float mAngularDamping; +// attribute float mMaxSteerAngle; +// [Value] attribute LinearCurve mLongitudinalFriction; +// [Value] attribute LinearCurve mLateralFriction; +// attribute float mMaxBrakeTorque; +// attribute float mMaxHandBrakeTorque; +//}; +// +//WheelSettingsWV implements WheelSettings; +// +//interface WheelWV { +// void WheelWV([Const, Ref] WheelSettingsWV inWheel); +// [Const] WheelSettingsWV GetSettings(); +// +// attribute float mLongitudinalSlip; +// attribute float mLateralSlip; +// attribute float mCombinedLongitudinalFriction; +// attribute float mCombinedLateralFriction; +// attribute float mBrakeImpulse; +//}; +// +//WheelWV implements Wheel; +// +//interface WheelSettingsTV { +// void WheelSettingsTV(); +// +// attribute float mLongitudinalFriction; +// attribute float mLateralFriction; +//}; +// +//WheelSettingsTV implements WheelSettings; +// +//interface WheelTV { +// void WheelTV([Const, Ref] WheelSettingsTV inWheel); +// [Const] WheelSettingsTV GetSettings(); +// +// attribute long mTrackIndex; +// attribute float mCombinedLongitudinalFriction; +// attribute float mCombinedLateralFriction; +// attribute float mBrakeImpulse; +//}; +// +//WheelTV implements Wheel; +// +//interface VehicleTrackSettings { +// attribute long mDrivenWheel; +// [Value] attribute ArrayUint mWheels; +// attribute float mInertia; +// attribute float mAngularDamping; +// attribute float mMaxBrakeTorque; +// attribute float mDifferentialRatio; +//}; +// +//interface VehicleTrack { +// attribute float mAngularVelocity; +//}; +// +//VehicleTrack implements VehicleTrackSettings; +// +//interface WheeledVehicleControllerSettings { +// void WheeledVehicleControllerSettings(); +// +// [Value] attribute VehicleEngineSettings mEngine; +// [Value] attribute VehicleTransmissionSettings mTransmission; +// [Value] attribute ArrayVehicleDifferentialSettings mDifferentials; +// attribute float mDifferentialLimitedSlipRatio; +//}; +// +//WheeledVehicleControllerSettings implements VehicleControllerSettings; +// +//interface TrackedVehicleControllerSettings { +// void TrackedVehicleControllerSettings(); +// +// [Value] attribute VehicleEngineSettings mEngine; +// [Value] attribute VehicleTransmissionSettings mTransmission; +// [Value] attribute VehicleTrackSettings[] mTracks; +//}; +// +//TrackedVehicleControllerSettings implements VehicleControllerSettings; +// +//interface TrackedVehicleController { +// void TrackedVehicleController([Const, Ref] TrackedVehicleControllerSettings inSettings, [Ref] VehicleConstraint inConstraint); +// void SetDriverInput(float inForward, float inLeftRatio, float inRightRatio, float inBrake); +// void SetForwardInput(float inForward); +// float GetForwardInput(); +// void SetLeftRatio(float inLeftRatio); +// float GetLeftRatio(); +// void SetRightRatio(float inRightRatio); +// float GetRightRatio(); +// void SetBrakeInput(float inBrake); +// float GetBrakeInput(); +// [Ref] VehicleEngine GetEngine(); +// [Ref] VehicleTransmission GetTransmission(); +// VehicleTrack[] GetTracks(); +//}; +// +//TrackedVehicleController implements VehicleController; +// +//interface VehicleEngineSettings { +// attribute float mMaxTorque; +// attribute float mMinRPM; +// attribute float mMaxRPM; +// [Value] attribute LinearCurve mNormalizedTorque; +// attribute float mInertia; +// attribute float mAngularDamping; +//}; +// +//interface VehicleEngine { +// void ClampRPM(); +// float GetCurrentRPM(); +// void SetCurrentRPM(float inRPM); +// float GetAngularVelocity(); +// float GetTorque(float inAcceleration); +//}; +// +//VehicleEngine implements VehicleEngineSettings; +// +//interface VehicleTransmissionSettings { +// attribute ETransmissionMode mMode; +// [Value] attribute ArrayFloat mGearRatios; +// [Value] attribute ArrayFloat mReverseGearRatios; +// attribute float mSwitchTime; +// attribute float mClutchReleaseTime; +// attribute float mSwitchLatency; +// attribute float mShiftUpRPM; +// attribute float mShiftDownRPM; +// attribute float mClutchStrength; +//}; +// +//interface VehicleTransmission { +// void Set(long inCurrentGear, float inClutchFriction); +// long GetCurrentGear(); +// float GetClutchFriction(); +// boolean IsSwitchingGear(); +// float GetCurrentRatio(); +//}; +// +//VehicleTransmission implements VehicleTransmissionSettings; +// +//interface VehicleDifferentialSettings { +// void VehicleDifferentialSettings(); +// +// attribute long mLeftWheel; +// attribute long mRightWheel; +// attribute float mDifferentialRatio; +// attribute float mLeftRightSplit; +// attribute float mLimitedSlipRatio; +// attribute float mEngineTorqueRatio; +//}; +// +//interface VehicleControllerSettings { +//}; +// +//interface VehicleController { +// unsigned long GetRefCount(); +// void AddRef(); +// void Release(); +//}; +// +//interface WheeledVehicleController { +// void WheeledVehicleController([Const, Ref] WheeledVehicleControllerSettings inSettings, [Ref] VehicleConstraint inConstraint); +// void SetDriverInput(float inForward, float inRight, float inBrake, float inHandBrake); +// void SetForwardInput(float inForward); +// float GetForwardInput(); +// void SetRightInput(float inRight); +// float GetRightInput(); +// void SetBrakeInput(float inBrake); +// float GetBrakeInput(); +// void SetHandBrakeInput(float inHandBrake); +// float GetHandBrakeInput(); +// [Ref] VehicleEngine GetEngine(); +// [Ref] VehicleTransmission GetTransmission(); +// [Ref] ArrayVehicleDifferentialSettings GetDifferentials(); +// float GetDifferentialLimitedSlipRatio(); +// void SetDifferentialLimitedSlipRatio(float inV); +// float GetWheelSpeedAtClutch(); +//}; +// +//WheeledVehicleController implements VehicleController; +// +//interface MotorcycleControllerSettings { +// void MotorcycleControllerSettings(); +// +// attribute float mMaxLeanAngle; +// attribute float mLeanSpringConstant; +// attribute float mLeanSpringDamping; +// attribute float mLeanSpringIntegrationCoefficient; +// attribute float mLeanSpringIntegrationCoefficientDecay; +// attribute float mLeanSmoothingFactor; +//}; +// +//MotorcycleControllerSettings implements WheeledVehicleControllerSettings; +// +//interface MotorcycleController { +// void MotorcycleController([Const, Ref] MotorcycleControllerSettings inSettings, [Ref] VehicleConstraint inConstraint); +// float GetWheelBase(); +// void EnableLeanController(boolean inEnable); +// boolean IsLeanControllerEnabled(); +//}; +// +//MotorcycleController implements WheeledVehicleController; +// +//interface Skeleton { +// void Skeleton(); +// long AddJoint([Const, Ref] JPHString inName, long inParentIndex); +// long GetJointCount(); +// boolean AreJointsCorrectlyOrdered(); +// void CalculateParentJointIndices(); +//}; +// +//interface SkeletalAnimationJointState { +// void FromMatrix([Const, Ref] Mat44 inMatrix); +// [Value] Mat44 ToMatrix(); +// +// [Value] attribute Vec3 mTranslation; +// [Value] attribute Quat mRotation; +//}; +// +//interface SkeletalAnimationKeyframe { +// void SkeletalAnimationKeyframe(); +// +// attribute float mTime; +//}; +// +//SkeletalAnimationKeyframe implements SkeletalAnimationJointState; +// +//interface ArraySkeletonKeyframe { +// void ArraySkeletonKeyframe(); +// boolean empty(); +// long size(); +// [Ref] SkeletalAnimationKeyframe at(long inIndex); +// void push_back([Ref] SkeletalAnimationKeyframe inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface SkeletalAnimationAnimatedJoint { +// void SkeletalAnimationAnimatedJoint(); +// +// [Value] attribute JPHString mJointName; +// [Value] attribute ArraySkeletonKeyframe mKeyframes; +//}; +// +//interface ArraySkeletonAnimatedJoint { +// void ArraySkeletonAnimatedJoint(); +// boolean empty(); +// long size(); +// [Ref] SkeletalAnimationAnimatedJoint at(long inIndex); +// void push_back([Ref] SkeletalAnimationAnimatedJoint inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface SkeletalAnimation { +// void SkeletalAnimation(); +// float GetDuration(); +// void ScaleJoints(float inScale); +// void Sample(float inTime, [Ref] SkeletonPose ioPose); +// [Ref] ArraySkeletonAnimatedJoint GetAnimatedJoints(); +//}; +// +//interface SkeletonPose { +// void SkeletonPose(); +// void SetSkeleton([Const] Skeleton inSkeleton); +// [Const] Skeleton GetSkeleton(); +// void SetRootOffset([Ref] RVec3 inOffset); +// [Value] RVec3 GetRootOffset(); +// long GetJointCount(); +// [Ref] SkeletalAnimationJointState GetJoint(long inJoint); +// [Ref] ArrayMat44 GetJointMatrices(); +// [Ref] Mat44 GetJointMatrix(long inJoint); +// void CalculateJointMatrices(); +// void CalculateJointStates(); +//}; +// +//interface RagdollPart { +// attribute TwoBodyConstraintSettings mToParent; +//}; +// +//RagdollPart implements BodyCreationSettings; +// +//interface ArrayRagdollPart { +// void ArrayRagdollPart(); +// boolean empty(); +// long size(); +// [Ref] RagdollPart at(long inIndex); +// void push_back([Ref] RagdollPart inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface RagdollAdditionalConstraint { +// attribute long[] mBodyIdx; +// attribute TwoBodyConstraintSettings mConstraint; +//}; +// +//interface ArrayRagdollAdditionalConstraint { +// void ArrayRagdollAdditionalConstraint(); +// boolean empty(); +// long size(); +// [Ref] RagdollAdditionalConstraint at(long inIndex); +// void push_back([Ref] RagdollAdditionalConstraint inValue); +// void reserve(unsigned long inSize); +// void resize(unsigned long inSize); +// void clear(); +//}; +// +//interface RagdollSettings { +// void RagdollSettings(); +// boolean Stabilize(); +// Ragdoll CreateRagdoll(long inCollisionGroup, long inUserData, PhysicsSystem inSystem); +// Skeleton GetSkeleton(); +// void DisableParentChildCollisions([Const] optional Mat44MemRef inJointMatrices, optional float inMinSeparationDistance); +// void CalculateBodyIndexToConstraintIndex(); +// void CalculateConstraintIndexToBodyIdxPair(); +// +// attribute Skeleton mSkeleton; +// [Value] attribute ArrayRagdollPart mParts; +// [Value] attribute ArrayRagdollAdditionalConstraint mAdditionalConstraints; +//}; +// +//interface Ragdoll { +// void Ragdoll(PhysicsSystem inSystem); +// void AddToPhysicsSystem(EActivation inActivationMode, optional boolean inLockBodies); +// void RemoveFromPhysicsSystem(optional boolean inLockBodies); +// void Activate(optional boolean inLockBodies); +// boolean IsActive(optional boolean inLockBodies); +// void SetGroupID(long inGroupID, optional boolean inLockBodies); +// void SetPose([Const, Ref] SkeletonPose inPose, optional boolean inLockBodies); +// void GetPose([Ref] SkeletonPose outPose, optional boolean inLockBodies); +// void ResetWarmStart(); +// void DriveToPoseUsingKinematics([Const, Ref] SkeletonPose inPose, float inDeltaTime, optional boolean inLockBodies); +// void DriveToPoseUsingMotors([Const, Ref] SkeletonPose inPose); +// void SetLinearAndAngularVelocity([Const, Ref] Vec3 inLinearVelocity, [Const, Ref] Vec3 inAngularVelocity, optional boolean inLockBodies); +// void SetLinearVelocity([Const, Ref] Vec3 inLinearVelocity, optional boolean inLockBodies); +// void AddLinearVelocity([Const, Ref] Vec3 inLinearVelocity, optional boolean inLockBodies); +// void AddImpulse([Const, Ref] Vec3 inImpulse, optional boolean inLockBodies); +// void GetRootTransform([Ref] RVec3 outPosition, [Ref] Quat outRotation, optional boolean inLockBodies); +// long GetBodyCount(); +// [Value] BodyID GetBodyID(long inBodyIndex); +// [Const, Ref] BodyIDVector GetBodyIDs(); +// long GetConstraintCount(); +// [Value] AABox GetWorldSpaceBounds(optional boolean inLockBodies); +// [Const] TwoBodyConstraint GetConstraint(long inConstraintIndex); +// [Const] RagdollSettings GetRagdollSettings(); +//}; +// +//interface BroadPhaseLayerInterface { +// unsigned long GetNumBroadPhaseLayers(); +//}; +// +//interface BroadPhaseLayer { +// void BroadPhaseLayer(unsigned short inLayer); +// unsigned short GetValue(); +//}; +// +//interface BroadPhaseLayerInterfaceEm { +//}; +// +//BroadPhaseLayerInterfaceEm implements BroadPhaseLayerInterface; +// +//[JSImplementation="BroadPhaseLayerInterfaceEm"] +//interface BroadPhaseLayerInterfaceJS { +// void BroadPhaseLayerInterfaceJS(); +// [Const] unsigned long GetNumBroadPhaseLayers(); +// [Const] unsigned short GetBPLayer(unsigned long inLayer); // Unfortunately the C++ version of GetBroadPhaseLayer is not compatible with JS so we have to use a different name and use an unsigned short instead of a BroadPhaseLayer +//}; +// +//interface BroadPhaseLayerInterfaceTable { +// void BroadPhaseLayerInterfaceTable(unsigned long inNumObjectLayers, unsigned long inNumBroadPhaseLayers); +// void MapObjectToBroadPhaseLayer(unsigned long inObjectLayer, [Const, Ref] BroadPhaseLayer inBroadPhaseLayer); +//}; +// +//BroadPhaseLayerInterfaceTable implements BroadPhaseLayerInterface; +// +//interface ObjectVsBroadPhaseLayerFilterTable { +// void ObjectVsBroadPhaseLayerFilterTable([Const, Ref] BroadPhaseLayerInterface inBroadPhaseLayerInterface, unsigned long inNumBroadPhaseLayers, [Const, Ref] ObjectLayerPairFilter inObjectLayerPairFilter, unsigned long inNumObjectLayers); +//}; +// +//ObjectVsBroadPhaseLayerFilterTable implements ObjectVsBroadPhaseLayerFilter; +// +//interface ObjectLayerPairFilterTable { +// void ObjectLayerPairFilterTable(unsigned long inNumObjectLayers); +// unsigned long GetNumObjectLayers(); +// void DisableCollision(unsigned long inLayer1, unsigned long inLayer2); +// void EnableCollision(unsigned long inLayer1, unsigned long inLayer2); +//}; +// +//ObjectLayerPairFilterTable implements ObjectLayerPairFilter; +// +//interface BroadPhaseLayerInterfaceMask { +// void BroadPhaseLayerInterfaceMask(unsigned long inNumBroadPhaseLayers); +// void ConfigureLayer([Const, Ref] BroadPhaseLayer inBroadPhaseLayer, unsigned long inGroupsToInclude, unsigned long inGroupsToExclude); +//}; +// +//BroadPhaseLayerInterfaceMask implements BroadPhaseLayerInterface; +// +//interface ObjectVsBroadPhaseLayerFilterMask { +// void ObjectVsBroadPhaseLayerFilterMask([Const, Ref] BroadPhaseLayerInterfaceMask inBroadPhaseLayerInterface); +//}; +// +//ObjectVsBroadPhaseLayerFilterMask implements ObjectVsBroadPhaseLayerFilter; +// +//interface ObjectLayerPairFilterMask { +// void ObjectLayerPairFilterMask(); +// static unsigned long sGetObjectLayer(unsigned long inGroup, unsigned long inMask); +// static unsigned long sGetGroup(unsigned long inObjectLayer); +// static unsigned long sGetMask(unsigned long inObjectLayer); +//}; +// +//ObjectLayerPairFilterMask implements ObjectLayerPairFilter; +// +//interface JoltSettings { +// void JoltSettings(); +// +// attribute unsigned long mMaxBodies; +// attribute unsigned long mMaxBodyPairs; +// attribute unsigned long mMaxContactConstraints; +// attribute BroadPhaseLayerInterface mBroadPhaseLayerInterface; +// attribute ObjectVsBroadPhaseLayerFilter mObjectVsBroadPhaseLayerFilter; +// attribute ObjectLayerPairFilter mObjectLayerPairFilter; +//}; +// +//interface JoltInterface { +// void JoltInterface([Const, Ref] JoltSettings inSettings); +// void Step(float inDeltaTime, long inCollisionSteps); +// PhysicsSystem GetPhysicsSystem(); +// TempAllocator GetTempAllocator(); +// ObjectLayerPairFilter GetObjectLayerPairFilter(); +// ObjectVsBroadPhaseLayerFilter GetObjectVsBroadPhaseLayerFilter(); +// static unsigned long long sGetTotalMemory(); +// static unsigned long long sGetFreeMemory(); +//}; \ No newline at end of file diff --git a/jolt/jolt-build/src/main/java/Build.java b/jolt/jolt-build/src/main/java/Build.java new file mode 100644 index 0000000..fd1ee08 --- /dev/null +++ b/jolt/jolt-build/src/main/java/Build.java @@ -0,0 +1,158 @@ +import com.github.xpenatan.jparser.builder.BuildMultiTarget; +import com.github.xpenatan.jparser.builder.targets.AndroidTarget; +import com.github.xpenatan.jparser.builder.targets.EmscriptenTarget; +import com.github.xpenatan.jparser.builder.targets.LinuxTarget; +import com.github.xpenatan.jparser.builder.targets.MacTarget; +import com.github.xpenatan.jparser.builder.targets.WindowsTarget; +import com.github.xpenatan.jparser.builder.tool.BuildToolListener; +import com.github.xpenatan.jparser.builder.tool.BuildToolOptions; +import com.github.xpenatan.jparser.builder.tool.BuilderTool; +import com.github.xpenatan.jparser.idl.IDLReader; +import java.util.ArrayList; + +public class Build { + + public static void main(String[] args) { + String libName = "jolt"; + String modulePrefix = "jolt"; + String basePackage = "jolt"; + String sourceDir = "/build/jolt"; + BuildToolOptions op = new BuildToolOptions(modulePrefix, libName, basePackage, sourceDir, args); + BuilderTool.build(op, new BuildToolListener() { + @Override + public void onAddTarget(BuildToolOptions op, IDLReader idlReader, ArrayList targets) { + if(op.teavm) { + targets.add(getTeaVMTarget(op, idlReader)); + } + if(op.windows64) { + targets.add(getWindowTarget(op)); + } + if(op.linux64) { + targets.add(getLinuxTarget(op)); + } + if(op.mac64) { + targets.add(getMacTarget(op, false)); + } + if(op.macArm) { + targets.add(getMacTarget(op, true)); + } + if(op.android) { + targets.add(getAndroidTarget(op)); + } +// if(op.iOS) { +// targets.add(getIOSTarget(op)); +// } + } + }); + } + + private static BuildMultiTarget getWindowTarget(BuildToolOptions op) { + String libBuildCPPPath = op.getModuleBuildCPPPath(); + + BuildMultiTarget multiTarget = new BuildMultiTarget(); + + // Make a static library + WindowsTarget windowsTarget = new WindowsTarget(); + windowsTarget.isStatic = true; + windowsTarget.headerDirs.add("-I" + libBuildCPPPath + "/src/jolt/"); + windowsTarget.cppInclude.add(libBuildCPPPath + "/**/jolt/Jolt/**.cpp"); + multiTarget.add(windowsTarget); + + // Compile glue code and link + WindowsTarget glueTarget = new WindowsTarget(); + glueTarget.addJNIHeaders(); + glueTarget.headerDirs.add("-I" + libBuildCPPPath + "/src/jolt/"); + glueTarget.linkerFlags.add(libBuildCPPPath + "/libs/windows/jolt64.a"); + glueTarget.cppInclude.add(libBuildCPPPath + "/src/jniglue/JNIGlue.cpp"); + multiTarget.add(glueTarget); + + return multiTarget; + } + + private static BuildMultiTarget getLinuxTarget(BuildToolOptions op) { + String libBuildCPPPath = op.getModuleBuildCPPPath(); + + BuildMultiTarget multiTarget = new BuildMultiTarget(); + + // Make a static library + LinuxTarget linuxTarget = new LinuxTarget(); + linuxTarget.isStatic = true; + linuxTarget.headerDirs.add("-I" + libBuildCPPPath + "/src/jolt/"); + linuxTarget.cppInclude.add(libBuildCPPPath + "/**/jolt/Jolt/**.cpp"); + multiTarget.add(linuxTarget); + + // Compile glue code and link + LinuxTarget glueTarget = new LinuxTarget(); + glueTarget.addJNIHeaders(); + glueTarget.headerDirs.add("-I" + libBuildCPPPath + "/src/jolt/"); + glueTarget.linkerFlags.add(libBuildCPPPath + "/libs/linux/libjolt64.a"); + glueTarget.cppInclude.add(libBuildCPPPath + "/src/jniglue/JNIGlue.cpp"); + multiTarget.add(glueTarget); + + return multiTarget; + } + + private static BuildMultiTarget getMacTarget(BuildToolOptions op, boolean isArm) { + String libBuildCPPPath = op.getModuleBuildCPPPath(); + + BuildMultiTarget multiTarget = new BuildMultiTarget(); + + // Make a static library + MacTarget macTarget = new MacTarget(isArm); + macTarget.isStatic = true; + macTarget.headerDirs.add("-I" + libBuildCPPPath + "/src/jolt/"); + macTarget.cppInclude.add(libBuildCPPPath + "/**/jolt/Jolt/**.cpp"); + multiTarget.add(macTarget); + + // Compile glue code and link + MacTarget glueTarget = new MacTarget(isArm); + glueTarget.addJNIHeaders(); + glueTarget.headerDirs.add("-I" + libBuildCPPPath + "/src/jolt/"); + if(isArm) { + glueTarget.linkerFlags.add(libBuildCPPPath + "/libs/mac/arm/libjolt4.a"); + } + else { + glueTarget.linkerFlags.add(libBuildCPPPath + "/libs/mac/libjolt64.a"); + } + glueTarget.cppInclude.add(libBuildCPPPath + "/src/jniglue/JNIGlue.cpp"); + multiTarget.add(glueTarget); + + return multiTarget; + } + + private static BuildMultiTarget getTeaVMTarget(BuildToolOptions op, IDLReader idlReader) { + String libBuildCPPPath = op.getModuleBuildCPPPath(); + + BuildMultiTarget multiTarget = new BuildMultiTarget(); + + // Make a static library + EmscriptenTarget libTarget = new EmscriptenTarget(idlReader); + libTarget.isStatic = true; + libTarget.compileGlueCode = false; + libTarget.headerDirs.add("-I" + libBuildCPPPath + "/src/jolt"); + libTarget.cppInclude.add(libBuildCPPPath + "/**/jolt/Jolt/**.cpp"); + multiTarget.add(libTarget); + + // Compile glue code and link + EmscriptenTarget linkTarget = new EmscriptenTarget(idlReader); + linkTarget.headerDirs.add("-include" + libBuildCPPPath + "/src/jolt/JoltCustom.h"); + linkTarget.linkerFlags.add(libBuildCPPPath + "/libs/emscripten/jolt.a"); + multiTarget.add(linkTarget); + + return multiTarget; + } + + private static BuildMultiTarget getAndroidTarget(BuildToolOptions op) { + String libBuildCPPPath = op.getModuleBuildCPPPath(); + + BuildMultiTarget multiTarget = new BuildMultiTarget(); + + AndroidTarget androidTarget = new AndroidTarget(); + androidTarget.addJNIHeaders(); + androidTarget.headerDirs.add(libBuildCPPPath + "/src/jolt"); + androidTarget.cppInclude.add(libBuildCPPPath + "/**/jolt/Jolt/**.cpp"); + androidTarget.cppFlags.add("-Wno-error=format-security"); + multiTarget.add(androidTarget); + return multiTarget; + } +} \ No newline at end of file diff --git a/jolt/jolt-core/build.gradle.kts b/jolt/jolt-core/build.gradle.kts new file mode 100644 index 0000000..f0c9bb2 --- /dev/null +++ b/jolt/jolt-core/build.gradle.kts @@ -0,0 +1,34 @@ +val moduleName = "jolt-core" + +dependencies { + implementation("com.github.xpenatan.jParser:loader-core:${LibExt.jParserVersion}") + + testImplementation(project(":jolt:jolt-desktop")) + testImplementation("junit:junit:${LibExt.jUnitVersion}") +} + +tasks.named("clean") { + doFirst { + val srcPath = "$projectDir/src/main/java" + project.delete(files(srcPath)) + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + create("maven") { + artifactId = moduleName + from(components["java"]) + } + } +} \ No newline at end of file diff --git a/jolt/jolt-desktop/build.gradle.kts b/jolt/jolt-desktop/build.gradle.kts new file mode 100644 index 0000000..5123ca1 --- /dev/null +++ b/jolt/jolt-desktop/build.gradle.kts @@ -0,0 +1,33 @@ +val moduleName = "jolt-desktop" + +val libDir = "${rootProject.projectDir}/jolt" +val windowsFile = "$libDir/jolt-build/build/c++/libs/windows/jolt64.dll" +val linuxFile = "$libDir/jolt-build/build/c++/libs/linux/libjolt64.so" +val macArmFile = "$libDir/jolt-build/build/c++/libs/mac/arm/libjoltarm64.dylib" +val macFile = "$libDir/jolt-build/build/c++/libs/mac/libjolt64.dylib" + +tasks.jar { + from(windowsFile) + from(linuxFile) + from(macArmFile) + from(macFile) +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + create("maven") { + artifactId = moduleName + from(components["java"]) + } + } +} \ No newline at end of file diff --git a/jolt/jolt-teavm/build.gradle.kts b/jolt/jolt-teavm/build.gradle.kts new file mode 100644 index 0000000..05c503b --- /dev/null +++ b/jolt/jolt-teavm/build.gradle.kts @@ -0,0 +1,41 @@ +val moduleName = "jolt-teavm" + +val emscriptenFile = "$projectDir/../jolt-build/build/c++/libs/emscripten/jolt.wasm.js" + +tasks.jar { + from(emscriptenFile) +} + +dependencies { + implementation("com.badlogicgames.gdx:gdx:${LibExt.gdxVersion}") + implementation("com.github.xpenatan.jParser:loader-core:${LibExt.jParserVersion}") + implementation("com.github.xpenatan.jParser:loader-teavm:${LibExt.jParserVersion}") + implementation("org.teavm:teavm-jso:${LibExt.teaVMVersion}") +} + +tasks.named("clean") { + doFirst { + val srcPath = "$projectDir/src/main/java" + val jsPath = "$projectDir/src/main/resources/jolt.wasm.js" + project.delete(files(srcPath, jsPath)) + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + create("maven") { + artifactId = moduleName + from(components["java"]) + } + } +} \ No newline at end of file diff --git a/jolt/jolt-teavm/src/main/resources/META-INF/gdx-teavm.properties b/jolt/jolt-teavm/src/main/resources/META-INF/gdx-teavm.properties new file mode 100644 index 0000000..e69de29 diff --git a/jolt/jolt-teavm/src/main/resources/META-INF/teavm.properties b/jolt/jolt-teavm/src/main/resources/META-INF/teavm.properties new file mode 100644 index 0000000..4608a66 --- /dev/null +++ b/jolt/jolt-teavm/src/main/resources/META-INF/teavm.properties @@ -0,0 +1 @@ +mapPackageHierarchy|gen.jolt=jolt \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..3de212b --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,34 @@ +// Core +include(":jolt:jolt-build") +include(":jolt:jolt-base") +include(":jolt:jolt-core") +include(":jolt:jolt-desktop") +include(":jolt:jolt-teavm") +include(":jolt:jolt-android") + +// Examples +include(":examples:basic:base") +include(":examples:basic:core") +include(":examples:basic:desktop") +include(":examples:basic:teavm") +include(":examples:basic:android") + +//includeBuild("E:\\Dev\\Projects\\java\\gdx-teavm") { +// dependencySubstitution { +// substitute(module("com.github.xpenatan.gdx-teavm:backend-teavm")).using(project(":backends:backend-teavm")) +// } +//} +// +//includeBuild("E:\\Dev\\Projects\\java\\jParser") { +// dependencySubstitution { +// substitute(module("com.github.xpenatan.jParser:jParser-base")).using(project(":jParser:base")) +// substitute(module("com.github.xpenatan.jParser:jParser-build")).using(project(":jParser:builder")) +// substitute(module("com.github.xpenatan.jParser:jParser-build-tool")).using(project(":jParser:builder-tool")) +// substitute(module("com.github.xpenatan.jParser:jParser-core")).using(project(":jParser:core")) +// substitute(module("com.github.xpenatan.jParser:jParser-cpp")).using(project(":jParser:cpp")) +// substitute(module("com.github.xpenatan.jParser:jParser-idl")).using(project(":jParser:idl")) +// substitute(module("com.github.xpenatan.jParser:jParser-teavm")).using(project(":jParser:teavm")) +// substitute(module("com.github.xpenatan.jParser:loader-core")).using(project(":jParser:loader:loader-core")) +// substitute(module("com.github.xpenatan.jParser:loader-teavm")).using(project(":jParser:loader:loader-teavm")) +// } +//} \ No newline at end of file