added initial gltf test.
This commit is contained in:
parent
d82df88296
commit
1dd192cd4d
@ -1,6 +1,5 @@
|
||||
import {
|
||||
AbstractMesh,
|
||||
Mesh,
|
||||
PhysicsMotionType,
|
||||
Scene,
|
||||
TransformNode,
|
||||
@ -144,12 +143,8 @@ export class Base {
|
||||
mesh && mesh.setParent(this.xrInputSource.motionController.rootMesh);
|
||||
this.grabbedMesh = mesh;
|
||||
} else {
|
||||
if (mesh?.parent?.parent?.metadata?.grabbable) {
|
||||
if (mesh?.parent?.parent?.parent) {
|
||||
mesh = (mesh?.parent?.parent?.parent as Mesh);
|
||||
if (mesh?.metadata?.grabbable) {
|
||||
this.grabbedMesh = mesh;
|
||||
player = true;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
const uploadImage = async (evt) => {
|
||||
|
||||
const file = (evt.target as HTMLInputElement).files[0];
|
||||
if (!file) {
|
||||
console.log('no file selected');
|
||||
return;
|
||||
}
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
//formData.append('requireSignedURLs', 'true');
|
||||
|
||||
@ -115,7 +115,10 @@ function Menu() {
|
||||
|
||||
function handleDiagramListClick(evt: React.MouseEvent<HTMLAnchorElement>) {
|
||||
evt.preventDefault();
|
||||
switch (evt.target.id) {
|
||||
if (!evt.currentTarget.id) {
|
||||
return;
|
||||
}
|
||||
switch (evt.currentTarget.id) {
|
||||
case 'imageUploadLink':
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
@ -133,9 +136,7 @@ function Menu() {
|
||||
return (
|
||||
<div>
|
||||
<MainMenu onClick={handleDiagramListClick}/>
|
||||
<TutorialMenu onClick={handleDesktopTutorialClick}/>
|
||||
<CreateMenu display={createState} toggleCreateMenu={handleCreateClick}/>
|
||||
<KeyboardHelp display={desktopTutorialState} onClick={handleDesktopTutorialClick}/>
|
||||
<DiagramList onClick={handleCreateClick} display={diagramListState}/>
|
||||
</div>
|
||||
)
|
||||
|
||||
29
src/vrApp.ts
29
src/vrApp.ts
@ -57,6 +57,35 @@ export class VrApp {
|
||||
|
||||
*/
|
||||
addSceneInspector();
|
||||
|
||||
/*
|
||||
SceneLoader.ImportMesh(null,'https://models.deepdiagram.com/', 'Chair_textured_mesh_lowpoly_glb.glb', scene, (meshes) => {
|
||||
const transform = new Mesh('chair', scene);
|
||||
for(const mesh of meshes){
|
||||
mesh.parent= transform;
|
||||
}
|
||||
let {min, max} = transform.getHierarchyBoundingVectors(true);
|
||||
const parentMesh = MeshBuilder.CreateBox('boundingBox', {width: max.x - min.x, height: max.y - min.y, depth: max.z - min.z}, scene);
|
||||
for(const mesh of meshes){
|
||||
mesh.parent= parentMesh;
|
||||
|
||||
}
|
||||
transform.dispose();
|
||||
//parentMesh.setBoundingInfo(new BoundingInfo(min, max));
|
||||
parentMesh.showBoundingBox = true;
|
||||
parentMesh.scaling = new Vector3(.2,.2,.2);
|
||||
//mesh.metadata = {grabbable: true};
|
||||
parentMesh.position.y = .5;
|
||||
parentMesh.position.z = 0;
|
||||
parentMesh.metadata = {grabbable: true};
|
||||
const material = new StandardMaterial('chairMaterial', scene);
|
||||
material.alpha = 0;
|
||||
parentMesh.material = material;
|
||||
parentMesh.showBoundingBox = true;
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
const el = document.querySelector('#download');
|
||||
if (el) {
|
||||
el.addEventListener('click', () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user