-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
113 additions
and
27 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
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,39 @@ | ||
const AFrame = require('aframe'); | ||
|
||
export const trackPosition = 'track-position'; | ||
|
||
interface TrackPositionProperties extends AFrame.Component { | ||
controllerBody: THREE.Object3D; | ||
} | ||
|
||
export default function register() { | ||
AFrame.registerComponent(trackPosition, { | ||
schema: { | ||
type: 'string' | ||
}, | ||
|
||
init() { | ||
|
||
}, | ||
|
||
update() { | ||
const targetName = this.data; | ||
const target = document.querySelector(targetName); | ||
// TODO used with Daydream controller models | ||
this.controllerBody = target.getObjectByName('Body_Body_Cylinder'); | ||
}, | ||
|
||
tick(this: TrackPositionProperties) { | ||
if (!this.controllerBody) { | ||
return; | ||
} | ||
const controllerObj = this.controllerBody.geometry; | ||
this.el!.setAttribute('position', position); | ||
}, | ||
|
||
getBoundingSphere() { | ||
|
||
} | ||
}); | ||
} | ||
|
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,19 @@ | ||
import { CustomElementDescriptor } from '@dojo/widget-core/customElements'; | ||
import App from './App'; | ||
import initialize from './initialize'; | ||
|
||
// Require globals | ||
require('aframe'); | ||
require('aframe-environment-component'); | ||
|
||
export default function createDerpymonElement(): CustomElementDescriptor { | ||
return { | ||
tagName: 'go-derpy', | ||
widgetConstructor: App, | ||
events: [], | ||
properties: [], | ||
initialization() { | ||
return initialize(); | ||
} | ||
} | ||
} |
This file was deleted.
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
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,16 @@ | ||
import { initialize as initCharacters } from './definitions/characters'; | ||
import registerHeightComponent from './components/heightComponent'; | ||
import registerTrackPosition from './components/trackPosition'; | ||
|
||
let initialized = false; | ||
|
||
export default function initialize() { | ||
if (initialized) { | ||
console.error('Application already initialized'); | ||
} | ||
|
||
initCharacters(); | ||
registerHeightComponent(); | ||
registerTrackPosition(); | ||
initialized = true; | ||
} |
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