Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fully type checked example #27

Open
wants to merge 1 commit into
base: ossos_next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 108 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@
"lint": "eslint . --ext .ts"
},
"devDependencies": {
"@types/three": "^0.148.1",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"eslint": "^8.31.0",
"three": "^0.148.0",
"typescript": "^5.0.3",
"typescript": "^5.5.0-beta",
"vite": "^4.0.0",
"vite-plugin-list-directory-contents": "^1.4.5"
},
Expand Down
1 change: 1 addition & 0 deletions prototypes/_lib/gltf2parser.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ class Gltf2Parser {
}
return false;
}
/** @param {string} url */
static async fetch(url) {
const res = await fetch(url);
if (!res.ok)
Expand Down
2 changes: 1 addition & 1 deletion prototypes/_lib/meshes/DynLineMesh.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as THREE from '@three';
import * as THREE from 'three';

class DynLineMesh extends THREE.LineSegments{
_defaultColor = 0x00ff00;
Expand Down
2 changes: 1 addition & 1 deletion prototypes/_lib/meshes/ShapePointsMesh.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as THREE from '@three';
import * as THREE from 'three';

class ShapePointsMesh extends THREE.Points{
_defaultShape = 1;
Expand Down
5 changes: 3 additions & 2 deletions prototypes/_lib/misc/GltfUtil.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// #region IMPORTS
import * as THREE from '@three';
import * as THREE from 'three';
import { Armature, Clip, TrackVec3, TrackQuat }
from '../../../src/index';
import Gltf2 from '../gltf2Parser.es.js';
import Gltf2 from '../gltf2parser.es.js';
// import MatrixSkinMaterial from '../customSkinning/MatrixSkinMaterial.js';
import MatrixSkinPbrMaterial from '../customSkinning/MatrixSkinPbrMaterial.js';
// #endregion
Expand Down Expand Up @@ -38,6 +38,7 @@ export default class GltfUtil{
// #endregion

// #region METHODS
/** @param {string} url */
static async fetch( url ){ return await Gltf2.fetch( url ); }

static filterNodes( gltf, props={} ){
Expand Down
2 changes: 1 addition & 1 deletion prototypes/_lib/misc/Util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as THREE from '@three';
import * as THREE from 'three';
import { Vec3 } from '../../../src/index';

export default class Util{
Expand Down
11 changes: 9 additions & 2 deletions prototypes/_lib/useThreeWebGL2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// #region IMPORTS
import * as THREE from '@three'; //'three';
import { OrbitControls } from '@OrbitControls'; //'three/examples/jsm/controls/OrbitControls.js';
import * as THREE from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
export { THREE };
// #endregion

Expand All @@ -19,6 +19,7 @@ App


// #region OPTIONS
/** @param {ReturnType<typeof useThreeWebGL2>} tjs */
export function useDarkScene( tjs, props={} ){
const pp = Object.assign( { ambient:0x404040, grid:true, }, props );

Expand Down Expand Up @@ -156,6 +157,12 @@ export default function useThreeWebGL2( props={} ){
};
};

/**
* @param {number} lon
* @param {number} lat
* @param {number} radius
* @param {[number, number, number] | null} target
*/
const sphericalLook = ( lon, lat, radius, target=null )=>{
const phi = ( 90 - lat ) * Math.PI / 180;
const theta = ( lon + 180 ) * Math.PI / 180;
Expand Down
Loading