This repository has been archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Jam3/develop
Merge develop to master
- Loading branch information
Showing
33 changed files
with
2,512 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PUBLIC_URL=/webgl-react-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
[options] | ||
all=true | ||
emoji=true | ||
esproposal.optional_chaining=enable | ||
|
||
[strict] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"textures": {}, | ||
"models": { | ||
"jam3.fbx": { "convert": true } | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default []; |
65 changes: 65 additions & 0 deletions
65
src/webgl-app/scenes/interactive-sphere/interactive-sphere-scene.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import BaseScene from '../base/base-scene'; | ||
import { VECTOR_ZERO } from '../../utils/math'; | ||
import Sphere from './objects/sphere/sphere'; | ||
import Ambient from '../../lights/ambient'; | ||
import Directional from '../../lights/directional'; | ||
import assets from './assets'; | ||
import Background from '../../objects/background/background'; | ||
import settings from '../../settings'; | ||
|
||
export const INTERACTIVE_SPHERE_SCENE_ID = 'interactive-sphere'; | ||
|
||
export default class InteractiveSphereScene extends BaseScene { | ||
constructor() { | ||
settings.devCamera = false; | ||
const lights = [new Ambient(), new Directional()]; | ||
super({ id: INTERACTIVE_SPHERE_SCENE_ID, assets, gui: true, guiOpen: true, lights, controls: true }); | ||
this.camera.position.set(0, 0, 5); | ||
this.camera.lookAt(VECTOR_ZERO); | ||
} | ||
|
||
/** | ||
* Create and setup any objects for the scene | ||
* | ||
* @memberof LandingScene | ||
*/ | ||
async createSceneObjects() { | ||
await new Promise((resolve, reject) => { | ||
try { | ||
this.background = new Background(this.gui); | ||
this.scene.add(this.background.mesh); | ||
this.sphere = new Sphere(this.camera); | ||
this.scene.add(this.sphere.mesh); | ||
this.animateInit(); | ||
resolve(); | ||
} catch (error) { | ||
reject(error); | ||
} | ||
}); | ||
} | ||
|
||
preloadGpuCullScene = (culled: boolean) => { | ||
this.sphere.preloadGpuCullScene(culled); | ||
}; | ||
|
||
animateInit = () => { | ||
return this.sphere.animateInit(); | ||
}; | ||
|
||
animateIn = () => { | ||
return this.sphere.animateIn(); | ||
}; | ||
|
||
animateOut = () => { | ||
return this.sphere.animateOut(); | ||
}; | ||
|
||
/** | ||
* Update loop | ||
* | ||
* @memberof LandingScene | ||
*/ | ||
update = (delta: number) => { | ||
this.sphere.update(delta); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,11 @@ | ||
import Asset from '../../loading/asset'; | ||
import Loader from '../../loading/loaders/loader'; | ||
import settings from '../../settings'; | ||
|
||
export default [ | ||
new Asset({ | ||
id: 'test-image', | ||
src: '/assets/webgl/test/test-128.jpg', | ||
type: Loader.image | ||
}), | ||
new Asset({ | ||
id: 'test-json', | ||
src: '/assets/webgl/test/test.json', | ||
type: Loader.json | ||
}), | ||
new Asset({ | ||
id: 'test-texture', | ||
src: '/assets/webgl/test/test-128.jpg', | ||
type: Loader.threeTexture | ||
}), | ||
new Asset({ | ||
id: 'scene-gltf', | ||
src: '/assets/webgl/test/scene.glb', | ||
id: 'jam3-logo', | ||
src: `${settings.baseUrl}/assets/webgl/landing/jam3.glb`, | ||
type: Loader.threeGLTF | ||
}), | ||
new Asset({ | ||
id: 'cube-fbx', | ||
src: '/assets/webgl/test/cube.fbx', | ||
type: Loader.threeFBX | ||
}) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.