@enable3d/phaser-extension
Advanced tools
Comparing version 0.22.0-dev.0 to 0.22.0-dev.1
@@ -1,17 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* To create the UMD bundle | ||
*/ | ||
__exportStar(require("./index"), exports); | ||
export * from './index'; | ||
//# sourceMappingURL=bundle.js.map |
@@ -1,12 +0,9 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.enable3d = void 0; | ||
const wasmLoader_1 = require("@enable3d/common/dist/wasmLoader"); | ||
import loadAmmoModule from '@enable3d/common/dist/wasmLoader'; | ||
window.__loadPhysics = false; | ||
window.__ammoPath = ''; | ||
/** Discover a whole new dimension wrapping your Phaser game with enable3d */ | ||
const enable3d = (ready) => { | ||
export const enable3d = (ready) => { | ||
window.setTimeout(() => { | ||
if (window.__loadPhysics) { | ||
wasmLoader_1.default(window.__ammoPath, () => { | ||
loadAmmoModule(window.__ammoPath, () => { | ||
Ammo().then(() => { | ||
@@ -28,4 +25,3 @@ ready(); | ||
}; | ||
exports.enable3d = enable3d; | ||
exports.default = exports.enable3d; | ||
export default enable3d; | ||
//# sourceMappingURL=enable3d.js.map |
@@ -9,11 +9,9 @@ /** | ||
export { PhysicsLoader } from '@enable3d/common/dist/physicsLoader'; | ||
import Canvas from '@enable3d/common/dist/customCanvas'; | ||
export { Canvas }; | ||
export { Canvas } from '@enable3d/common/dist/customCanvas'; | ||
export { ExtendedMesh } from '@enable3d/common/dist/extendedMesh'; | ||
export { ExtendedObject3D } from '@enable3d/common/dist/extendedObject3D'; | ||
export { ExtendedGroup } from '@enable3d/common/dist/extendedGroup'; | ||
import * as THREE from '@enable3d/three-wrapper/dist/index'; | ||
export { THREE }; | ||
import * as Types from '@enable3d/common/dist/types'; | ||
export { Types }; | ||
export * as FLAT from '@enable3d/three-graphics/jsm/flat'; | ||
export * as THREE from 'three'; | ||
export * as Types from '@enable3d/common/dist/types'; | ||
export { JoyStick, JoyStickAxis, JoyStickButton } from '@enable3d/common/dist/misc/joystick'; | ||
@@ -24,3 +22,7 @@ export { ThirdPersonControls, ThirdPersonControlsConfig } from '@enable3d/common/dist/misc/thirdPersonControls'; | ||
export { PointerDrag } from '@enable3d/common/dist/misc/pointerDrag'; | ||
export { EffectComposer, RenderPass, ShaderPass, GlitchPass, DotScreenShader } from '@enable3d/three-wrapper/dist/index'; | ||
export { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'; | ||
export { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js'; | ||
export { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js'; | ||
export { GlitchPass } from 'three/examples/jsm/postprocessing/GlitchPass.js'; | ||
export { DotScreenShader } from 'three/examples/jsm/shaders/DotScreenShader.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,39 +6,27 @@ * @author Yannick Deubel (https://github.com/yandeu) | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DotScreenShader = exports.GlitchPass = exports.ShaderPass = exports.RenderPass = exports.EffectComposer = exports.PointerDrag = exports.PointerLock = exports.FirstPersonControls = exports.ThirdPersonControls = exports.JoyStick = exports.Types = exports.THREE = exports.ExtendedGroup = exports.ExtendedObject3D = exports.ExtendedMesh = exports.Canvas = exports.PhysicsLoader = exports.enable3d = exports.Scene3D = void 0; | ||
var scene3d_1 = require("./scene3d"); | ||
Object.defineProperty(exports, "Scene3D", { enumerable: true, get: function () { return scene3d_1.Scene3D; } }); | ||
var enable3d_1 = require("./enable3d"); | ||
Object.defineProperty(exports, "enable3d", { enumerable: true, get: function () { return enable3d_1.enable3d; } }); | ||
var physicsLoader_1 = require("@enable3d/common/dist/physicsLoader"); | ||
Object.defineProperty(exports, "PhysicsLoader", { enumerable: true, get: function () { return physicsLoader_1.PhysicsLoader; } }); | ||
const customCanvas_1 = require("@enable3d/common/dist/customCanvas"); | ||
exports.Canvas = customCanvas_1.default; | ||
var extendedMesh_1 = require("@enable3d/common/dist/extendedMesh"); | ||
Object.defineProperty(exports, "ExtendedMesh", { enumerable: true, get: function () { return extendedMesh_1.ExtendedMesh; } }); | ||
var extendedObject3D_1 = require("@enable3d/common/dist/extendedObject3D"); | ||
Object.defineProperty(exports, "ExtendedObject3D", { enumerable: true, get: function () { return extendedObject3D_1.ExtendedObject3D; } }); | ||
var extendedGroup_1 = require("@enable3d/common/dist/extendedGroup"); | ||
Object.defineProperty(exports, "ExtendedGroup", { enumerable: true, get: function () { return extendedGroup_1.ExtendedGroup; } }); | ||
const THREE = require("@enable3d/three-wrapper/dist/index"); | ||
exports.THREE = THREE; | ||
const Types = require("@enable3d/common/dist/types"); | ||
exports.Types = Types; | ||
var joystick_1 = require("@enable3d/common/dist/misc/joystick"); | ||
Object.defineProperty(exports, "JoyStick", { enumerable: true, get: function () { return joystick_1.JoyStick; } }); | ||
var thirdPersonControls_1 = require("@enable3d/common/dist/misc/thirdPersonControls"); | ||
Object.defineProperty(exports, "ThirdPersonControls", { enumerable: true, get: function () { return thirdPersonControls_1.ThirdPersonControls; } }); | ||
var firstPersonControls_1 = require("@enable3d/common/dist/misc/firstPersonControls"); | ||
Object.defineProperty(exports, "FirstPersonControls", { enumerable: true, get: function () { return firstPersonControls_1.FirstPersonControls; } }); | ||
var pointerLock_1 = require("@enable3d/common/dist/misc/pointerLock"); | ||
Object.defineProperty(exports, "PointerLock", { enumerable: true, get: function () { return pointerLock_1.PointerLock; } }); | ||
var pointerDrag_1 = require("@enable3d/common/dist/misc/pointerDrag"); | ||
Object.defineProperty(exports, "PointerDrag", { enumerable: true, get: function () { return pointerDrag_1.PointerDrag; } }); | ||
export { Scene3D } from './scene3d'; | ||
export { enable3d } from './enable3d'; | ||
export { PhysicsLoader } from '@enable3d/common/dist/physicsLoader'; | ||
export { Canvas } from '@enable3d/common/dist/customCanvas'; | ||
export { ExtendedMesh } from '@enable3d/common/dist/extendedMesh'; | ||
export { ExtendedObject3D } from '@enable3d/common/dist/extendedObject3D'; | ||
export { ExtendedGroup } from '@enable3d/common/dist/extendedGroup'; | ||
import * as FLAT_1 from '@enable3d/three-graphics/jsm/flat'; | ||
export { FLAT_1 as FLAT }; | ||
import * as THREE_1 from 'three'; | ||
export { THREE_1 as THREE }; | ||
import * as Types_1 from '@enable3d/common/dist/types'; | ||
export { Types_1 as Types }; | ||
// misc | ||
export { JoyStick } from '@enable3d/common/dist/misc/joystick'; | ||
export { ThirdPersonControls } from '@enable3d/common/dist/misc/thirdPersonControls'; | ||
export { FirstPersonControls } from '@enable3d/common/dist/misc/firstPersonControls'; | ||
export { PointerLock } from '@enable3d/common/dist/misc/pointerLock'; | ||
export { PointerDrag } from '@enable3d/common/dist/misc/pointerDrag'; | ||
// post-processing | ||
var index_1 = require("@enable3d/three-wrapper/dist/index"); | ||
Object.defineProperty(exports, "EffectComposer", { enumerable: true, get: function () { return index_1.EffectComposer; } }); | ||
Object.defineProperty(exports, "RenderPass", { enumerable: true, get: function () { return index_1.RenderPass; } }); | ||
Object.defineProperty(exports, "ShaderPass", { enumerable: true, get: function () { return index_1.ShaderPass; } }); | ||
Object.defineProperty(exports, "GlitchPass", { enumerable: true, get: function () { return index_1.GlitchPass; } }); | ||
Object.defineProperty(exports, "DotScreenShader", { enumerable: true, get: function () { return index_1.DotScreenShader; } }); | ||
export { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'; | ||
export { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js'; | ||
export { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js'; | ||
export { GlitchPass } from 'three/examples/jsm/postprocessing/GlitchPass.js'; | ||
export { DotScreenShader } from 'three/examples/jsm/shaders/DotScreenShader.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -9,3 +9,3 @@ /** | ||
import { ThreeGraphicsConfig } from '@enable3d/common/dist/types'; | ||
import { WarpedStartFeatures } from '@enable3d/three-graphics/dist/plugins'; | ||
import { WarpedStartFeatures } from '@enable3d/three-graphics/jsm/plugins'; | ||
export declare class Scene3D extends Phaser.Scene { | ||
@@ -20,10 +20,10 @@ constructor(config: string | Phaser.Types.Scenes.SettingsConfig); | ||
warpSpeed(...features: WarpedStartFeatures[]): Promise<{ | ||
camera?: import("@enable3d/three-wrapper/dist").PerspectiveCamera | import("@enable3d/three-wrapper/dist").OrthographicCamera | undefined; | ||
camera?: import("three").PerspectiveCamera | import("three").OrthographicCamera | undefined; | ||
lights?: { | ||
ambientLight: import("@enable3d/three-wrapper/dist").AmbientLight; | ||
directionalLight: import("@enable3d/three-wrapper/dist").DirectionalLight; | ||
hemisphereLight: import("@enable3d/three-wrapper/dist").HemisphereLight; | ||
ambientLight: import("three").AmbientLight; | ||
directionalLight: import("three").DirectionalLight; | ||
hemisphereLight: import("three").HemisphereLight; | ||
} | undefined; | ||
ground?: import("@enable3d/common/dist/extendedObject3D").ExtendedObject3D | undefined; | ||
orbitControls?: import("@enable3d/three-wrapper/dist").OrbitControls | undefined; | ||
orbitControls?: import("three/examples/jsm/controls/OrbitControls").OrbitControls | undefined; | ||
}>; | ||
@@ -30,0 +30,0 @@ haveSomeFun(numberOfElements?: number): void; |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
/** | ||
@@ -16,8 +15,6 @@ * @author Yannick Deubel (https://github.com/yandeu) | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Scene3D = void 0; | ||
const third_1 = require("./third"); | ||
const Phaser = require("phaser"); | ||
const dist_1 = require("@enable3d/three-wrapper/dist"); | ||
class Scene3D extends Phaser.Scene { | ||
import Third from './third'; | ||
import * as Phaser from 'phaser'; | ||
import { Color } from 'three'; | ||
export class Scene3D extends Phaser.Scene { | ||
constructor(config) { | ||
@@ -53,3 +50,3 @@ super(config); | ||
// create new third | ||
this.third = new third_1.default(this, config); | ||
this.third = new Third(this, config); | ||
// set phaser background color to white | ||
@@ -61,3 +58,3 @@ // this.cameras.main.setBackgroundColor(0xffffff) | ||
// set three.js background color to white | ||
this.third.scene.background = new dist_1.Color('white'); | ||
this.third.scene.background = new Color('white'); | ||
} | ||
@@ -90,3 +87,2 @@ /** Combines the 3 XR update methods */ | ||
} | ||
exports.Scene3D = Scene3D; | ||
//# sourceMappingURL=scene3d.js.map |
@@ -6,7 +6,8 @@ /** | ||
*/ | ||
import { ThreeGraphics } from '@enable3d/three-graphics/dist/index'; | ||
import { ThreeGraphics } from '@enable3d/three-graphics/jsm'; | ||
import { ThreeGraphicsConfig, ExtendedObject3D, ExtendedMesh } from '@enable3d/common/dist/types'; | ||
import { Scene3D } from './scene3d'; | ||
import * as Plugins from '@enable3d/three-graphics/dist/plugins/index'; | ||
import { EffectComposer } from '@enable3d/three-wrapper/dist'; | ||
import * as Plugins from '@enable3d/three-graphics/jsm/plugins'; | ||
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'; | ||
import { CSG } from '@enable3d/three-graphics/jsm/csg'; | ||
/** | ||
@@ -22,3 +23,2 @@ * The phaser wrapper for ThreeGraphics, which is a separate module | ||
transform: Plugins.Transform; | ||
csg: Plugins.CSG; | ||
heightMap: Plugins.HeightMap; | ||
@@ -28,2 +28,3 @@ webXR: Plugins.WebXR; | ||
cameras: Plugins.Cameras; | ||
csg: typeof CSG; | ||
private factories; | ||
@@ -45,16 +46,16 @@ private ws; | ||
warpSpeed(...features: Plugins.WarpedStartFeatures[]): Promise<{ | ||
camera?: import("@enable3d/three-wrapper/dist").PerspectiveCamera | import("@enable3d/three-wrapper/dist").OrthographicCamera | undefined; | ||
camera?: import("three").PerspectiveCamera | import("three").OrthographicCamera | undefined; | ||
lights?: { | ||
ambientLight: import("@enable3d/three-wrapper/dist").AmbientLight; | ||
directionalLight: import("@enable3d/three-wrapper/dist").DirectionalLight; | ||
hemisphereLight: import("@enable3d/three-wrapper/dist").HemisphereLight; | ||
ambientLight: import("three").AmbientLight; | ||
directionalLight: import("three").DirectionalLight; | ||
hemisphereLight: import("three").HemisphereLight; | ||
} | undefined; | ||
ground?: ExtendedObject3D | undefined; | ||
orbitControls?: import("@enable3d/three-wrapper/dist").OrbitControls | undefined; | ||
orbitControls?: import("three/examples/jsm/controls/OrbitControls").OrbitControls | undefined; | ||
}>; | ||
haveSomeFun(numberOfElements?: number): void; | ||
get animationMixers(): { | ||
create: (root: import("@enable3d/three-graphics").Object3D) => import("@enable3d/three-wrapper/dist").AnimationMixer; | ||
add: (animationMixer: import("@enable3d/three-wrapper/dist").AnimationMixer) => number; | ||
get: () => import("@enable3d/three-wrapper/dist").AnimationMixer[]; | ||
create: (root: import("three").Object3D) => import("three").AnimationMixer; | ||
add: (animationMixer: import("three").AnimationMixer) => number; | ||
get: () => import("three").AnimationMixer[]; | ||
update: (delta: number) => void; | ||
@@ -61,0 +62,0 @@ }; |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
/** | ||
@@ -16,9 +15,10 @@ * @author Yannick Deubel (https://github.com/yandeu) | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const index_1 = require("@enable3d/three-graphics/dist/index"); | ||
const Plugins = require("@enable3d/three-graphics/dist/plugins/index"); | ||
import { ThreeGraphics } from '@enable3d/three-graphics/jsm'; | ||
import * as Plugins from '@enable3d/three-graphics/jsm/plugins'; | ||
import { WebGLRenderer } from 'three'; | ||
import { CSG } from '@enable3d/three-graphics/jsm/csg'; | ||
/** | ||
* The phaser wrapper for ThreeGraphics, which is a separate module | ||
*/ | ||
class Third extends index_1.ThreeGraphics { | ||
class Third extends ThreeGraphics { | ||
/** | ||
@@ -38,3 +38,3 @@ * Start Phaser3D | ||
// add a custom renderer to ThreeGraphics | ||
config.renderer = new index_1.WebGLRenderer(Object.assign(Object.assign({}, options), { antialias: config.antialias || false })); | ||
config.renderer = new WebGLRenderer(Object.assign(Object.assign({}, options), { antialias: config.antialias || false })); | ||
super(config); | ||
@@ -127,3 +127,3 @@ (_a = scene3D.sys.game.canvas.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(config.renderer.domElement, scene3D.sys.game.canvas); | ||
this.transform = new Plugins.Transform(this.camera, this.renderer); | ||
this.csg = new Plugins.CSG(this.scene, this.transform); | ||
this.csg = CSG; | ||
this.heightMap = new Plugins.HeightMap(this.scene); | ||
@@ -175,3 +175,3 @@ this.factories = new Plugins.Factories(this.scene); | ||
} | ||
exports.default = Third; | ||
export default Third; | ||
//# sourceMappingURL=third.js.map |
{ | ||
"name": "@enable3d/phaser-extension", | ||
"version": "0.22.0-dev.0", | ||
"version": "0.22.0-dev.1", | ||
"description": "3D extension for Phaser 3", | ||
@@ -33,6 +33,6 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@enable3d/ammo-physics": "^0.22.0-dev.0", | ||
"@enable3d/common": "^0.22.0-dev.0", | ||
"@enable3d/three-graphics": "^0.22.0-dev.0", | ||
"@enable3d/three-wrapper": "^0.22.0-dev.0", | ||
"@enable3d/ammo-physics": "^0.22.0-dev.1", | ||
"@enable3d/common": "^0.22.0-dev.1", | ||
"@enable3d/three-graphics": "^0.22.0-dev.1", | ||
"@enable3d/three-wrapper": "^0.22.0-dev.1", | ||
"eventemitter3": "^4.0.4" | ||
@@ -39,0 +39,0 @@ }, |
@@ -5,6 +5,6 @@ { | ||
"outDir": "./dist", | ||
"rootDir": "./src", | ||
"module": "commonjs" | ||
"rootDir": "./src" | ||
// "module": "commonjs" | ||
}, | ||
"include": ["./src/**/*", "./types/**/*"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37873
489