Skip to content

Commit

Permalink
Merge pull request #617 from baaahs/bump-three
Browse files Browse the repository at this point in the history
Bump Three from v1.120 to v1.168
  • Loading branch information
xian authored Sep 12, 2024
2 parents 567c339 + 090b851 commit 85da426
Show file tree
Hide file tree
Showing 437 changed files with 24,720 additions and 4,586 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ kotlin {
implementation(kotlinw("mui-icons-material"))
implementation(kotlinw("emotion"))

// ThreeJS:
implementation(project(":ext:three"))
implementation(npm("camera-controls", "^1.35.0"))

// TODO: Revert when https://github.com/john-doherty/long-press-event 2.5 is released.
Expand All @@ -184,7 +186,6 @@ kotlin {
implementation(npm("clsx", "^2.0.0"))
implementation(npm("react-draggable", "^4.4.4"))
implementation(npm("react-dropzone", "^14.2.1"))
implementation(npm("three", "^0.120.0"))
implementation(npm("react-mosaic-component", "^6.1.0"))
implementation(npm("react-error-boundary", "^2.2.2"))
implementation(npm("ace-builds", "1.28.0"))
Expand Down Expand Up @@ -265,7 +266,6 @@ tasks.named<ProcessResources>("jsProcessResources") {
dependsOn("kotlinNpmInstall") // for node_modules stuff

from("build/js/node_modules/requirejs") { include("require.js") }
from("build/js/node_modules/three/build") { include("three.js") }
from("build/js/node_modules/long-press-event/dist") { include("long-press-event.min.js") }
from("build/js/node_modules/react-grid-layout") {
into("react-grid-layout")
Expand Down
30 changes: 30 additions & 0 deletions ext/three/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
kotlin("multiplatform") version Versions.kotlin
}

group = "org.baaahs"
version = "0.0.1"

fun kotlinw(target: String): String =
"org.jetbrains.kotlin-wrappers:kotlin-$target:${Versions.kotlinWrappers}"

repositories {
mavenCentral()
}

kotlin {
js(IR) {
browser()
}

sourceSets {
val jsMain by getting {
dependencies {
implementation(kotlinw("browser-js"))

implementation(npm("three", "^0.168.0"))
implementation(npm("@types/three", "^0.168.0"))
}
}
}
}
16 changes: 16 additions & 0 deletions ext/three/src/jsMain/kotlin/three/AmbientLight.module_three.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@file:JsModule("three")
@file:JsNonModule
package three

open external class AmbientLight : Light<Nothing?> {
constructor(color: Color = definedExternally, intensity: Number = definedExternally)
constructor()
constructor(color: Color = definedExternally)
constructor(color: String = definedExternally, intensity: Number = definedExternally)
constructor(color: String = definedExternally)
constructor(color: Number = definedExternally, intensity: Number = definedExternally)
constructor(color: Number = definedExternally)
open val isAmbientLight: Boolean
override var override: Any
override val type: String /* String | "AmbientLight" */
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
@file:JsModule("three")
@file:JsNonModule
@file:Suppress("PackageDirectoryMismatch")
package three.js
package three

open external class AnimationAction(mixer: AnimationMixer, clip: AnimationClip, localRoot: Object3D = definedExternally, blendMode: AnimationBlendMode = definedExternally) {
open var blendMode: AnimationBlendMode
open var loop: AnimationActionLoopStyles
import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.dom.parsing.*
import org.w3c.dom.svg.*
import org.w3c.dom.url.*
import org.w3c.fetch.*
import org.w3c.files.*
import org.w3c.notifications.*
import org.w3c.performance.*
import org.w3c.workers.*
import org.w3c.xhr.*

open external class AnimationAction(mixer: AnimationMixer, clip: AnimationClip, localRoot: Object3D/*<Object3DEventMap>*/ = definedExternally, blendMode: Any = definedExternally) {
open var blendMode: Any
open var loop: Any
open var time: Number
open var timeScale: Number
open var weight: Number
Expand All @@ -21,7 +34,7 @@ open external class AnimationAction(mixer: AnimationMixer, clip: AnimationClip,
open fun isRunning(): Boolean
open fun isScheduled(): Boolean
open fun startAt(time: Number): AnimationAction
open fun setLoop(mode: AnimationActionLoopStyles, repetitions: Number): AnimationAction
open fun setLoop(mode: Any, repetitions: Number): AnimationAction
open fun setEffectiveWeight(weight: Number): AnimationAction
open fun getEffectiveWeight(): Number
open fun fadeIn(duration: Number): AnimationAction
Expand All @@ -38,5 +51,5 @@ open external class AnimationAction(mixer: AnimationMixer, clip: AnimationClip,
open fun stopWarping(): AnimationAction
open fun getMixer(): AnimationMixer
open fun getClip(): AnimationClip
open fun getRoot(): Object3D
open fun getRoot(): Object3D/*<Object3DEventMap>*/
}
54 changes: 54 additions & 0 deletions ext/three/src/jsMain/kotlin/three/AnimationClip.module_three.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@file:JsModule("three")
@file:JsNonModule
package three

import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.dom.parsing.*
import org.w3c.dom.svg.*
import org.w3c.dom.url.*
import org.w3c.fetch.*
import org.w3c.files.*
import org.w3c.notifications.*
import org.w3c.performance.*
import org.w3c.workers.*
import org.w3c.xhr.*

external interface AnimationClipJSON {
var name: String
var duration: Number
var tracks: Array<KeyframeTrackJSON>
var uuid: String
var blendMode: Any
}

external interface MorphTarget {
var name: String
var vertices: Array<Vector3>
}

open external class AnimationClip(name: String = definedExternally, duration: Number = definedExternally, tracks: Array<KeyframeTrack> = definedExternally, blendMode: Any = definedExternally) {
open var name: String
open var tracks: Array<KeyframeTrack>
open var blendMode: Any
open var duration: Number
open var uuid: String
open var results: Array<Any>
open fun resetDuration(): AnimationClip
open fun trim(): AnimationClip
open fun validate(): Boolean
open fun optimize(): AnimationClip
open fun clone(): AnimationClip /* this */
open fun toJSON(clip: AnimationClip): Any

companion object {
fun CreateFromMorphTargetSequence(name: String, morphTargetSequence: Array<MorphTarget>, fps: Number, noLoop: Boolean): AnimationClip
fun findByName(clipArray: Array<AnimationClip>, name: String): AnimationClip
fun CreateClipsFromMorphTargetSequences(morphTargets: Array<MorphTarget>, fps: Number, noLoop: Boolean): Array<AnimationClip>
fun parse(json: AnimationClipJSON): AnimationClip
fun parseAnimation(animation: AnimationClipJSON, bones: Array<Bone__0>): AnimationClip
fun toJSON(clip: AnimationClip): AnimationClipJSON
}
}
21 changes: 21 additions & 0 deletions ext/three/src/jsMain/kotlin/three/AnimationLoader.module_three.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@file:JsModule("three")
@file:JsNonModule
package three

import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.dom.parsing.*
import org.w3c.dom.svg.*
import org.w3c.dom.url.*
import org.w3c.fetch.*
import org.w3c.files.*
import org.w3c.notifications.*
import org.w3c.performance.*
import org.w3c.workers.*
import org.w3c.xhr.*

open external class AnimationLoader(manager: LoadingManager = definedExternally) : Loader__1<Array<AnimationClip>> {
open fun parse(json: Array<Any>): Array<AnimationClip>
}
57 changes: 57 additions & 0 deletions ext/three/src/jsMain/kotlin/three/AnimationMixer.module_three.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@file:JsModule("three")
@file:JsNonModule
package three

import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.dom.parsing.*
import org.w3c.dom.svg.*
import org.w3c.dom.url.*
import org.w3c.fetch.*
import org.w3c.files.*
import org.w3c.notifications.*
import org.w3c.performance.*
import org.w3c.workers.*
import org.w3c.xhr.*

external interface `T$66` {
var action: AnimationAction
var loopDelta: Number
}

external interface `T$67` {
var action: AnimationAction
var direction: Number
}

external interface AnimationMixerEventMap {
var loop: `T$66`
var finished: `T$67`
}

open external class AnimationMixer : EventDispatcher/*<AnimationMixerEventMap>*/ {
constructor(root: Object3D/*<Object3DEventMap>*/)
constructor(root: AnimationObjectGroup)
open var time: Number
open var timeScale: Number
open fun clipAction(clip: AnimationClip, root: Object3D/*<Object3DEventMap>*/ = definedExternally, blendMode: Any = definedExternally): AnimationAction
open fun clipAction(clip: AnimationClip): AnimationAction
open fun clipAction(clip: AnimationClip, root: Object3D/*<Object3DEventMap>*/ = definedExternally): AnimationAction
open fun clipAction(clip: AnimationClip, root: AnimationObjectGroup = definedExternally, blendMode: Any = definedExternally): AnimationAction
open fun clipAction(clip: AnimationClip, root: AnimationObjectGroup = definedExternally): AnimationAction
open fun existingAction(clip: AnimationClip, root: Object3D/*<Object3DEventMap>*/ = definedExternally): AnimationAction?
open fun existingAction(clip: AnimationClip): AnimationAction?
open fun existingAction(clip: AnimationClip, root: AnimationObjectGroup = definedExternally): AnimationAction?
open fun stopAllAction(): AnimationMixer
open fun update(deltaTime: Number): AnimationMixer
open fun setTime(timeInSeconds: Number): AnimationMixer
open fun getRoot(): dynamic /* Object3D/*<Object3DEventMap>*/ | AnimationObjectGroup */
open fun uncacheClip(clip: AnimationClip)
open fun uncacheRoot(root: Object3D/*<Object3DEventMap>*/)
open fun uncacheRoot(root: AnimationObjectGroup)
open fun uncacheAction(clip: AnimationClip, root: Object3D/*<Object3DEventMap>*/ = definedExternally)
open fun uncacheAction(clip: AnimationClip)
open fun uncacheAction(clip: AnimationClip, root: AnimationObjectGroup = definedExternally)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@file:JsModule("three")
@file:JsNonModule
package three

import kotlin.js.*
import org.khronos.webgl.*
import org.w3c.dom.*
import org.w3c.dom.events.*
import org.w3c.dom.parsing.*
import org.w3c.dom.svg.*
import org.w3c.dom.url.*
import org.w3c.fetch.*
import org.w3c.files.*
import org.w3c.notifications.*
import org.w3c.performance.*
import org.w3c.workers.*
import org.w3c.xhr.*

external interface `T$68` {
var total: Number
var inUse: Number
}

external interface `T$69` {
var bindingsPerObject: Number
var objects: `T$68`
}

open external class AnimationObjectGroup(vararg args: Any) {
open var uuid: String
open var stats: `T$69`
open val isAnimationObjectGroup: Boolean
open fun add(vararg args: Any)
open fun remove(vararg args: Any)
open fun uncache(vararg args: Any)
}
9 changes: 9 additions & 0 deletions ext/three/src/jsMain/kotlin/three/ArcCurve.module_three.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@file:JsModule("three")
@file:JsNonModule
package three

open external class ArcCurve(aX: Number = definedExternally, aY: Number = definedExternally, aRadius: Number = definedExternally, aStartAngle: Number = definedExternally, aEndAngle: Number = definedExternally, aClockwise: Boolean = definedExternally) : EllipseCurve {
open val isArcCurve: Any = definedExternally /* true */
override var override: Any
override val type: String /* String | "ArcCurve" */
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
@file:JsModule("three")
@file:JsNonModule
@file:Suppress("PackageDirectoryMismatch")
package three.js
package three

open external class ArrayCamera(cameras: Array<PerspectiveCamera> = definedExternally) : PerspectiveCamera {
open val isArrayCamera: Boolean
open var cameras: Array<PerspectiveCamera>
open var isArrayCamera: Boolean
}
30 changes: 30 additions & 0 deletions ext/three/src/jsMain/kotlin/three/ArrowHelper.module_three.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@file:JsModule("three")
@file:JsNonModule
package three

open external class ArrowHelper : Object3D/*<Object3DEventMap>*/ {
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: Color = definedExternally, headLength: Number = definedExternally, headWidth: Number = definedExternally)
constructor()
constructor(dir: Vector3 = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: Color = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: Color = definedExternally, headLength: Number = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: String = definedExternally, headLength: Number = definedExternally, headWidth: Number = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: String = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: String = definedExternally, headLength: Number = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: Number = definedExternally, headLength: Number = definedExternally, headWidth: Number = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: Number = definedExternally)
constructor(dir: Vector3 = definedExternally, origin: Vector3 = definedExternally, length: Number = definedExternally, color: Number = definedExternally, headLength: Number = definedExternally)
open var override: Any
override val type: String /* String | "ArrowHelper" */
open var line: Line<out BufferGeometry<NormalOrGLBufferAttributes>, out Material>
open var cone: Mesh<BufferGeometry<NormalBufferAttributes>, *>
open fun setColor(color: Color)
open fun setColor(color: String)
open fun setColor(color: Number)
open fun setDirection(dir: Vector3)
open fun setLength(length: Number, headLength: Number = definedExternally, headWidth: Number = definedExternally)
open fun copy(source: ArrowHelper /* this */): ArrowHelper /* this */
open fun dispose()
}
Loading

0 comments on commit 85da426

Please sign in to comment.