Skip to content

Commit

Permalink
remove esm as it breaks it
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyH2 committed Mar 30, 2024
1 parent 4ec5e72 commit 6ba244f
Show file tree
Hide file tree
Showing 20 changed files with 130 additions and 153 deletions.
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ <h1>CardiVR</h1>
<button>Launch</button>
</div>
</div>

<script src="./libraries/three.js"></script>
<script src="./libraries/cardboard-vr-display.js"></script>

<script src="./utils/DeviceOrientationControls.js"></script>
<script src="./utils/CardboardActions.js"></script>

<script src="./utils/MTLLoader.js"></script>
<script src="./utils/OBJLoader.js"></script>

<script src="./utils/VREffect.js"></script>

<script type="module" src="./src/main.js"></script>

Expand Down
10 changes: 6 additions & 4 deletions libraries/cardboard-vr-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@
* THE SOFTWARE.
*/

var MainFunc = (function () { 'use strict';
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.CardboardVRDisplay = factory());
}(this, (function () { 'use strict';

var asyncGenerator = function () {
function AwaitValue(value) {
Expand Down Expand Up @@ -3462,6 +3466,4 @@ CardboardVRDisplay.VRDisplay = VRDisplay;

return CardboardVRDisplay;

})();

export default MainFunc;
})));
2 changes: 0 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../libraries/three.module.min.js";
import CardboardVRDisplay from "../libraries/cardboard-vr-display.js";
import { Render } from "./world/render.js";

class Main {
Expand Down
1 change: 0 additions & 1 deletion src/screens/main/SettingsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../../libraries/three.module.min.js";
import { Screen } from "../screen.js";

class SettingsMenu extends Screen {
Expand Down
1 change: 0 additions & 1 deletion src/screens/main/appsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../../libraries/three.module.min.js";
import { Screen } from "../screen.js";

class AppsMenu extends Screen {
Expand Down
1 change: 0 additions & 1 deletion src/screens/main/mainMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../../libraries/three.module.min.js";
import { Screen } from "../screen.js";

class MainMenu extends Screen {
Expand Down
2 changes: 0 additions & 2 deletions src/screens/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../libraries/three.module.min.js";

class Screen {
constructor(root) {
this.root = root;
Expand Down
2 changes: 0 additions & 2 deletions src/screens/screenManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../libraries/three.module.min.js";

class ScreenManager {
constructor(root) {
this.root = root;
Expand Down
1 change: 0 additions & 1 deletion src/screens/start/actionsInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../../libraries/three.module.min.js";
import { Screen } from "../screen.js";
import { TextBox } from "../../../utils/TextBox.js";

Expand Down
7 changes: 2 additions & 5 deletions src/screens/start/controllerAlign.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../../libraries/three.module.min.js";
import { MTLLoader } from "../../../utils/MTLLoader.js";
import { OBJLoader } from "../../../utils/OBJLoader.js";
import { Screen } from "../screen.js";
import { TextBox } from "../../../utils/TextBox.js";

Expand Down Expand Up @@ -46,11 +43,11 @@ class ControllerAlignScreen extends Screen {

renderGroup.add( mesh );

var mtlLoader = new MTLLoader();
var mtlLoader = new THREE.MTLLoader();
mtlLoader.load("./assets/objects/gear_vr_controller.mtl", function(materials) {
materials.preload();

var objLoader = new OBJLoader();
var objLoader = new THREE.OBJLoader();
objLoader.setMaterials(materials);
objLoader.load("./assets/objects/gear_vr_controller.obj", function(object) {
object.position.z = -0.8;
Expand Down
7 changes: 2 additions & 5 deletions src/screens/start/controllerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../../libraries/three.module.min.js";
import { MTLLoader } from "../../../utils/MTLLoader.js";
import { OBJLoader } from "../../../utils/OBJLoader.js";
import { Screen } from "../screen.js";
import { TextBox } from "../../../utils/TextBox.js";

Expand Down Expand Up @@ -46,11 +43,11 @@ class ControllerInfoScreen extends Screen {

renderGroup.add( mesh );

var mtlLoader = new MTLLoader();
var mtlLoader = new THREE.MTLLoader();
mtlLoader.load("./assets/objects/gear_vr_controller.mtl", function(materials) {
materials.preload();

var objLoader = new OBJLoader();
var objLoader = new THREE.OBJLoader();
objLoader.setMaterials(materials);
objLoader.load("./assets/objects/gear_vr_controller.obj", function(object) {
object.position.z = -0.8;
Expand Down
1 change: 0 additions & 1 deletion src/screens/start/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../../libraries/three.module.min.js";
import { Screen } from "../screen.js";
import { TextBox } from "../../../utils/TextBox.js";
import { ActionsInfoScreen } from "./actionsInfo.js";
Expand Down
1 change: 0 additions & 1 deletion src/world/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../libraries/three.module.min.js";
import { Scene } from "./scene.js";

class Render {
Expand Down
8 changes: 2 additions & 6 deletions src/world/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
* @author crazyh / https://github.com/crazyh2
*/

import * as THREE from "../../libraries/three.module.min.js";
import { DeviceOrientationControls } from "../../utils/DeviceOrientationControls.js";
import { CardboardActions } from "../../utils/CardboardActions.js";
import { VREffect } from "../../utils/VREffect.js";
import { WelcomeScreen } from "../screens/start/welcome.js";
import { ScreenManager } from "./../screens/screenManager.js";

Expand All @@ -31,10 +27,10 @@ class Scene {
var actionControls = new CardboardActions(this.camera);

// Apply VR headset rotational data to camera.
var controls = new DeviceOrientationControls(this.camera);
var controls = new THREE.DeviceOrientationControls(this.camera);

// Apply VR stereo rendering to renderer.
var effect = new VREffect(this.top.renderer);
var effect = new THREE.VREffect(this.top.renderer);
effect.setSize(window.innerWidth, window.innerHeight);

// Kick off the render loop.
Expand Down
2 changes: 0 additions & 2 deletions utils/CardboardActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ class CardboardActions {
}
};
};

export { CardboardActions };
Loading

0 comments on commit 6ba244f

Please sign in to comment.