gdcore-tools 2.0.0-beta6 → 2.0.0-beta8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Runtime/Cordova/config.xml +4 -0
- package/dist/Runtime/Cordova/package.json +12 -20
- package/dist/Runtime/CustomRuntimeObject.js +1 -1
- package/dist/Runtime/CustomRuntimeObject.js.map +2 -2
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js +1 -1
- package/dist/Runtime/CustomRuntimeObjectInstanceContainer.js.map +2 -2
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js +1 -1
- package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js.map +2 -2
- package/dist/Runtime/Extensions/3D/AmbientLight.js +1 -1
- package/dist/Runtime/Extensions/3D/AmbientLight.js.map +2 -2
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js +1 -1
- package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js.map +2 -2
- package/dist/Runtime/Extensions/3D/DirectionalLight.js +1 -1
- package/dist/Runtime/Extensions/3D/DirectionalLight.js.map +2 -2
- package/dist/Runtime/Extensions/3D/ExponentialFog.js +1 -1
- package/dist/Runtime/Extensions/3D/ExponentialFog.js.map +2 -2
- package/dist/Runtime/Extensions/3D/HemisphereLight.js +1 -1
- package/dist/Runtime/Extensions/3D/HemisphereLight.js.map +2 -2
- package/dist/Runtime/Extensions/3D/JsExtension.js +419 -228
- package/dist/Runtime/Extensions/3D/LinearFog.js +1 -1
- package/dist/Runtime/Extensions/3D/LinearFog.js.map +2 -2
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js +1 -1
- package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js.map +2 -2
- package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js +1 -1
- package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js.map +2 -2
- package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/BBText/JsExtension.js +45 -42
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/BitmapText/JsExtension.js +40 -49
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js +1 -1
- package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js.map +2 -2
- package/dist/Runtime/Extensions/ExampleJsExtension/JsExtension.js +18 -21
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js +1 -1
- package/dist/Runtime/Extensions/Firebase/B_firebasetools/C_firebasetools.js.map +2 -2
- package/dist/Runtime/Extensions/JsExtensionTypes.d.ts +8 -2
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js +1 -1
- package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js.map +2 -2
- package/dist/Runtime/Extensions/Lighting/JsExtension.js +50 -38
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/Multiplayer/JsExtension.js +15 -0
- package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js +1 -1
- package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/Multiplayer/multiplayertools.js.map +2 -2
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js +1 -1
- package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +2 -2
- package/dist/Runtime/Extensions/Physics2Behavior/JsExtension.js +76 -24
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js +1 -1
- package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +2 -2
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js +1 -1
- package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js.map +2 -2
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/Spine/JsExtension.js +45 -36
- package/dist/Runtime/Extensions/Spine/spineruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Spine/spineruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TextInput/JsExtension.js +52 -55
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TextObject/textruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/JsExtension.js +430 -261
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js +1 -1
- package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js +1 -1
- package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/TileMapHelper.js.map +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts.map +1 -1
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts +1 -0
- package/dist/Runtime/Extensions/TileMap/helper/dts/render/TileMapPixiHelper.d.ts.map +1 -1
- package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js.map +2 -2
- package/dist/Runtime/Extensions/Video/JsExtension.js +35 -44
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js +1 -1
- package/dist/Runtime/Extensions/Video/videoruntimeobject.js.map +2 -2
- package/dist/Runtime/ResourceLoader.js +1 -1
- package/dist/Runtime/ResourceLoader.js.map +2 -2
- package/dist/Runtime/RuntimeInstanceContainer.js.map +2 -2
- package/dist/Runtime/debugger-client/hot-reloader.js +2 -2
- package/dist/Runtime/debugger-client/hot-reloader.js.map +2 -2
- package/dist/Runtime/events-tools/inputtools.js +1 -1
- package/dist/Runtime/events-tools/inputtools.js.map +2 -2
- package/dist/Runtime/events-tools/objecttools.js +1 -1
- package/dist/Runtime/events-tools/objecttools.js.map +2 -2
- package/dist/Runtime/gd.js +1 -1
- package/dist/Runtime/gd.js.map +2 -2
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js +1 -1
- package/dist/Runtime/howler-sound-manager/howler-sound-manager.js.map +2 -2
- package/dist/Runtime/inputmanager.js +1 -1
- package/dist/Runtime/inputmanager.js.map +2 -2
- package/dist/Runtime/pixi-renderers/CustomRuntimeObject2DPixiRenderer.js +1 -1
- package/dist/Runtime/pixi-renderers/CustomRuntimeObject2DPixiRenderer.js.map +2 -2
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js +1 -1
- package/dist/Runtime/pixi-renderers/pixi-filters-tools.js.map +2 -2
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js +1 -1
- package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js.map +2 -2
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js +1 -1
- package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js.map +2 -2
- package/dist/Runtime/runtimegame.js +1 -1
- package/dist/Runtime/runtimegame.js.map +1 -1
- package/dist/Runtime/runtimeobject.js +1 -1
- package/dist/Runtime/runtimeobject.js.map +2 -2
- package/dist/Runtime/spriteruntimeobject.js +1 -1
- package/dist/Runtime/spriteruntimeobject.js.map +2 -2
- package/dist/Runtime/types/project-data.d.ts +5 -0
- package/dist/lib/libGD.cjs +1 -1
- package/dist/lib/libGD.d.cts +5 -0
- package/dist/lib/libGD.wasm +0 -0
- package/dist/loaders.cjs +3 -1
- package/dist/loaders.d.cts +2 -0
- package/gd.d.ts +74 -30
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../GDevelop/Extensions/3D/CustomRuntimeObject3D.ts"],
|
|
4
|
-
"sourcesContent": ["namespace gdjs {\n export interface Object3DDataContent {\n width: float;\n height: float;\n depth: float;\n }\n /** Base parameters for {@link gdjs.RuntimeObject3D} */\n export interface Object3DData extends ObjectData {\n /** The base parameters of the RuntimeObject3D */\n content: Object3DDataContent;\n }\n\n /**\n * Base class for 3D custom objects.\n */\n export class CustomRuntimeObject3D\n extends gdjs.CustomRuntimeObject\n implements gdjs.Base3DHandler {\n /**\n * Position on the Z axis.\n */\n private _z: float = 0;\n private _minZ: float = 0;\n private _maxZ: float = 0;\n private _scaleZ: float = 1;\n private _flippedZ: boolean = false;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationX: float = 0;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationY: float = 0;\n private _customCenterZ: float = 0;\n private static _temporaryVector = new THREE.Vector3();\n\n constructor(\n parent: gdjs.RuntimeInstanceContainer,\n objectData: Object3DData & CustomObjectConfiguration\n ) {\n super(parent, objectData);\n this._renderer.reinitialize(this, parent);\n }\n\n protected _createRender() {\n const parent = this._runtimeScene;\n return new gdjs.CustomRuntimeObject3DRenderer(\n this,\n this._instanceContainer,\n parent\n );\n }\n\n protected _reinitializeRenderer(): void {\n this.getRenderer().reinitialize(this, this.getParent());\n }\n\n getRenderer(): gdjs.CustomRuntimeObject3DRenderer {\n return super.getRenderer() as gdjs.CustomRuntimeObject3DRenderer;\n }\n\n get3DRendererObject() {\n // It can't be null because Three.js is always loaded\n // when a custom 3D object is used.\n return this.getRenderer().get3DRendererObject()!;\n }\n\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n super.extraInitializationFromInitialInstance(initialInstanceData);\n if (initialInstanceData.depth !== undefined)\n this.setDepth(initialInstanceData.depth);\n }\n\n /**\n * Set the object position on the Z axis.\n */\n setZ(z: float): void {\n if (z === this._z) return;\n this._z = z;\n this.getRenderer().updatePosition();\n }\n\n /**\n * Get the object position on the Z axis.\n */\n getZ(): float {\n return this._z;\n }\n\n /**\n * Get the Z position of the rendered object.\n *\n * For most objects, this will returns the same value as getZ(). But if the\n * object has an origin that is not the same as the point (0,0,0) of the\n * object displayed, getDrawableZ will differ.\n *\n * @return The Z position of the rendered object.\n */\n getDrawableZ(): float {\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._z + this._minZ;\n }\n\n /**\n * Return the Z position of the object center, **relative to the object Z\n * position** (`getDrawableX`).\n *\n * Use `getCenterZInScene` to get the position of the center in the scene.\n *\n * @return the Z position of the object center, relative to\n * `getDrawableZ()`.\n */\n getCenterZ(): float {\n return this.getDepth() / 2;\n }\n\n getCenterZInScene(): float {\n return this.getDrawableZ() + this.getCenterZ();\n }\n\n setCenterZInScene(z: float): void {\n this.setZ(z + this._z - (this.getDrawableZ() + this.getCenterZ()));\n }\n\n /**\n * Return the bottom Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMinZ(): number {\n return this.getDrawableZ();\n }\n\n /**\n * Return the top Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMaxZ(): number {\n return this.getDrawableZ() + this.getDepth();\n }\n\n /**\n * Set the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationX(angle: float): void {\n this._rotationX = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Set the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationY(angle: float): void {\n this._rotationY = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Get the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationX(): float {\n return this._rotationX;\n }\n\n /**\n * Get the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationY(): float {\n return this._rotationY;\n }\n\n /**\n * Turn the object around the scene x axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundX(deltaAngle: float): void {\n const axisX = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisX.set(1, 0, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisX, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene y axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundY(deltaAngle: float): void {\n const axisY = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisY.set(0, 1, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisY, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene z axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundZ(deltaAngle: float): void {\n const axisZ = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisZ.set(0, 0, 1);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisZ, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * @return the internal width of the object according to its children.\n */\n getUnscaledDepth(): float {\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._maxZ - this._minZ;\n }\n\n _updateUntransformedHitBoxes(): void {\n super._updateUntransformedHitBoxes();\n\n let minZ = Number.MAX_VALUE;\n let maxZ = -Number.MAX_VALUE;\n for (const childInstance of this._instanceContainer.getAdhocListOfAllInstances()) {\n if (!childInstance.isIncludedInParentCollisionMask()) {\n continue;\n }\n if (!gdjs.Base3DHandler.is3D(childInstance)) {\n continue;\n }\n minZ = Math.min(minZ, childInstance.getUnrotatedAABBMinZ());\n maxZ = Math.max(maxZ, childInstance.getUnrotatedAABBMaxZ());\n }\n if (minZ === Number.MAX_VALUE) {\n // The unscaled size can't be 0 because setWidth and setHeight wouldn't\n // have any effect.\n minZ = 0;\n maxZ = 1;\n }\n this._minZ = minZ;\n this._maxZ = maxZ;\n }\n\n /**\n * @returns the center Z from the local origin (0;0).\n */\n getUnscaledCenterZ(): float {\n if (this.hasCustomRotationCenter()) {\n return this._customCenterZ;\n }\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return (this._minZ + this._maxZ) / 2;\n }\n\n /**\n * The center of rotation is defined relatively to the origin (the object\n * position).\n * This avoids the center to move when children push the bounds.\n *\n * When no custom center is defined, it will move\n * to stay at the center of the children bounds.\n *\n * @param x coordinate of the custom center\n * @param y coordinate of the custom center\n */\n setRotationCenter3D(x: float, y: float, z: float) {\n this._customCenterZ = z;\n this.setRotationCenter(x, y);\n }\n\n /**\n * Get the object size on the Z axis (called \"depth\").\n */\n getDepth(): float {\n return this.getUnscaledDepth() * this.getScaleZ();\n }\n\n /**\n * Set the object size on the Z axis (called \"depth\").\n */\n setDepth(depth: float): void {\n const unscaledDepth = this.getUnscaledDepth();\n if (unscaledDepth === 0) {\n return;\n }\n const scaleZ = depth / unscaledDepth;\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n this._innerArea.min[2] *= scaleZ;\n this._innerArea.max[2] *= scaleZ;\n } else {\n this.setScaleZ(scaleZ);\n }\n }\n\n /**\n * Change the scale on X, Y and Z axis of the object.\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScale(newScale: number): void {\n super.setScale(newScale);\n this.setScaleZ(newScale);\n }\n\n /**\n * Change the scale on Z axis of the object (changing its height).\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScaleZ(newScale: number): void {\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n // The scale is always 1;\n return;\n }\n if (newScale < 0) {\n newScale = 0;\n }\n if (newScale === Math.abs(this._scaleZ)) {\n return;\n }\n this._scaleZ = newScale * (this._flippedZ ? -1 : 1);\n this.getRenderer().updateSize();\n }\n\n /**\n * Get the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n *\n * @return the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n */\n getScale(): number {\n const scaleX = this.getScaleX();\n const scaleY = this.getScaleY();\n const scaleZ = this.getScaleZ();\n return scaleX === scaleY && scaleX === scaleZ\n ? scaleX\n : Math.pow(scaleX * scaleY * scaleZ, 1 / 3);\n }\n\n /**\n * Get the scale of the object on Z axis.\n *\n * @return the scale of the object on Z axis\n */\n getScaleZ(): float {\n return Math.abs(this._scaleZ);\n }\n\n flipZ(enable: boolean) {\n if (enable === this._flippedZ) {\n return;\n }\n this._flippedZ = enable;\n this.getRenderer().updateSize();\n }\n\n isFlippedZ(): boolean {\n return this._flippedZ;\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CAeS,eACG,GAAK,mBACiB,CAwB9B,YACE,EACA,EACA,CACA,MAAM,EAAQ,GAxBR,QAAY,EACZ,WAAe,EACf,WAAe,EACf,aAAiB,EACjB,eAAqB,GAMrB,gBAAoB,EAMpB,gBAAoB,EACpB,oBAAwB,EAQ9B,KAAK,UAAU,aAAa,KAAM,GAG1B,eAAgB,CACxB,KAAM,GAAS,KAAK,cACpB,MAAO,IAAI,GAAK,8BACd,KACA,KAAK,mBACL,GAIM,uBAA8B,CACtC,KAAK,cAAc,aAAa,KAAM,KAAK,aAG7C,aAAkD,CAChD,MAAO,OAAM,cAGf,qBAAsB,CAGpB,MAAO,MAAK,cAAc,sBAG5B,uCAAuC,EAAmC,CACxE,MAAM,uCAAuC,GACzC,EAAoB,QAAU,QAChC,KAAK,SAAS,EAAoB,
|
|
4
|
+
"sourcesContent": ["namespace gdjs {\n export interface Object3DDataContent {\n width: float;\n height: float;\n depth: float;\n }\n /** Base parameters for {@link gdjs.RuntimeObject3D} */\n export interface Object3DData extends ObjectData {\n /** The base parameters of the RuntimeObject3D */\n content: Object3DDataContent;\n }\n\n /**\n * Base class for 3D custom objects.\n */\n export class CustomRuntimeObject3D\n extends gdjs.CustomRuntimeObject\n implements gdjs.Base3DHandler {\n /**\n * Position on the Z axis.\n */\n private _z: float = 0;\n private _minZ: float = 0;\n private _maxZ: float = 0;\n private _scaleZ: float = 1;\n private _flippedZ: boolean = false;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationX: float = 0;\n /**\n * Euler angle with the `ZYX` order.\n *\n * Note that `_rotationZ` is `angle` from `gdjs.RuntimeObject`.\n */\n private _rotationY: float = 0;\n private _customCenterZ: float = 0;\n private static _temporaryVector = new THREE.Vector3();\n\n constructor(\n parent: gdjs.RuntimeInstanceContainer,\n objectData: Object3DData & CustomObjectConfiguration\n ) {\n super(parent, objectData);\n this._renderer.reinitialize(this, parent);\n }\n\n protected _createRender() {\n const parent = this._runtimeScene;\n return new gdjs.CustomRuntimeObject3DRenderer(\n this,\n this._instanceContainer,\n parent\n );\n }\n\n protected _reinitializeRenderer(): void {\n this.getRenderer().reinitialize(this, this.getParent());\n }\n\n getRenderer(): gdjs.CustomRuntimeObject3DRenderer {\n return super.getRenderer() as gdjs.CustomRuntimeObject3DRenderer;\n }\n\n get3DRendererObject() {\n // It can't be null because Three.js is always loaded\n // when a custom 3D object is used.\n return this.getRenderer().get3DRendererObject()!;\n }\n\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n super.extraInitializationFromInitialInstance(initialInstanceData);\n if (initialInstanceData.depth !== undefined) {\n this.setDepth(initialInstanceData.depth);\n }\n if (initialInstanceData.flippedX) {\n this.flipX(initialInstanceData.flippedX);\n }\n if (initialInstanceData.flippedY) {\n this.flipY(initialInstanceData.flippedY);\n }\n if (initialInstanceData.flippedZ) {\n this.flipZ(initialInstanceData.flippedZ);\n }\n }\n\n /**\n * Set the object position on the Z axis.\n */\n setZ(z: float): void {\n if (z === this._z) return;\n this._z = z;\n this.getRenderer().updatePosition();\n }\n\n /**\n * Get the object position on the Z axis.\n */\n getZ(): float {\n return this._z;\n }\n\n /**\n * Get the Z position of the rendered object.\n *\n * For most objects, this will returns the same value as getZ(). But if the\n * object has an origin that is not the same as the point (0,0,0) of the\n * object displayed, getDrawableZ will differ.\n *\n * @return The Z position of the rendered object.\n */\n getDrawableZ(): float {\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._z + this._minZ;\n }\n\n /**\n * Return the Z position of the object center, **relative to the object Z\n * position** (`getDrawableX`).\n *\n * Use `getCenterZInScene` to get the position of the center in the scene.\n *\n * @return the Z position of the object center, relative to\n * `getDrawableZ()`.\n */\n getCenterZ(): float {\n return this.getDepth() / 2;\n }\n\n getCenterZInScene(): float {\n return this.getDrawableZ() + this.getCenterZ();\n }\n\n setCenterZInScene(z: float): void {\n this.setZ(z + this._z - (this.getDrawableZ() + this.getCenterZ()));\n }\n\n /**\n * Return the bottom Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMinZ(): number {\n return this.getDrawableZ();\n }\n\n /**\n * Return the top Z of the object.\n * Rotations around X and Y are not taken into account.\n */\n getUnrotatedAABBMaxZ(): number {\n return this.getDrawableZ() + this.getDepth();\n }\n\n /**\n * Set the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationX(angle: float): void {\n this._rotationX = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Set the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n setRotationY(angle: float): void {\n this._rotationY = angle;\n this.getRenderer().updateRotation();\n }\n\n /**\n * Get the object rotation on the X axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationX(): float {\n return this._rotationX;\n }\n\n /**\n * Get the object rotation on the Y axis.\n *\n * This is an Euler angle. Objects use the `ZYX` order.\n */\n getRotationY(): float {\n return this._rotationY;\n }\n\n /**\n * Turn the object around the scene x axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundX(deltaAngle: float): void {\n const axisX = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisX.set(1, 0, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisX, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene y axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundY(deltaAngle: float): void {\n const axisY = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisY.set(0, 1, 0);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisY, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * Turn the object around the scene z axis at its center.\n * @param deltaAngle the rotation angle\n */\n turnAroundZ(deltaAngle: float): void {\n const axisZ = gdjs.CustomRuntimeObject3D._temporaryVector;\n axisZ.set(0, 0, 1);\n\n const mesh = this.get3DRendererObject();\n mesh.rotateOnWorldAxis(axisZ, gdjs.toRad(deltaAngle));\n this._rotationX = gdjs.toDegrees(mesh.rotation.x);\n this._rotationY = gdjs.toDegrees(mesh.rotation.y);\n this.setAngle(gdjs.toDegrees(mesh.rotation.z));\n }\n\n /**\n * @return the internal width of the object according to its children.\n */\n getUnscaledDepth(): float {\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return this._maxZ - this._minZ;\n }\n\n _updateUntransformedHitBoxes(): void {\n super._updateUntransformedHitBoxes();\n\n let minZ = Number.MAX_VALUE;\n let maxZ = -Number.MAX_VALUE;\n for (const childInstance of this._instanceContainer.getAdhocListOfAllInstances()) {\n if (!childInstance.isIncludedInParentCollisionMask()) {\n continue;\n }\n if (!gdjs.Base3DHandler.is3D(childInstance)) {\n continue;\n }\n minZ = Math.min(minZ, childInstance.getUnrotatedAABBMinZ());\n maxZ = Math.max(maxZ, childInstance.getUnrotatedAABBMaxZ());\n }\n if (minZ === Number.MAX_VALUE) {\n // The unscaled size can't be 0 because setWidth and setHeight wouldn't\n // have any effect.\n minZ = 0;\n maxZ = 1;\n }\n this._minZ = minZ;\n this._maxZ = maxZ;\n }\n\n /**\n * @returns the center Z from the local origin (0;0).\n */\n getUnscaledCenterZ(): float {\n if (this.hasCustomRotationCenter()) {\n return this._customCenterZ;\n }\n if (this._isUntransformedHitBoxesDirty) {\n this._updateUntransformedHitBoxes();\n }\n return (this._minZ + this._maxZ) / 2;\n }\n\n /**\n * The center of rotation is defined relatively to the origin (the object\n * position).\n * This avoids the center to move when children push the bounds.\n *\n * When no custom center is defined, it will move\n * to stay at the center of the children bounds.\n *\n * @param x coordinate of the custom center\n * @param y coordinate of the custom center\n */\n setRotationCenter3D(x: float, y: float, z: float) {\n this._customCenterZ = z;\n this.setRotationCenter(x, y);\n }\n\n /**\n * Get the object size on the Z axis (called \"depth\").\n */\n getDepth(): float {\n return this.getUnscaledDepth() * this.getScaleZ();\n }\n\n /**\n * Set the object size on the Z axis (called \"depth\").\n */\n setDepth(depth: float): void {\n const unscaledDepth = this.getUnscaledDepth();\n if (unscaledDepth === 0) {\n return;\n }\n const scaleZ = depth / unscaledDepth;\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n this._innerArea.min[2] *= scaleZ;\n this._innerArea.max[2] *= scaleZ;\n } else {\n this.setScaleZ(scaleZ);\n }\n }\n\n /**\n * Change the scale on X, Y and Z axis of the object.\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScale(newScale: number): void {\n super.setScale(newScale);\n this.setScaleZ(newScale);\n }\n\n /**\n * Change the scale on Z axis of the object (changing its height).\n *\n * @param newScale The new scale (must be greater than 0).\n */\n setScaleZ(newScale: number): void {\n if (this._innerArea && this._isInnerAreaFollowingParentSize) {\n // The scale is always 1;\n return;\n }\n if (newScale < 0) {\n newScale = 0;\n }\n if (newScale === Math.abs(this._scaleZ)) {\n return;\n }\n this._scaleZ = newScale * (this._flippedZ ? -1 : 1);\n this.getRenderer().updateSize();\n }\n\n /**\n * Get the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n *\n * @return the scale of the object (or the geometric average of X, Y and Z scale in case they are different).\n */\n getScale(): number {\n const scaleX = this.getScaleX();\n const scaleY = this.getScaleY();\n const scaleZ = this.getScaleZ();\n return scaleX === scaleY && scaleX === scaleZ\n ? scaleX\n : Math.pow(scaleX * scaleY * scaleZ, 1 / 3);\n }\n\n /**\n * Get the scale of the object on Z axis.\n *\n * @return the scale of the object on Z axis\n */\n getScaleZ(): float {\n return Math.abs(this._scaleZ);\n }\n\n flipZ(enable: boolean) {\n if (enable === this._flippedZ) {\n return;\n }\n this._flippedZ = enable;\n this.getRenderer().updateSize();\n }\n\n isFlippedZ(): boolean {\n return this._flippedZ;\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CAeS,eACG,GAAK,mBACiB,CAwB9B,YACE,EACA,EACA,CACA,MAAM,EAAQ,GAxBR,QAAY,EACZ,WAAe,EACf,WAAe,EACf,aA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oBAAoB,EAAU,EAAU,EAAU,CAChD,KAAK,eAAiB,EACtB,KAAK,kBAAkB,EAAG,GAM5B,UAAkB,CAChB,MAAO,MAAK,mBAAqB,KAAK,YAMxC,SAAS,EAAoB,CAC3B,KAAM,GAAgB,KAAK,mBAC3B,GAAI,IAAkB,EACpB,OAEF,KAAM,GAAS,EAAQ,EACvB,AAAI,KAAK,YAAc,KAAK,gCAC1B,MAAK,WAAW,IAAI,IAAM,EAC1B,KAAK,WAAW,IAAI,IAAM,GAE1B,KAAK,UAAU,GASnB,SAAS,EAAwB,CAC/B,MAAM,SAAS,GACf,KAAK,UAAU,GAQjB,UAAU,EAAwB,CAChC,AAAI,KAAK,YAAc,KAAK,iCAIxB,GAAW,GACb,GAAW,GAET,IAAa,KAAK,IAAI,KAAK,UAG/B,MAAK,QAAU,EAAY,MAAK,UAAY,GAAK,GACjD,KAAK,cAAc,eAQrB,UAAmB,CACjB,KAAM,GAAS,KAAK,YACd,EAAS,KAAK,YACd,EAAS,KAAK,YACpB,MAAO,KAAW,GAAU,IAAW,EACnC,EACA,KAAK,IAAI,EAAS,EAAS,EAAQ,EAAI,GAQ7C,WAAmB,CACjB,MAAO,MAAK,IAAI,KAAK,SAGvB,MAAM,EAAiB,CACrB,AAAI,IAAW,KAAK,WAGpB,MAAK,UAAY,EACjB,KAAK,cAAc,cAGrB,YAAsB,CACpB,MAAO,MAAK,WA/VC,AAxBV,EAwBU,iBAAmB,GAAI,OAAM,QAxBvC,EAAM,0BAfL",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var gdjs;(function(i){i.PixiFiltersTools.registerFilterCreator("Scene3D::DirectionalLight",new class{makeFilter(o,r){return typeof THREE=="undefined"?new i.PixiFiltersTools.EmptyFilter:new class{constructor(){this._isEnabled=!1;this.top="Y-";this.elevation=45;this.rotation=0;this.light=new THREE.DirectionalLight,this.light.position.set(1,0,0),this.rotationObject=new THREE.Group,this.rotationObject.add(this.light),this.updateRotation()}isEnabled(t){return this._isEnabled}setEnabled(t,e){return this._isEnabled===e?!0:e?this.applyEffect(t):this.removeEffect(t)}applyEffect(t){const e=t.get3DRendererObject();return e?(e.add(this.rotationObject),this._isEnabled=!0,!0):!1}removeEffect(t){const e=t.get3DRendererObject();return e?(e.remove(this.rotationObject),this._isEnabled=!1,!0):!1}updatePreRender(t){}updateDoubleParameter(t,e){t==="intensity"?this.light.intensity=e:t==="elevation"?(this.elevation=e,this.updateRotation()):t==="rotation"&&(this.rotation=e,this.updateRotation())}getDoubleParameter(t){return t==="intensity"?this.light.intensity:t==="elevation"?this.elevation:t==="rotation"?this.rotation:0}updateStringParameter(t,e){t==="color"&&(this.light.color=new THREE.Color(i.
|
|
1
|
+
var gdjs;(function(i){i.PixiFiltersTools.registerFilterCreator("Scene3D::DirectionalLight",new class{makeFilter(o,r){return typeof THREE=="undefined"?new i.PixiFiltersTools.EmptyFilter:new class{constructor(){this._isEnabled=!1;this.top="Y-";this.elevation=45;this.rotation=0;this.light=new THREE.DirectionalLight,this.light.position.set(1,0,0),this.rotationObject=new THREE.Group,this.rotationObject.add(this.light),this.updateRotation()}isEnabled(t){return this._isEnabled}setEnabled(t,e){return this._isEnabled===e?!0:e?this.applyEffect(t):this.removeEffect(t)}applyEffect(t){const e=t.get3DRendererObject();return e?(e.add(this.rotationObject),this._isEnabled=!0,!0):!1}removeEffect(t){const e=t.get3DRendererObject();return e?(e.remove(this.rotationObject),this._isEnabled=!1,!0):!1}updatePreRender(t){}updateDoubleParameter(t,e){t==="intensity"?this.light.intensity=e:t==="elevation"?(this.elevation=e,this.updateRotation()):t==="rotation"&&(this.rotation=e,this.updateRotation())}getDoubleParameter(t){return t==="intensity"?this.light.intensity:t==="elevation"?this.elevation:t==="rotation"?this.rotation:0}updateStringParameter(t,e){t==="color"&&(this.light.color=new THREE.Color(i.rgbOrHexStringToNumber(e))),t==="top"&&(this.top=e,this.updateRotation())}updateColorParameter(t,e){t==="color"&&this.light.color.setHex(e)}getColorParameter(t){return t==="color"?this.light.color.getHex():0}updateBooleanParameter(t,e){}updateRotation(){this.top==="Z+"?(this.rotationObject.rotation.z=i.toRad(this.rotation),this.rotationObject.rotation.y=-i.toRad(this.elevation)):(this.rotationObject.rotation.y=i.toRad(this.rotation-90),this.rotationObject.rotation.z=-i.toRad(this.elevation))}getNetworkSyncData(){return{i:this.light.intensity,c:this.light.color.getHex(),e:this.elevation,r:this.rotation,t:this.top}}updateFromNetworkSyncData(t){this.light.intensity=t.i,this.light.color.setHex(t.c),this.elevation=t.e,this.rotation=t.r,this.top=t.t,this.updateRotation()}}}})})(gdjs||(gdjs={}));
|
|
2
2
|
//# sourceMappingURL=DirectionalLight.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../GDevelop/Extensions/3D/DirectionalLight.ts"],
|
|
4
|
-
"sourcesContent": ["namespace gdjs {\n interface DirectionalLightFilterNetworkSyncData {\n i: number;\n c: number;\n e: number;\n r: number;\n t: string;\n }\n gdjs.PixiFiltersTools.registerFilterCreator(\n 'Scene3D::DirectionalLight',\n new (class implements gdjs.PixiFiltersTools.FilterCreator {\n makeFilter(\n target: EffectsTarget,\n effectData: EffectData\n ): gdjs.PixiFiltersTools.Filter {\n if (typeof THREE === 'undefined') {\n return new gdjs.PixiFiltersTools.EmptyFilter();\n }\n return new (class implements gdjs.PixiFiltersTools.Filter {\n light: THREE.DirectionalLight;\n rotationObject: THREE.Group;\n _isEnabled: boolean = false;\n top: string = 'Y-';\n elevation: float = 45;\n rotation: float = 0;\n\n constructor() {\n this.light = new THREE.DirectionalLight();\n this.light.position.set(1, 0, 0);\n this.rotationObject = new THREE.Group();\n this.rotationObject.add(this.light);\n this.updateRotation();\n }\n\n isEnabled(target: EffectsTarget): boolean {\n return this._isEnabled;\n }\n setEnabled(target: EffectsTarget, enabled: boolean): boolean {\n if (this._isEnabled === enabled) {\n return true;\n }\n if (enabled) {\n return this.applyEffect(target);\n } else {\n return this.removeEffect(target);\n }\n }\n applyEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.add(this.rotationObject);\n this._isEnabled = true;\n return true;\n }\n removeEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.remove(this.rotationObject);\n this._isEnabled = false;\n return true;\n }\n updatePreRender(target: gdjs.EffectsTarget): any {}\n updateDoubleParameter(parameterName: string, value: number): void {\n if (parameterName === 'intensity') {\n this.light.intensity = value;\n } else if (parameterName === 'elevation') {\n this.elevation = value;\n this.updateRotation();\n } else if (parameterName === 'rotation') {\n this.rotation = value;\n this.updateRotation();\n }\n }\n getDoubleParameter(parameterName: string): number {\n if (parameterName === 'intensity') {\n return this.light.intensity;\n } else if (parameterName === 'elevation') {\n return this.elevation;\n } else if (parameterName === 'rotation') {\n return this.rotation;\n }\n return 0;\n }\n updateStringParameter(parameterName: string, value: string): void {\n if (parameterName === 'color') {\n this.light.color = new THREE.Color(\n gdjs.
|
|
5
|
-
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CAQE,EAAK,iBAAiB,sBACpB,4BACA,GAAK,MAAqD,CACxD,WACE,EACA,EAC8B,CAC9B,MAAI,OAAO,QAAU,YACZ,GAAI,GAAK,iBAAiB,YAE5B,GAAK,MAA8C,CAQxD,aAAc,CALd,gBAAsB,GACtB,SAAc,KACd,eAAmB,GACnB,cAAkB,EAGhB,KAAK,MAAQ,GAAI,OAAM,iBACvB,KAAK,MAAM,SAAS,IAAI,EAAG,EAAG,GAC9B,KAAK,eAAiB,GAAI,OAAM,MAChC,KAAK,eAAe,IAAI,KAAK,OAC7B,KAAK,iBAGP,UAAU,EAAgC,CACxC,MAAO,MAAK,WAEd,WAAW,EAAuB,EAA2B,CAC3D,MAAI,MAAK,aAAe,EACf,GAEL,EACK,KAAK,YAAY,GAEjB,KAAK,aAAa,GAG7B,YAAY,EAAgC,CAC1C,KAAM,GAAQ,EAAO,sBAIrB,MAAK,GAGL,GAAM,IAAI,KAAK,gBACf,KAAK,WAAa,GACX,IAJE,GAMX,aAAa,EAAgC,CAC3C,KAAM,GAAQ,EAAO,sBAIrB,MAAK,GAGL,GAAM,OAAO,KAAK,gBAClB,KAAK,WAAa,GACX,IAJE,GAMX,gBAAgB,EAAiC,EACjD,sBAAsB,EAAuB,EAAqB,CAChE,AAAI,IAAkB,YACpB,KAAK,MAAM,UAAY,EAClB,AAAI,IAAkB,YAC3B,MAAK,UAAY,EACjB,KAAK,kBACI,IAAkB,YAC3B,MAAK,SAAW,EAChB,KAAK,kBAGT,mBAAmB,EAA+B,CAChD,MAAI,KAAkB,YACb,KAAK,MAAM,UACT,IAAkB,YACpB,KAAK,UACH,IAAkB,WACpB,KAAK,SAEP,EAET,sBAAsB,EAAuB,EAAqB,CAChE,AAAI,IAAkB,SACpB,MAAK,MAAM,MAAQ,GAAI,OAAM,MAC3B,EAAK,
|
|
4
|
+
"sourcesContent": ["namespace gdjs {\n interface DirectionalLightFilterNetworkSyncData {\n i: number;\n c: number;\n e: number;\n r: number;\n t: string;\n }\n gdjs.PixiFiltersTools.registerFilterCreator(\n 'Scene3D::DirectionalLight',\n new (class implements gdjs.PixiFiltersTools.FilterCreator {\n makeFilter(\n target: EffectsTarget,\n effectData: EffectData\n ): gdjs.PixiFiltersTools.Filter {\n if (typeof THREE === 'undefined') {\n return new gdjs.PixiFiltersTools.EmptyFilter();\n }\n return new (class implements gdjs.PixiFiltersTools.Filter {\n light: THREE.DirectionalLight;\n rotationObject: THREE.Group;\n _isEnabled: boolean = false;\n top: string = 'Y-';\n elevation: float = 45;\n rotation: float = 0;\n\n constructor() {\n this.light = new THREE.DirectionalLight();\n this.light.position.set(1, 0, 0);\n this.rotationObject = new THREE.Group();\n this.rotationObject.add(this.light);\n this.updateRotation();\n }\n\n isEnabled(target: EffectsTarget): boolean {\n return this._isEnabled;\n }\n setEnabled(target: EffectsTarget, enabled: boolean): boolean {\n if (this._isEnabled === enabled) {\n return true;\n }\n if (enabled) {\n return this.applyEffect(target);\n } else {\n return this.removeEffect(target);\n }\n }\n applyEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.add(this.rotationObject);\n this._isEnabled = true;\n return true;\n }\n removeEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.remove(this.rotationObject);\n this._isEnabled = false;\n return true;\n }\n updatePreRender(target: gdjs.EffectsTarget): any {}\n updateDoubleParameter(parameterName: string, value: number): void {\n if (parameterName === 'intensity') {\n this.light.intensity = value;\n } else if (parameterName === 'elevation') {\n this.elevation = value;\n this.updateRotation();\n } else if (parameterName === 'rotation') {\n this.rotation = value;\n this.updateRotation();\n }\n }\n getDoubleParameter(parameterName: string): number {\n if (parameterName === 'intensity') {\n return this.light.intensity;\n } else if (parameterName === 'elevation') {\n return this.elevation;\n } else if (parameterName === 'rotation') {\n return this.rotation;\n }\n return 0;\n }\n updateStringParameter(parameterName: string, value: string): void {\n if (parameterName === 'color') {\n this.light.color = new THREE.Color(\n gdjs.rgbOrHexStringToNumber(value)\n );\n }\n if (parameterName === 'top') {\n this.top = value;\n this.updateRotation();\n }\n }\n updateColorParameter(parameterName: string, value: number): void {\n if (parameterName === 'color') {\n this.light.color.setHex(value);\n }\n }\n getColorParameter(parameterName: string): number {\n if (parameterName === 'color') {\n return this.light.color.getHex();\n }\n return 0;\n }\n updateBooleanParameter(parameterName: string, value: boolean): void {}\n updateRotation() {\n if (this.top === 'Z+') {\n // 0\u00B0 is a light from the right of the screen.\n this.rotationObject.rotation.z = gdjs.toRad(this.rotation);\n this.rotationObject.rotation.y = -gdjs.toRad(this.elevation);\n } else {\n // 0\u00B0 becomes a light from Z+.\n this.rotationObject.rotation.y = gdjs.toRad(this.rotation - 90);\n this.rotationObject.rotation.z = -gdjs.toRad(this.elevation);\n }\n }\n getNetworkSyncData(): DirectionalLightFilterNetworkSyncData {\n return {\n i: this.light.intensity,\n c: this.light.color.getHex(),\n e: this.elevation,\n r: this.rotation,\n t: this.top,\n };\n }\n updateFromNetworkSyncData(syncData: any): void {\n this.light.intensity = syncData.i;\n this.light.color.setHex(syncData.c);\n this.elevation = syncData.e;\n this.rotation = syncData.r;\n this.top = syncData.t;\n this.updateRotation();\n }\n })();\n }\n })()\n );\n}\n"],
|
|
5
|
+
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CAQE,EAAK,iBAAiB,sBACpB,4BACA,GAAK,MAAqD,CACxD,WACE,EACA,EAC8B,CAC9B,MAAI,OAAO,QAAU,YACZ,GAAI,GAAK,iBAAiB,YAE5B,GAAK,MAA8C,CAQxD,aAAc,CALd,gBAAsB,GACtB,SAAc,KACd,eAAmB,GACnB,cAAkB,EAGhB,KAAK,MAAQ,GAAI,OAAM,iBACvB,KAAK,MAAM,SAAS,IAAI,EAAG,EAAG,GAC9B,KAAK,eAAiB,GAAI,OAAM,MAChC,KAAK,eAAe,IAAI,KAAK,OAC7B,KAAK,iBAGP,UAAU,EAAgC,CACxC,MAAO,MAAK,WAEd,WAAW,EAAuB,EAA2B,CAC3D,MAAI,MAAK,aAAe,EACf,GAEL,EACK,KAAK,YAAY,GAEjB,KAAK,aAAa,GAG7B,YAAY,EAAgC,CAC1C,KAAM,GAAQ,EAAO,sBAIrB,MAAK,GAGL,GAAM,IAAI,KAAK,gBACf,KAAK,WAAa,GACX,IAJE,GAMX,aAAa,EAAgC,CAC3C,KAAM,GAAQ,EAAO,sBAIrB,MAAK,GAGL,GAAM,OAAO,KAAK,gBAClB,KAAK,WAAa,GACX,IAJE,GAMX,gBAAgB,EAAiC,EACjD,sBAAsB,EAAuB,EAAqB,CAChE,AAAI,IAAkB,YACpB,KAAK,MAAM,UAAY,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og",new class{makeFilter(o,n){return typeof THREE=="undefined"?new r.PixiFiltersTools.EmptyFilter:new class{constructor(){this.fog=new THREE.FogExp2(16777215)}isEnabled(e){const t=e.get3DRendererObject();return t?t.fog===this.fog:!1}setEnabled(e,t){return t?this.applyEffect(e):this.removeEffect(e)}applyEffect(e){const t=e.get3DRendererObject();return!t||t.fog===void 0?!1:(t.fog=this.fog,!0)}removeEffect(e){const t=e.get3DRendererObject();return!t||t.fog===void 0?!1:(t.fog=null,!0)}updatePreRender(e){}updateDoubleParameter(e,t){e==="density"&&(this.fog.density=t)}getDoubleParameter(e){return e==="density"?this.fog.density:0}updateStringParameter(e,t){e==="color"&&(this.fog.color=new THREE.Color(r.
|
|
1
|
+
var gdjs;(function(r){r.PixiFiltersTools.registerFilterCreator("Scene3D::ExponentialFog",new class{makeFilter(o,n){return typeof THREE=="undefined"?new r.PixiFiltersTools.EmptyFilter:new class{constructor(){this.fog=new THREE.FogExp2(16777215)}isEnabled(e){const t=e.get3DRendererObject();return t?t.fog===this.fog:!1}setEnabled(e,t){return t?this.applyEffect(e):this.removeEffect(e)}applyEffect(e){const t=e.get3DRendererObject();return!t||t.fog===void 0?!1:(t.fog=this.fog,!0)}removeEffect(e){const t=e.get3DRendererObject();return!t||t.fog===void 0?!1:(t.fog=null,!0)}updatePreRender(e){}updateDoubleParameter(e,t){e==="density"&&(this.fog.density=t)}getDoubleParameter(e){return e==="density"?this.fog.density:0}updateStringParameter(e,t){e==="color"&&(this.fog.color=new THREE.Color(r.rgbOrHexStringToNumber(t)))}updateColorParameter(e,t){e==="color"&&this.fog.color.setHex(t)}getColorParameter(e){return e==="color"?this.fog.color.getHex():0}updateBooleanParameter(e,t){}getNetworkSyncData(){return{d:this.fog.density,c:this.fog.color.getHex()}}updateFromNetworkSyncData(e){this.fog.density=e.d,this.fog.color.setHex(e.c)}}}})})(gdjs||(gdjs={}));
|
|
2
2
|
//# sourceMappingURL=ExponentialFog.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../GDevelop/Extensions/3D/ExponentialFog.ts"],
|
|
4
|
-
"sourcesContent": ["namespace gdjs {\n interface ExponentialFogFilterNetworkSyncData {\n d: number;\n c: number;\n }\n gdjs.PixiFiltersTools.registerFilterCreator(\n 'Scene3D::ExponentialFog',\n new (class implements gdjs.PixiFiltersTools.FilterCreator {\n makeFilter(\n target: EffectsTarget,\n effectData: EffectData\n ): gdjs.PixiFiltersTools.Filter {\n if (typeof THREE === 'undefined') {\n return new gdjs.PixiFiltersTools.EmptyFilter();\n }\n return new (class implements gdjs.PixiFiltersTools.Filter {\n fog: THREE.FogExp2;\n\n constructor() {\n this.fog = new THREE.FogExp2(0xffffff);\n }\n\n isEnabled(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n return scene ? scene.fog === this.fog : false;\n }\n setEnabled(target: EffectsTarget, enabled: boolean): boolean {\n if (enabled) {\n return this.applyEffect(target);\n } else {\n return this.removeEffect(target);\n }\n }\n applyEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene || scene.fog === undefined) {\n return false;\n }\n scene.fog = this.fog;\n return true;\n }\n removeEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene || scene.fog === undefined) {\n return false;\n }\n scene.fog = null;\n return true;\n }\n updatePreRender(target: gdjs.EffectsTarget): any {}\n updateDoubleParameter(parameterName: string, value: number): void {\n if (parameterName === 'density') {\n this.fog.density = value;\n }\n }\n getDoubleParameter(parameterName: string): number {\n if (parameterName === 'density') {\n return this.fog.density;\n }\n return 0;\n }\n updateStringParameter(parameterName: string, value: string): void {\n if (parameterName === 'color') {\n this.fog.color = new THREE.Color(\n gdjs.
|
|
5
|
-
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CAKE,EAAK,iBAAiB,sBACpB,0BACA,GAAK,MAAqD,CACxD,WACE,EACA,EAC8B,CAC9B,MAAI,OAAO,QAAU,YACZ,GAAI,GAAK,iBAAiB,YAE5B,GAAK,MAA8C,CAGxD,aAAc,CACZ,KAAK,IAAM,GAAI,OAAM,QAAQ,UAG/B,UAAU,EAAgC,CACxC,KAAM,GAAQ,EAAO,sBAIrB,MAAO,GAAQ,EAAM,MAAQ,KAAK,IAAM,GAE1C,WAAW,EAAuB,EAA2B,CAC3D,MAAI,GACK,KAAK,YAAY,GAEjB,KAAK,aAAa,GAG7B,YAAY,EAAgC,CAC1C,KAAM,GAAQ,EAAO,sBAIrB,MAAI,CAAC,GAAS,EAAM,MAAQ,OACnB,GAET,GAAM,IAAM,KAAK,IACV,IAET,aAAa,EAAgC,CAC3C,KAAM,GAAQ,EAAO,sBAIrB,MAAI,CAAC,GAAS,EAAM,MAAQ,OACnB,GAET,GAAM,IAAM,KACL,IAET,gBAAgB,EAAiC,EACjD,sBAAsB,EAAuB,EAAqB,CAChE,AAAI,IAAkB,WACpB,MAAK,IAAI,QAAU,GAGvB,mBAAmB,EAA+B,CAChD,MAAI,KAAkB,UACb,KAAK,IAAI,QAEX,EAET,sBAAsB,EAAuB,EAAqB,CAChE,AAAI,IAAkB,SACpB,MAAK,IAAI,MAAQ,GAAI,OAAM,MACzB,EAAK,
|
|
4
|
+
"sourcesContent": ["namespace gdjs {\n interface ExponentialFogFilterNetworkSyncData {\n d: number;\n c: number;\n }\n gdjs.PixiFiltersTools.registerFilterCreator(\n 'Scene3D::ExponentialFog',\n new (class implements gdjs.PixiFiltersTools.FilterCreator {\n makeFilter(\n target: EffectsTarget,\n effectData: EffectData\n ): gdjs.PixiFiltersTools.Filter {\n if (typeof THREE === 'undefined') {\n return new gdjs.PixiFiltersTools.EmptyFilter();\n }\n return new (class implements gdjs.PixiFiltersTools.Filter {\n fog: THREE.FogExp2;\n\n constructor() {\n this.fog = new THREE.FogExp2(0xffffff);\n }\n\n isEnabled(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n return scene ? scene.fog === this.fog : false;\n }\n setEnabled(target: EffectsTarget, enabled: boolean): boolean {\n if (enabled) {\n return this.applyEffect(target);\n } else {\n return this.removeEffect(target);\n }\n }\n applyEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene || scene.fog === undefined) {\n return false;\n }\n scene.fog = this.fog;\n return true;\n }\n removeEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene || scene.fog === undefined) {\n return false;\n }\n scene.fog = null;\n return true;\n }\n updatePreRender(target: gdjs.EffectsTarget): any {}\n updateDoubleParameter(parameterName: string, value: number): void {\n if (parameterName === 'density') {\n this.fog.density = value;\n }\n }\n getDoubleParameter(parameterName: string): number {\n if (parameterName === 'density') {\n return this.fog.density;\n }\n return 0;\n }\n updateStringParameter(parameterName: string, value: string): void {\n if (parameterName === 'color') {\n this.fog.color = new THREE.Color(\n gdjs.rgbOrHexStringToNumber(value)\n );\n }\n }\n updateColorParameter(parameterName: string, value: number): void {\n if (parameterName === 'color') {\n this.fog.color.setHex(value);\n }\n }\n getColorParameter(parameterName: string): number {\n if (parameterName === 'color') {\n return this.fog.color.getHex();\n }\n return 0;\n }\n updateBooleanParameter(parameterName: string, value: boolean): void {}\n getNetworkSyncData(): ExponentialFogFilterNetworkSyncData {\n return {\n d: this.fog.density,\n c: this.fog.color.getHex(),\n };\n }\n updateFromNetworkSyncData(\n syncData: ExponentialFogFilterNetworkSyncData\n ): void {\n this.fog.density = syncData.d;\n this.fog.color.setHex(syncData.c);\n }\n })();\n }\n })()\n );\n}\n"],
|
|
5
|
+
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CAKE,EAAK,iBAAiB,sBACpB,0BACA,GAAK,MAAqD,CACxD,WACE,EACA,EAC8B,CAC9B,MAAI,OAAO,Q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scene3D::HemisphereLight",new class{makeFilter(o,r){return typeof THREE=="undefined"?new i.PixiFiltersTools.EmptyFilter:new class{constructor(){this._isEnabled=!1;this.top="Y-";this.elevation=45;this.rotation=0;this.light=new THREE.HemisphereLight,this.light.position.set(1,0,0),this.rotationObject=new THREE.Group,this.rotationObject.add(this.light),this.updateRotation()}isEnabled(t){return this._isEnabled}setEnabled(t,e){return this._isEnabled===e?!0:e?this.applyEffect(t):this.removeEffect(t)}applyEffect(t){const e=t.get3DRendererObject();return e?(e.add(this.rotationObject),this._isEnabled=!0,!0):!1}removeEffect(t){const e=t.get3DRendererObject();return e?(e.remove(this.rotationObject),this._isEnabled=!1,!0):!1}updatePreRender(t){}updateDoubleParameter(t,e){t==="intensity"?this.light.intensity=e:t==="elevation"?(this.elevation=e,this.updateRotation()):t==="rotation"&&(this.rotation=e,this.updateRotation())}getDoubleParameter(t){return t==="intensity"?this.light.intensity:t==="elevation"?this.elevation:t==="rotation"?this.rotation:0}updateStringParameter(t,e){t==="skyColor"&&(this.light.color=new THREE.Color(i.
|
|
1
|
+
var gdjs;(function(i){i.PixiFiltersTools.registerFilterCreator("Scene3D::HemisphereLight",new class{makeFilter(o,r){return typeof THREE=="undefined"?new i.PixiFiltersTools.EmptyFilter:new class{constructor(){this._isEnabled=!1;this.top="Y-";this.elevation=45;this.rotation=0;this.light=new THREE.HemisphereLight,this.light.position.set(1,0,0),this.rotationObject=new THREE.Group,this.rotationObject.add(this.light),this.updateRotation()}isEnabled(t){return this._isEnabled}setEnabled(t,e){return this._isEnabled===e?!0:e?this.applyEffect(t):this.removeEffect(t)}applyEffect(t){const e=t.get3DRendererObject();return e?(e.add(this.rotationObject),this._isEnabled=!0,!0):!1}removeEffect(t){const e=t.get3DRendererObject();return e?(e.remove(this.rotationObject),this._isEnabled=!1,!0):!1}updatePreRender(t){}updateDoubleParameter(t,e){t==="intensity"?this.light.intensity=e:t==="elevation"?(this.elevation=e,this.updateRotation()):t==="rotation"&&(this.rotation=e,this.updateRotation())}getDoubleParameter(t){return t==="intensity"?this.light.intensity:t==="elevation"?this.elevation:t==="rotation"?this.rotation:0}updateStringParameter(t,e){t==="skyColor"&&(this.light.color=new THREE.Color(i.rgbOrHexStringToNumber(e))),t==="groundColor"&&(this.light.groundColor=new THREE.Color(i.rgbOrHexStringToNumber(e))),t==="top"&&(this.top=e,this.updateRotation())}updateColorParameter(t,e){t==="skyColor"&&this.light.color.setHex(e),t==="groundColor"&&this.light.groundColor.setHex(e)}getColorParameter(t){return t==="skyColor"?this.light.color.getHex():t==="groundColor"?this.light.groundColor.getHex():0}updateBooleanParameter(t,e){}updateRotation(){this.top==="Z+"?(this.rotationObject.rotation.z=i.toRad(this.rotation),this.rotationObject.rotation.y=-i.toRad(this.elevation)):(this.rotationObject.rotation.y=i.toRad(this.rotation-90),this.rotationObject.rotation.z=-i.toRad(this.elevation))}getNetworkSyncData(){return{i:this.light.intensity,sc:this.light.color.getHex(),gc:this.light.groundColor.getHex(),e:this.elevation,r:this.rotation,t:this.top}}updateFromNetworkSyncData(t){this.light.intensity=t.i,this.light.color.setHex(t.sc),this.light.groundColor.setHex(t.gc),this.elevation=t.e,this.rotation=t.r,this.top=t.t,this.updateRotation()}}}})})(gdjs||(gdjs={}));
|
|
2
2
|
//# sourceMappingURL=HemisphereLight.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../GDevelop/Extensions/3D/HemisphereLight.ts"],
|
|
4
|
-
"sourcesContent": ["namespace gdjs {\n interface HemisphereLightFilterNetworkSyncData {\n i: number;\n sc: number;\n gc: number;\n e: number;\n r: number;\n t: string;\n }\n gdjs.PixiFiltersTools.registerFilterCreator(\n 'Scene3D::HemisphereLight',\n new (class implements gdjs.PixiFiltersTools.FilterCreator {\n makeFilter(\n target: EffectsTarget,\n effectData: EffectData\n ): gdjs.PixiFiltersTools.Filter {\n if (typeof THREE === 'undefined') {\n return new gdjs.PixiFiltersTools.EmptyFilter();\n }\n return new (class implements gdjs.PixiFiltersTools.Filter {\n light: THREE.HemisphereLight;\n rotationObject: THREE.Group;\n _isEnabled: boolean = false;\n top: string = 'Y-';\n elevation: float = 45;\n rotation: float = 0;\n\n constructor() {\n this.light = new THREE.HemisphereLight();\n this.light.position.set(1, 0, 0);\n this.rotationObject = new THREE.Group();\n this.rotationObject.add(this.light);\n this.updateRotation();\n }\n\n isEnabled(target: EffectsTarget): boolean {\n return this._isEnabled;\n }\n setEnabled(target: EffectsTarget, enabled: boolean): boolean {\n if (this._isEnabled === enabled) {\n return true;\n }\n if (enabled) {\n return this.applyEffect(target);\n } else {\n return this.removeEffect(target);\n }\n }\n applyEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.add(this.rotationObject);\n this._isEnabled = true;\n return true;\n }\n removeEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.remove(this.rotationObject);\n this._isEnabled = false;\n return true;\n }\n updatePreRender(target: gdjs.EffectsTarget): any {}\n updateDoubleParameter(parameterName: string, value: number): void {\n if (parameterName === 'intensity') {\n this.light.intensity = value;\n } else if (parameterName === 'elevation') {\n this.elevation = value;\n this.updateRotation();\n } else if (parameterName === 'rotation') {\n this.rotation = value;\n this.updateRotation();\n }\n }\n getDoubleParameter(parameterName: string): number {\n if (parameterName === 'intensity') {\n return this.light.intensity;\n } else if (parameterName === 'elevation') {\n return this.elevation;\n } else if (parameterName === 'rotation') {\n return this.rotation;\n }\n return 0;\n }\n updateStringParameter(parameterName: string, value: string): void {\n if (parameterName === 'skyColor') {\n this.light.color = new THREE.Color(\n gdjs.
|
|
5
|
-
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CASE,EAAK,iBAAiB,sBACpB,2BACA,GAAK,MAAqD,CACxD,WACE,EACA,EAC8B,CAC9B,MAAI,OAAO,QAAU,YACZ,GAAI,GAAK,iBAAiB,YAE5B,GAAK,MAA8C,CAQxD,aAAc,CALd,gBAAsB,GACtB,SAAc,KACd,eAAmB,GACnB,cAAkB,EAGhB,KAAK,MAAQ,GAAI,OAAM,gBACvB,KAAK,MAAM,SAAS,IAAI,EAAG,EAAG,GAC9B,KAAK,eAAiB,GAAI,OAAM,MAChC,KAAK,eAAe,IAAI,KAAK,OAC7B,KAAK,iBAGP,UAAU,EAAgC,CACxC,MAAO,MAAK,WAEd,WAAW,EAAuB,EAA2B,CAC3D,MAAI,MAAK,aAAe,EACf,GAEL,EACK,KAAK,YAAY,GAEjB,KAAK,aAAa,GAG7B,YAAY,EAAgC,CAC1C,KAAM,GAAQ,EAAO,sBAIrB,MAAK,GAGL,GAAM,IAAI,KAAK,gBACf,KAAK,WAAa,GACX,IAJE,GAMX,aAAa,EAAgC,CAC3C,KAAM,GAAQ,EAAO,sBAIrB,MAAK,GAGL,GAAM,OAAO,KAAK,gBAClB,KAAK,WAAa,GACX,IAJE,GAMX,gBAAgB,EAAiC,EACjD,sBAAsB,EAAuB,EAAqB,CAChE,AAAI,IAAkB,YACpB,KAAK,MAAM,UAAY,EAClB,AAAI,IAAkB,YAC3B,MAAK,UAAY,EACjB,KAAK,kBACI,IAAkB,YAC3B,MAAK,SAAW,EAChB,KAAK,kBAGT,mBAAmB,EAA+B,CAChD,MAAI,KAAkB,YACb,KAAK,MAAM,UACT,IAAkB,YACpB,KAAK,UACH,IAAkB,WACpB,KAAK,SAEP,EAET,sBAAsB,EAAuB,EAAqB,CAChE,AAAI,IAAkB,YACpB,MAAK,MAAM,MAAQ,GAAI,OAAM,MAC3B,EAAK,
|
|
4
|
+
"sourcesContent": ["namespace gdjs {\n interface HemisphereLightFilterNetworkSyncData {\n i: number;\n sc: number;\n gc: number;\n e: number;\n r: number;\n t: string;\n }\n gdjs.PixiFiltersTools.registerFilterCreator(\n 'Scene3D::HemisphereLight',\n new (class implements gdjs.PixiFiltersTools.FilterCreator {\n makeFilter(\n target: EffectsTarget,\n effectData: EffectData\n ): gdjs.PixiFiltersTools.Filter {\n if (typeof THREE === 'undefined') {\n return new gdjs.PixiFiltersTools.EmptyFilter();\n }\n return new (class implements gdjs.PixiFiltersTools.Filter {\n light: THREE.HemisphereLight;\n rotationObject: THREE.Group;\n _isEnabled: boolean = false;\n top: string = 'Y-';\n elevation: float = 45;\n rotation: float = 0;\n\n constructor() {\n this.light = new THREE.HemisphereLight();\n this.light.position.set(1, 0, 0);\n this.rotationObject = new THREE.Group();\n this.rotationObject.add(this.light);\n this.updateRotation();\n }\n\n isEnabled(target: EffectsTarget): boolean {\n return this._isEnabled;\n }\n setEnabled(target: EffectsTarget, enabled: boolean): boolean {\n if (this._isEnabled === enabled) {\n return true;\n }\n if (enabled) {\n return this.applyEffect(target);\n } else {\n return this.removeEffect(target);\n }\n }\n applyEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.add(this.rotationObject);\n this._isEnabled = true;\n return true;\n }\n removeEffect(target: EffectsTarget): boolean {\n const scene = target.get3DRendererObject() as\n | THREE.Scene\n | null\n | undefined;\n if (!scene) {\n return false;\n }\n scene.remove(this.rotationObject);\n this._isEnabled = false;\n return true;\n }\n updatePreRender(target: gdjs.EffectsTarget): any {}\n updateDoubleParameter(parameterName: string, value: number): void {\n if (parameterName === 'intensity') {\n this.light.intensity = value;\n } else if (parameterName === 'elevation') {\n this.elevation = value;\n this.updateRotation();\n } else if (parameterName === 'rotation') {\n this.rotation = value;\n this.updateRotation();\n }\n }\n getDoubleParameter(parameterName: string): number {\n if (parameterName === 'intensity') {\n return this.light.intensity;\n } else if (parameterName === 'elevation') {\n return this.elevation;\n } else if (parameterName === 'rotation') {\n return this.rotation;\n }\n return 0;\n }\n updateStringParameter(parameterName: string, value: string): void {\n if (parameterName === 'skyColor') {\n this.light.color = new THREE.Color(\n gdjs.rgbOrHexStringToNumber(value)\n );\n }\n if (parameterName === 'groundColor') {\n this.light.groundColor = new THREE.Color(\n gdjs.rgbOrHexStringToNumber(value)\n );\n }\n if (parameterName === 'top') {\n this.top = value;\n this.updateRotation();\n }\n }\n updateColorParameter(parameterName: string, value: number): void {\n if (parameterName === 'skyColor') {\n this.light.color.setHex(value);\n }\n if (parameterName === 'groundColor') {\n this.light.groundColor.setHex(value);\n }\n }\n getColorParameter(parameterName: string): number {\n if (parameterName === 'skyColor') {\n return this.light.color.getHex();\n }\n if (parameterName === 'groundColor') {\n return this.light.groundColor.getHex();\n }\n return 0;\n }\n updateBooleanParameter(parameterName: string, value: boolean): void {}\n updateRotation() {\n if (this.top === 'Z+') {\n // 0\u00B0 is a light from the right of the screen.\n this.rotationObject.rotation.z = gdjs.toRad(this.rotation);\n this.rotationObject.rotation.y = -gdjs.toRad(this.elevation);\n } else {\n // 0\u00B0 becomes a light from Z+.\n this.rotationObject.rotation.y = gdjs.toRad(this.rotation - 90);\n this.rotationObject.rotation.z = -gdjs.toRad(this.elevation);\n }\n }\n getNetworkSyncData(): HemisphereLightFilterNetworkSyncData {\n return {\n i: this.light.intensity,\n sc: this.light.color.getHex(),\n gc: this.light.groundColor.getHex(),\n e: this.elevation,\n r: this.rotation,\n t: this.top,\n };\n }\n updateFromNetworkSyncData(\n syncData: HemisphereLightFilterNetworkSyncData\n ): void {\n this.light.intensity = syncData.i;\n this.light.color.setHex(syncData.sc);\n this.light.groundColor.setHex(syncData.gc);\n this.elevation = syncData.e;\n this.rotation = syncData.r;\n this.top = syncData.t;\n this.updateRotation();\n }\n })();\n }\n })()\n );\n}\n"],
|
|
5
|
+
"mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CASE,EAAK,iBAAiB,sBACpB,2BACA,GAAK,MAAqD,CACxD,WACE,EACA,EAC8B,CAC9B,MAAI,OAAO,QAAU,YACZ,GAAI,GAAK,iBAAiB,YAE5B,GAAK,MAA8C,CAQxD,aAAc,CALd,gBAAsB,GACtB,SA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