mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
updated tools location
This commit is contained in:
parent
e622bedc6d
commit
abbe3d433c
@ -1,7 +1,7 @@
|
||||
import { DoubleSide, Mesh, MeshStandardMaterial, PlaneGeometry } from 'three';
|
||||
import { watch } from 'vue';
|
||||
import Object3D from '../../core/Object3D.js';
|
||||
import { bindProps } from '../../tools.js';
|
||||
import { bindProps } from '../../tools';
|
||||
import LiquidEffect from './LiquidEffect.js';
|
||||
|
||||
export default {
|
||||
|
@ -14,7 +14,7 @@ import Camera from '../../core/PerspectiveCamera.js';
|
||||
import Renderer from '../../core/Renderer.js';
|
||||
import Scene from '../../core/Scene.js';
|
||||
|
||||
import { lerp } from '../../tools.js';
|
||||
import { lerp } from '../../tools';
|
||||
import AnimatedPlane from './AnimatedPlane.js';
|
||||
import useTextures from '../../use/useTextures';
|
||||
|
||||
|
@ -13,7 +13,7 @@ import OrthographicCamera from '../../core/OrthographicCamera.js';
|
||||
import Renderer from '../../core/Renderer.js';
|
||||
import Scene from '../../core/Scene.js';
|
||||
|
||||
import { lerp, lerpv2 } from '../../tools.js';
|
||||
import { lerp, lerpv2 } from '../../tools';
|
||||
import ZoomBlurImage from './ZoomBlurImage.js';
|
||||
import useTextures from '../../use/useTextures.js';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { watch } from 'vue';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools/index.js';
|
||||
|
||||
export default {
|
||||
name: 'Object3D',
|
||||
@ -10,7 +10,9 @@ export default {
|
||||
rotation: { type: Object, default: { x: 0, y: 0, z: 0 } },
|
||||
scale: { type: Object, default: { x: 1, y: 1, z: 1 } },
|
||||
lookAt: { type: Object, default: null },
|
||||
onPointerEnter: { type: Function, default: null }
|
||||
onPointerEnter: { type: Function, default: null },
|
||||
onPointerOver: { type: Function, default: null },
|
||||
onPointerLeave: { type: Function, default: null }
|
||||
},
|
||||
// can't use setup because it will not be used in sub components
|
||||
// setup() {},
|
||||
@ -30,8 +32,8 @@ export default {
|
||||
if (this.lookAt) this.o3d.lookAt(this.lookAt.x, this.lookAt.y, this.lookAt.z);
|
||||
watch(() => this.lookAt, (v) => { this.o3d.lookAt(v.x, v.y, v.z); }, { deep: true });
|
||||
|
||||
if (this.onPointerEnter) {
|
||||
this.three.onBeforeRender(this.raycastEnter)
|
||||
if (this.onPointerEnter || this.onPointerOver || this.onPointerLeave) {
|
||||
this.three.onBeforeRender(this.pointerHandler)
|
||||
}
|
||||
|
||||
// find first viable parent
|
||||
@ -49,7 +51,7 @@ export default {
|
||||
},
|
||||
add(o) { this.o3d.add(o); },
|
||||
remove(o) { this.o3d.remove(o); },
|
||||
raycastEnter() {
|
||||
pointerHandler() {
|
||||
this.three.raycaster.setFromCamera(this.three.mouse, this.three.camera)
|
||||
const intersects = this.three.raycaster.intersectObjects([this.o3d])
|
||||
if (intersects.length) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { OrthographicCamera } from 'three';
|
||||
import { watch } from 'vue';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
import Camera from './Camera.js';
|
||||
|
||||
export default {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { PerspectiveCamera } from 'three';
|
||||
import { watch } from 'vue';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
import Camera from './Camera.js';
|
||||
|
||||
export default {
|
||||
|
@ -3,7 +3,7 @@ import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
|
||||
import { watch } from 'vue';
|
||||
import EffectPass from './EffectPass.js';
|
||||
import TiltShift from '../shaders/TiltShift.js';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
|
||||
export default {
|
||||
extends: EffectPass,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
|
||||
import EffectPass from './EffectPass.js';
|
||||
import ZoomBlur from '../shaders/ZoomBlur.js';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
|
||||
export default {
|
||||
extends: EffectPass,
|
||||
|
@ -8,4 +8,4 @@ export * from './effects/index.js';
|
||||
|
||||
// export * from './components/index.js';
|
||||
|
||||
export * from './tools.js';
|
||||
export * from './tools';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { watch } from 'vue';
|
||||
import Object3D from '../core/Object3D.js';
|
||||
import { bindProp, setFromProp } from '../tools.js';
|
||||
import { bindProp, setFromProp } from '../tools';
|
||||
|
||||
export default {
|
||||
extends: Object3D,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MeshBasicMaterial } from 'three';
|
||||
import { bindProps, propsValues } from '../tools.js';
|
||||
import { bindProps, propsValues } from '../tools';
|
||||
import Material, { wireframeProps } from './Material';
|
||||
|
||||
export default {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MeshLambertMaterial } from 'three';
|
||||
import { bindProps, propsValues } from '../tools.js';
|
||||
import { bindProps, propsValues } from '../tools';
|
||||
import Material, { wireframeProps } from './Material';
|
||||
|
||||
export default {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { MeshMatcapMaterial, TextureLoader } from 'three';
|
||||
// import { watch } from 'vue';
|
||||
import { propsValues, getMatcapUrl } from '../tools.js';
|
||||
import { propsValues, getMatcapUrl } from '../tools';
|
||||
import Material from './Material';
|
||||
|
||||
export default {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { MeshPhongMaterial } from 'three';
|
||||
import { watch } from 'vue';
|
||||
import { bindProps, propsValues } from '../tools.js';
|
||||
import { bindProps, propsValues } from '../tools';
|
||||
import Material, { wireframeProps } from './Material';
|
||||
|
||||
export default {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MeshPhysicalMaterial } from 'three';
|
||||
import { propsValues } from '../tools.js';
|
||||
import { propsValues } from '../tools';
|
||||
import StandardMaterial from './StandardMaterial';
|
||||
|
||||
export default {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ShaderMaterial } from 'three';
|
||||
import { watch } from 'vue';
|
||||
import { propsValues, defaultFragmentShader, defaultVertexShader } from '../tools.js';
|
||||
import { propsValues, defaultFragmentShader, defaultVertexShader } from '../tools';
|
||||
|
||||
export default {
|
||||
inject: ['three', 'mesh'],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { MeshStandardMaterial } from 'three';
|
||||
import { watch } from 'vue';
|
||||
import { bindProp, bindProps, propsValues } from '../tools.js';
|
||||
import { bindProp, bindProps, propsValues } from '../tools';
|
||||
import Material, { wireframeProps } from './Material';
|
||||
|
||||
const props = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ClampToEdgeWrapping, LinearFilter, LinearMipmapLinearFilter, TextureLoader, UVMapping } from 'three';
|
||||
import { watch } from 'vue';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
|
||||
export default {
|
||||
inject: ['material'],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MeshToonMaterial } from 'three';
|
||||
import { bindProps, propsValues } from '../tools.js';
|
||||
import { bindProps, propsValues } from '../tools';
|
||||
import Material, { wireframeProps } from './Material';
|
||||
|
||||
export default {
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
WebGLCubeRenderTarget,
|
||||
} from 'three';
|
||||
import Mesh from './Mesh.js';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
|
||||
export default {
|
||||
extends: Mesh,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { InstancedMesh } from 'three';
|
||||
import Object3D from '../core/Object3D.js';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
|
||||
export default {
|
||||
extends: Object3D,
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
WebGLCubeRenderTarget,
|
||||
} from 'three';
|
||||
import Mesh from './Mesh.js';
|
||||
import { bindProp } from '../tools.js';
|
||||
import { bindProp } from '../tools';
|
||||
|
||||
export default {
|
||||
extends: Mesh,
|
||||
|
Loading…
Reference in New Issue
Block a user