feat(all): init commit
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.idea
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
/dist
|
||||
/lib
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 nikoals
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,16 @@
|
||||
# three-is
|
||||
|
||||
在 typescript 使用 three.js 时的类型守卫
|
||||
|
||||
```ts
|
||||
import {isOrthographicCamera, isPerspectiveCamera} from "three-is";
|
||||
import * as THREE from "three";
|
||||
|
||||
const camera: THREE.PerspectiveCamera | THREE.OrthographicCamera = new THREE.OrthographicCamera()
|
||||
|
||||
if (isOrthographicCamera(camera)) {
|
||||
// 为正交
|
||||
} else if (isPerspectiveCamera(camera)) {
|
||||
// 为透视
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "three-is",
|
||||
"version": "0.0.1",
|
||||
"main": "src/index.ts",
|
||||
"dependencies": {
|
||||
"lodash-es": "^4.18.1",
|
||||
"three": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/three": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
Generated
+27
@@ -0,0 +1,27 @@
|
||||
lockfileVersion: 5.3
|
||||
|
||||
specifiers:
|
||||
'@types/three': ^0.136.1
|
||||
three: ^0.136.0
|
||||
typescript: ^4.5.5
|
||||
|
||||
dependencies:
|
||||
'@types/three': 0.136.1
|
||||
three: 0.136.0
|
||||
typescript: 4.5.5
|
||||
|
||||
packages:
|
||||
|
||||
/@types/three/0.136.1:
|
||||
resolution: {integrity: sha512-gzTw6RR4dU8sGf+RpLBWWKHRVIJ4gwKVQPk+IFCgha04Efg/itXYUalX6iBcYeSmaDu0qE5M7uTq0XLQpU4FAg==}
|
||||
dev: false
|
||||
|
||||
/three/0.136.0:
|
||||
resolution: {integrity: sha512-+fEMX7nYLz2ZesVP/dyifli5Jf8gR3XPAnFJveQ80aMhibFduzrADnjMbARXh8+W9qLK7rshJCjAIL/6cDxC+A==}
|
||||
dev: false
|
||||
|
||||
/typescript/4.5.5:
|
||||
resolution: {integrity: sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
@@ -0,0 +1,18 @@
|
||||
export * from "./isBoxGeometry";
|
||||
export * from "./isBufferGeometry";
|
||||
export * from "./isCapsuleGeometry";
|
||||
export * from "./isCircleGeometry";
|
||||
export * from "./isCylinderGeometry";
|
||||
export * from "./isDodecahedronGeometry";
|
||||
export * from "./isExtrudeGeometry";
|
||||
export * from "./isIcosahedronGeometry";
|
||||
export * from "./isLatheGeometry";
|
||||
export * from "./isOctahedronGeometry";
|
||||
export * from "./isPlaneGeometry";
|
||||
export * from "./isRingGeometry";
|
||||
export * from "./isShapeGeometry";
|
||||
export * from "./isSphereGeometry";
|
||||
export * from "./isTetrahedronGeometry";
|
||||
export * from "./isTorusGeometry";
|
||||
export * from "./isTorusKnotGeometry";
|
||||
export * from "./isTubeGeometry";
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isBoxGeometry = (value: unknown): value is THREE.BoxGeometry => {
|
||||
return get(value, 'type') === 'BoxGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isBufferGeometry = (value: unknown): value is THREE.BufferGeometry => {
|
||||
return get(value, 'type') === 'BufferGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isCapsuleGeometry = (value: unknown): value is THREE.CapsuleGeometry => {
|
||||
return get(value, 'type') === 'CapsuleGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isCircleGeometry = (value: unknown): value is THREE.CircleGeometry => {
|
||||
return get(value, 'type') === 'CircleGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isCylinderGeometry = (value: unknown): value is THREE.CylinderGeometry => {
|
||||
return get(value, 'type') === 'CylinderGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isDodecahedronGeometry = (value: unknown): value is THREE.DodecahedronGeometry => {
|
||||
return get(value, 'type') === 'DodecahedronGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isExtrudeGeometry = (value: unknown): value is THREE.ExtrudeGeometry => {
|
||||
return get(value, 'type') === 'ExtrudeGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isIcosahedronGeometry = (value: unknown): value is THREE.IcosahedronGeometry => {
|
||||
return get(value, 'type') === 'IcosahedronGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isLatheGeometry = (value: unknown): value is THREE.LatheGeometry => {
|
||||
return get(value, 'type') === 'LatheGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isOctahedronGeometry = (value: unknown): value is THREE.OctahedronGeometry => {
|
||||
return get(value, 'type') === 'OctahedronGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPlaneGeometry = (value: unknown): value is THREE.PlaneGeometry => {
|
||||
return get(value, 'type') === 'PlaneGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isRingGeometry = (value: unknown): value is THREE.RingGeometry => {
|
||||
return get(value, 'type') === 'RingGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isShapeGeometry = (value: unknown): value is THREE.ShapeGeometry => {
|
||||
return get(value, 'type') === 'ShapeGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSphereGeometry = (value: unknown): value is THREE.SphereGeometry => {
|
||||
return get(value, 'type') === 'SphereGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isTetrahedronGeometry = (value: unknown): value is THREE.TetrahedronGeometry => {
|
||||
return get(value, 'type') === 'TetrahedronGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isTorusGeometry = (value: unknown): value is THREE.TorusGeometry => {
|
||||
return get(value, 'type') === 'TorusGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isTorusKnotGeometry = (value: unknown): value is THREE.TorusKnotGeometry => {
|
||||
return get(value, 'type') === 'TorusKnotGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isTubeGeometry = (value: unknown): value is THREE.TubeGeometry => {
|
||||
return get(value, 'type') === 'TubeGeometry';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export * from "./isArrayCamera";
|
||||
export * from "./isCamera";
|
||||
export * from "./isCubeCamera";
|
||||
export * from "./isOrthographicCamera";
|
||||
export * from "./isPerspectiveCamera";
|
||||
export * from "./isStereoCamera";
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isArrayCamera = (value: unknown): value is THREE.ArrayCamera => {
|
||||
return get(value, 'isArrayCamera') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isCamera = (value: unknown): value is THREE.Camera => {
|
||||
return get(value, 'isCamera') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isCubeCamera = (value: unknown): value is THREE.CubeCamera => {
|
||||
return get(value, 'isCubeCamera') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isOrthographicCamera = (value: unknown): value is THREE.OrthographicCamera => {
|
||||
return get(value, 'isOrthographicCamera') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPerspectiveCamera = (value: unknown): value is THREE.PerspectiveCamera => {
|
||||
return get(value, 'isPerspectiveCamera') === true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isStereoCamera = (value: unknown): value is THREE.StereoCamera => {
|
||||
return get(value, 'isStereoCamera') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
export * from "./isArrowHelper";
|
||||
export * from "./isAxesHelper";
|
||||
export * from "./isBox3Helper";
|
||||
export * from "./isBoxHelper";
|
||||
export * from "./isCameraHelper";
|
||||
export * from "./isDirectionalLightHelper";
|
||||
export * from "./isGridHelper";
|
||||
export * from "./isHemisphereLightHelper";
|
||||
export * from "./isPlaneHelper";
|
||||
export * from "./isPointLightHelper";
|
||||
export * from "./isPolarGridHelper";
|
||||
export * from "./isSkeletonHelper";
|
||||
export * from "./isSpotLightHelper";
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isArrowHelper = (value: unknown): value is THREE.ArrowHelper => {
|
||||
return get(value, 'isArrowHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isAxesHelper = (value: unknown): value is THREE.AxesHelper => {
|
||||
return get(value, 'isAxesHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isBox3Helper = (value: unknown): value is THREE.Box3Helper => {
|
||||
return get(value, 'isBox3Helper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isBoxHelper = (value: unknown): value is THREE.BoxHelper => {
|
||||
return get(value, 'isBoxHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isCameraHelper = (value: unknown): value is THREE.CameraHelper => {
|
||||
return get(value, 'isCameraHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isDirectionalLightHelper = (value: unknown): value is THREE.DirectionalLightHelper => {
|
||||
return get(value, 'isDirectionalLightHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isGridHelper = (value: unknown): value is THREE.GridHelper => {
|
||||
return get(value, 'isGridHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isHemisphereLightHelper = (value: unknown): value is THREE.HemisphereLightHelper => {
|
||||
return get(value, 'isHemisphereLightHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPlaneHelper = (value: unknown): value is THREE.PlaneHelper => {
|
||||
return get(value, 'isPlaneHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPointLightHelper = (value: unknown): value is THREE.PointLightHelper => {
|
||||
return get(value, 'isPointLightHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPolarGridHelper = (value: unknown): value is THREE.PolarGridHelper => {
|
||||
return get(value, 'isPolarGridHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSkeletonHelper = (value: unknown): value is THREE.SkeletonHelper => {
|
||||
return get(value, 'isSkeletonHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSpotLightHelper = (value: unknown): value is THREE.SpotLightHelper => {
|
||||
return get(value, 'isSpotLightHelper') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
export * from "./bufferGeometry";
|
||||
export * from "./cameras";
|
||||
export * from './helpers';
|
||||
export * from './lights';
|
||||
export * from './materials';
|
||||
export * from './math';
|
||||
export * from './objects';
|
||||
export * from './renderers';
|
||||
export * from './scenes';
|
||||
export * from './textures';
|
||||
@@ -0,0 +1,12 @@
|
||||
export * from "./isAmbientLight";
|
||||
export * from "./isDirectionalLight";
|
||||
export * from "./isDirectionalLightShadow";
|
||||
export * from "./isHemisphereLight";
|
||||
export * from "./isLight";
|
||||
export * from "./isLightProbe";
|
||||
export * from "./isLightShadow";
|
||||
export * from "./isPointLight";
|
||||
export * from "./isPointLightShadow";
|
||||
export * from "./isRectAreaLight";
|
||||
export * from "./isSpotLight";
|
||||
export * from "./isSpotLightShadow";
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isAmbientLight = (value: unknown): value is THREE.AmbientLight => {
|
||||
return get(value, 'isAmbientLight') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isDirectionalLight = (value: unknown): value is THREE.DirectionalLight => {
|
||||
return get(value, 'isDirectionalLight') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isDirectionalLightShadow = (value: unknown): value is THREE.DirectionalLightShadow => {
|
||||
return get(value, 'isDirectionalLightShadow') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isHemisphereLight = (value: unknown): value is THREE.HemisphereLight => {
|
||||
return get(value, 'isHemisphereLight') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isLight = (value: unknown): value is THREE.Light => {
|
||||
return get(value, 'isLight') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isLightProbe = (value: unknown): value is THREE.LightProbe => {
|
||||
return get(value, 'isLightProbe') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isLightShadow = (value: unknown): value is THREE.LightShadow => {
|
||||
return get(value, 'isLightShadow') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPointLight = (value: unknown): value is THREE.PointLight => {
|
||||
return get(value, 'isPointLight') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPointLightShadow = (value: unknown): value is THREE.PointLightShadow => {
|
||||
return get(value, 'isPointLightShadow') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isRectAreaLight = (value: unknown): value is THREE.RectAreaLight => {
|
||||
return get(value, 'isRectAreaLight') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSpotLight = (value: unknown): value is THREE.SpotLight => {
|
||||
return get(value, 'isSpotLight') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSpotLightShadow = (value: unknown): value is THREE.SpotLightShadow => {
|
||||
return get(value, 'isSpotLightShadow') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
export * from "./isLineBasicMaterial";
|
||||
export * from "./isLineDashedMaterial";
|
||||
export * from "./isMaterial";
|
||||
export * from "./isMeshBasicMaterial";
|
||||
export * from "./isMeshDepthMaterial";
|
||||
export * from "./isMeshDistanceMaterial";
|
||||
export * from "./isMeshLambertMaterial";
|
||||
export * from "./isMeshMatcapMaterial";
|
||||
export * from "./isMeshNormalMaterial";
|
||||
export * from "./isMeshPhongMaterial";
|
||||
export * from "./isMeshPhysicalMaterial";
|
||||
export * from "./isMeshStandardMaterial";
|
||||
export * from "./isMeshToonMaterial";
|
||||
export * from "./isPointsMaterial";
|
||||
export * from "./isRawShaderMaterial";
|
||||
export * from "./isShaderMaterial";
|
||||
export * from "./isShadowMaterial";
|
||||
export * from "./isSpriteMaterial";
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isLineBasicMaterial = (value: unknown): value is THREE.LineBasicMaterial => {
|
||||
return get(value, 'isLineBasicMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isLineDashedMaterial = (value: unknown): value is THREE.LineDashedMaterial => {
|
||||
return get(value, 'isLineDashedMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMaterial = (value: unknown): value is THREE.Material => {
|
||||
return get(value, 'isMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshBasicMaterial = (value: unknown): value is THREE.MeshBasicMaterial => {
|
||||
return get(value, 'isMeshBasicMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshDepthMaterial = (value: unknown): value is THREE.MeshDepthMaterial => {
|
||||
return get(value, 'isMeshDepthMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshDistanceMaterial = (value: unknown): value is THREE.MeshDistanceMaterial => {
|
||||
return get(value, 'isMeshDistanceMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshLambertMaterial = (value: unknown): value is THREE.MeshLambertMaterial => {
|
||||
return get(value, 'isMeshLambertMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshMatcapMaterial = (value: unknown): value is THREE.MeshMatcapMaterial => {
|
||||
return get(value, 'isMeshMatcapMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshNormalMaterial = (value: unknown): value is THREE.MeshNormalMaterial => {
|
||||
return get(value, 'isMeshNormalMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshPhongMaterial = (value: unknown): value is THREE.MeshPhongMaterial => {
|
||||
return get(value, 'isMeshPhongMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshPhysicalMaterial = (value: unknown): value is THREE.MeshPhysicalMaterial => {
|
||||
return get(value, 'isMeshPhysicalMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshStandardMaterial = (value: unknown): value is THREE.MeshStandardMaterial => {
|
||||
return get(value, 'isMeshStandardMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMeshToonMaterial = (value: unknown): value is THREE.MeshToonMaterial => {
|
||||
return get(value, 'isMeshToonMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPointsMaterial = (value: unknown): value is THREE.PointsMaterial => {
|
||||
return get(value, 'isPointsMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isRawShaderMaterial = (value: unknown): value is THREE.RawShaderMaterial => {
|
||||
return get(value, 'isRawShaderMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isShaderMaterial = (value: unknown): value is THREE.ShaderMaterial => {
|
||||
return get(value, 'isShaderMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isShadowMaterial = (value: unknown): value is THREE.ShadowMaterial => {
|
||||
return get(value, 'isShadowMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSpriteMaterial = (value: unknown): value is THREE.SpriteMaterial => {
|
||||
return get(value, 'isSpriteMaterial') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
export * from "./isBox2";
|
||||
export * from "./isBox3";
|
||||
export * from "./isColor";
|
||||
export * from "./isCylindrical";
|
||||
export * from "./isEuler";
|
||||
export * from "./isFrustum";
|
||||
export * from "./isInterpolant";
|
||||
export * from "./isLine3";
|
||||
export * from "./isMatrix3";
|
||||
export * from "./isMatrix4";
|
||||
export * from "./isPlane";
|
||||
export * from "./isQuaternion";
|
||||
export * from "./isRay";
|
||||
export * from "./isSphere";
|
||||
export * from "./isSpherical";
|
||||
export * from "./isSphericalHarmonics3";
|
||||
export * from "./isTriangle";
|
||||
export * from "./isVector2";
|
||||
export * from "./isVector3";
|
||||
export * from "./isVector4";
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isBox2 = (value: unknown): value is THREE.Box2 => {
|
||||
return get(value, 'isBox2') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isBox3 = (value: unknown): value is THREE.Box3 => {
|
||||
return get(value, 'isBox3') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isColor = (value: unknown): value is THREE.Color => {
|
||||
return get(value, 'isColor') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isCylindrical = (value: unknown): value is THREE.Cylindrical => {
|
||||
return get(value, 'isCylindrical') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isEuler = (value: unknown): value is THREE.Euler => {
|
||||
return get(value, 'isEuler') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isFrustum = (value: unknown): value is THREE.Frustum => {
|
||||
return get(value, 'isFrustum') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isInterpolant = (value: unknown): value is THREE.Interpolant => {
|
||||
return get(value, 'isInterpolant') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isLine3 = (value: unknown): value is THREE.Line3 => {
|
||||
return get(value, 'isLine3') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMatrix3 = (value: unknown): value is THREE.Matrix3 => {
|
||||
return get(value, 'isMatrix3') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isMatrix4 = (value: unknown): value is THREE.Matrix4 => {
|
||||
return get(value, 'isMatrix4') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isPlane = (value: unknown): value is THREE.Plane => {
|
||||
return get(value, 'isPlane') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isQuaternion = (value: unknown): value is THREE.Quaternion => {
|
||||
return get(value, 'isQuaternion') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isRay = (value: unknown): value is THREE.Ray => {
|
||||
return get(value, 'isRay') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSphere = (value: unknown): value is THREE.Sphere => {
|
||||
return get(value, 'isSphere') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSpherical = (value: unknown): value is THREE.Spherical => {
|
||||
return get(value, 'isSpherical') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isSphericalHarmonics3 = (value: unknown): value is THREE.SphericalHarmonics3 => {
|
||||
return get(value, 'isSphericalHarmonics3') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isTriangle = (value: unknown): value is THREE.Triangle => {
|
||||
return get(value, 'isTriangle') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isVector2 = (value: unknown): value is THREE.Vector2 => {
|
||||
return get(value, 'isVector2') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get, isNil} from "lodash-es";
|
||||
|
||||
export const isVector3 = (value: unknown | undefined | null): value is THREE.Vector3 => {
|
||||
return !isNil(value) && get(value, 'isVector3') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as THREE from "three/webgpu";
|
||||
import {get} from "lodash-es";
|
||||
|
||||
export const isVector4 = (value: unknown): value is THREE.Vector4 => {
|
||||
return get(value, 'isVector4') === true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
export * from "./isBone";
|
||||
export * from "./isGroup";
|
||||
export * from "./isInstancedMesh";
|
||||
export * from "./isLine";
|
||||
export * from "./isLineLoop";
|
||||
export * from "./isLineSegments";
|
||||
export * from "./isLOD";
|
||||
export * from "./isMesh";
|
||||
export * from "./isPoints";
|
||||
export * from "./isSkeleton";
|
||||
export * from "./isSkinnedMesh";
|
||||
export * from "./isSprite";
|
||||
export * from "./isObject3D";
|
||||
export * from "./isClippingGroup";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user