0.0.16 • Published 12 months ago

three-onevent-esm v0.0.16

Weekly downloads
-
License
-
Repository
-
Last release
12 months ago

three-onevent-esm

threejs物体事件捕获绑定

安装

npm i three-onevent-esm

使用

使用前请确保项目已安装three, 本库不内置

import onEvent from "three-onevent-esm"
// 请确保canvasRef或其父元素已设置了宽高
const canvasRef = ref()
new onEvent(scene, camera, canvasRef.value)

// 鼠标点击监听
object3d.on("click", (object3d)=>{
    //...
})

// 鼠标经过监听
object3d.on("hover", (object3d)=>{
    // 进入
}, ()=>{
    // 离开
})

// 凝视监听
object3d.on("gaze", (object3d)=>{
    // 进入
}, ()=>{
    // 离开
})

说明

本库为three-onevent的es版本,具体详情请参见three-onevent

0.0.10

12 months ago

0.0.11

12 months ago

0.0.12

12 months ago

0.0.13

12 months ago

0.0.14

12 months ago

0.0.15

12 months ago

0.0.9

12 months ago

0.0.16

12 months ago

0.0.8

12 months ago

0.0.5

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago