-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: objects blocking pointer event (#388)
* feature: added possibility to mark objects as pointer event blocking * chore: added docs content for pointer event blocking feature * chore: fixed linting problems --------- Co-authored-by: Tino Koch <[email protected]> Co-authored-by: Alvaro Saburido <[email protected]>
- Loading branch information
1 parent
c63ca5c
commit 03ab2e1
Showing
6 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script lang="ts" setup> | ||
import { TresCanvas } from '@tresjs/core' | ||
import { OrbitControls } from '@tresjs/cientos' | ||
const log = (text: string) => { | ||
console.log(text) | ||
} | ||
const boxOneBlocksPointerEvents = ref(false) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<TresCanvas window-size> | ||
<TresPerspectiveCamera :look-at="[0, 4, 0]" /> | ||
<TresMesh | ||
:position="[0, 1, 0]" | ||
:blocks-pointer-events="boxOneBlocksPointerEvents" | ||
> | ||
<TresBoxGeometry :args="[1, 1, 1]" /> | ||
<TresMeshNormalMaterial /> | ||
</TresMesh> | ||
<TresMesh | ||
:position="[-2, 0, -2]" | ||
name="box 2" | ||
@click="log('box 2')" | ||
> | ||
<TresBoxGeometry :args="[1, 1, 1]" /> | ||
<TresMeshNormalMaterial /> | ||
</TresMesh> | ||
<OrbitControls /> | ||
<TresGridHelper /> | ||
<TresAmbientLight :intensity="1" /> | ||
</TresCanvas> | ||
<input | ||
v-model="boxOneBlocksPointerEvents" | ||
type="checkbox" | ||
style="position: fixed; top:10px; left: 10px;" | ||
> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters