Skip to content

Commit

Permalink
Merge pull request #4 from Yonet/main
Browse files Browse the repository at this point in the history
fix(controller):vr mode ray not showing issue
  • Loading branch information
mgechev authored May 15, 2024
2 parents ef957b7 + e064095 commit b477fe7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ server/bin
server/bin
server/pyvenv.cfg
server/*.pyc
./venv
server/venv/
20 changes: 0 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#3399ff",
"activityBar.background": "#3399ff",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#bf0060",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#e7e7e799",
"sash.hoverBorder": "#3399ff",
"statusBar.background": "#007fff",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#3399ff",
"statusBarItem.remoteBackground": "#007fff",
"statusBarItem.remoteForeground": "#e7e7e7",
"tab.activeBorder": "#3399ff",
"titleBar.activeBackground": "#007fff",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#007fff99",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.color": "#007fff",
"jest.runMode": "on-demand"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Angular WebXR Art Sample is a WebXR Gallery that creates Generative AI images us

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.1.0-rc.1.

[![Angular WebXR Art Sample](http://img.youtube.com/vi/B-k8ZNVM-F4/0.jpg)](https://youtu.be/B-k8ZNVM-F4)
[![Angular WebXR Art Sample](http://img.youtube.com/vi/XRvymNPSVF4/0.jpg)](https://www.youtube.com/shorts/XRvymNPSVF4)

## Pre-requisites

Expand Down
13 changes: 1 addition & 12 deletions src/app/three/xr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export class XRService {
// Check XR Support and determine if the session is AR or VR

checkXRSupport ( ops: { renderer: WebGLRenderer, camera: any, scene: any; } ) {
if ( this.vrSupported || this.arSupported ) { return true; }
else if ( navigator.xr ) {
if ( navigator.xr ) {

// Starts the inline session and init AR/VR depending on xrMode
navigator.xr.isSessionSupported( 'immersive-vr' ).then( ( supported ) => {
Expand Down Expand Up @@ -83,11 +82,6 @@ export class XRService {
this.webXRManager.enabled = true;
this.session = this.webXRManager.getSession();
this.initVR();
if ( this.xrMode() === 'immersive-vr' ) {
this.initVR();
} else if ( this.xrMode() === 'immersive-ar' ) {
this.initAR();
}

}

Expand Down Expand Up @@ -151,32 +145,27 @@ export class XRService {


onSqueze ( e: any ) {
console.log( 'Squuze event VR', e );

};

onSelectStart ( e: any ) {
console.log( 'Select Start VR event ', e );
this.userData.isSelecting = true;
this.interactions.intersectObjects( { controller: this.controllerLeft, scene: this.scene } );
this.interactions.intersectObjects( { controller: this.controllerRight, scene: this.scene } );

};

onSelect ( e: Event ) {
console.log( 'Select VR event ', e );
this.interactions.intersectObjects( { controller: this.controllerLeft, scene: this.scene, select: true } );
this.interactions.intersectObjects( { controller: this.controllerRight, scene: this.scene, select: true } );
}

onSelectEnd ( e: any ) {
console.log( 'Select End VR event ', e );
this.userData.isSelecting = false;
this.interactions.intersectObjects( { controller: this.controllerLeft, scene: this.scene } );
}

initAR () {
console.log( 'Initializing AR' );
}

updateInputSources ( session = this.session, frame: any, refSpace: any, scene = this.scene ) {
Expand Down

0 comments on commit b477fe7

Please sign in to comment.