mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
wip on raycaster changelog
This commit is contained in:
parent
157d918728
commit
1fbbed6380
@ -1,7 +1,31 @@
|
||||
Changelog:
|
||||
## TODO
|
||||
- [X] Document raycaster component
|
||||
- [ ] Document new events/props on Object3D
|
||||
- [ ] Click events on Raycaster
|
||||
- [ ] Click events on Object3D
|
||||
|
||||
## Changelog
|
||||
|
||||
### Raycaster component
|
||||
|
||||
See [here](https://troisjs-instancedcolors.netlify.app/) for an example ([source](https://github.com/SaFrMo/trois-examples/blob/instanced-colors-standalone-demo/src/components/InstancedColors/InstancedColors.vue)).
|
||||
|
||||
```html
|
||||
<Camera>
|
||||
<!-- if the Raycaster is a child of a camera, use that camera as the ray origin -->
|
||||
<Raycaster
|
||||
:onPointerOver="callback that accepts an array of all new intersections, like onMouseEnter"
|
||||
:onPointerLeave="callback that accepts an array of all newly-ended intersections, like onMouseLeave"
|
||||
:onPointerOver="callback that accepts array of all current intersections"
|
||||
|
||||
:onBeforeRender="callback that fires every frame - optional, accepts the created raycaster. setting this property assumes the user is implementing all raycaster functionality and nullifies all other props and built-in functionality."
|
||||
:scene="THREE scene - optional, defaults to current scene"
|
||||
:camera="camera - optional, defaults to parent camera"
|
||||
:intersects="array of objects to check for intersections - optional, casts against all scene children by default"
|
||||
/>
|
||||
</Camera>
|
||||
```
|
||||
|
||||
|
||||
### Deprecations
|
||||
|
||||
|
@ -64,6 +64,8 @@ export default {
|
||||
this.raycasterCamera = parent.camera;
|
||||
parent = parent.$parent;
|
||||
}
|
||||
} else {
|
||||
this.raycasterCamera = this.camera;
|
||||
}
|
||||
|
||||
// add event listeners
|
||||
|
Loading…
Reference in New Issue
Block a user