Nikolai Sviridov
08/02/2021, 10:11 AMNikolai Sviridov
08/02/2021, 10:11 AM@file:JsModule("three")
@file:JsNonModule
package wrappers
...
@JsName("MeshLambertMaterial")
external class MeshLambertMaterial(parameters: LambertParameters)
external interface LambertParameters {
@JsName("color")
var color: Long
@JsName("opacity")
var opacity: Float
@JsName("emissive")
var emissive: Long
}
// another file
data class LambertParametersImpl(
override var color: Long,
override var opacity: Float,
override var emissive: Long
) : LambertParameters
Also tried using only data class with JsName.Nikolai Sviridov
08/02/2021, 10:14 AM> THREE.MeshLambertMaterial: '_color_2' is not a property of this material.
> THREE.MeshLambertMaterial: '_opacity' is not a property of this material
... etc
Those warnings coming from github source line, when it iterates over keys.andylamax
08/02/2021, 2:18 PMfun LambertParameters(
color: Long,
opacity: Float,
emissive: Long
) = jsObject<LambertParameters> {
this.color = color
this.opacity = opacity
this.emmisive = emmisive
}
Nikolai Sviridov
08/02/2021, 5:17 PM