Comments (16)
Can you share an example to reproduce issues with https://glitch.com/~aframe Thanks!
from aframe.
Sure.
https://glitch.com/edit/#!/thorn-dusty-conifer?path=index.html%3A23%3A6
I ve tested. Both the sphere and the model have the same behaviour. I think that just with the VR hands colliding it will work properly.
from aframe.
For some reason I cannot open the glitch
There was an error starting the editor. Maybe try to reload?
from aframe.
Maybe you want to recreate the glitch. I'm getting the same error.
from aframe.
Check in these.
https://jsfiddle.net/Lz2n4mrp/
https://candied-puddle-quilt.glitch.me/
https://glitch.com/edit/#!/candied-puddle-quilt
from aframe.
Looks like a misunderstanding. Recommend reading the docs. Can improve if necessary:
https://aframe.io/docs/1.5.0/components/obb-collider.html
You don't have to call any function manually. Just setup the component in relevant entities.
I see collision events fired as expected:
document.body.addEventListener("obbcollisionstarted", function (e) {
console.log(e.detail.trackedObject3D);
});
The value you have to check is el.detail.withEl
as stated in docs
trackedObject3D is an internal variable that you wouldn't need to check but not sure I'm understanding what you are trying to do. If you can clarify...
from aframe.
On the fiddle, I have called the function manually just to show the behaviour.
You are right that withEl is sent on the emit.
But the main collider should also be sent.
Looking at the obb-collider system the emit has two parameters.
Also, in the docs.
trackedObject3D is explained as:
Variable path to the object3D used to calculate the collider. el.object3D by default
But this default behaviour does not work.
from aframe.
What are you trying to accomplish? Why are you trying to use / access the trackedObject3D
variable?
from aframe.
trackedObject3D
is only used in the rare occasions where you don't want to use the default this.el.object3D
to calculate the collider. I don't think you need it in the presented example.
from aframe.
A simplified version of your glitch: https://glitch.com/edit/#!/phantom-bead-vacation?path=index.html%3A29%3A9
See that obbcollisionstarted
fires as expected in both entities when they collide. You don't need to define trackedObject3D
from aframe.
Also notice you were using <a-sphere>
for the model entity where you should be using <a-entity>
from aframe.
Indeed the component is working as intended.
To correct myself, it is the system that is emitting null.
componentA.el.emit('obbcollisionstarted', {trackedObject3D: componentA.trackedObject3D, withEl: componentB.el});
componentB.el.emit('obbcollisionstarted', {trackedObject3D: componentB.trackedObject3D, withEl: componentA.el});
The system was coded to have both trackedObject3D and withEl in the same emit.
I think, if you have many collisions happening, in one single event you have both entities involved in the collision. This is a good behaviour.
My idea was to increase consistency in the system.
from aframe.
We should probably remove trackedObject3D
from the event details. Probably a vestige and not part of the documented public API
from aframe.
Also notice that trackedObject3D
refers to an object path from the entity object el.path.to.your.object
. In your initial example that path is undefined and hence this.trackedObject3D is undefined as well
from aframe.
But. Inside the hand-tracking-grab-controls component, the onCollisionStarted
method uses this.grabbingObject3D = evt.detail.trackedObject3D;
The usage of trackedObject3D
is probably when you have hands.
from aframe.
Hah.
Reviewing the hand-tracking-grab-controls component it seems this.grabbingObject3D
is not used at all.
So probably we should do as you say, remove in the next revision.
from aframe.
Related Issues (20)
- 2w- HOT 1
- xr-mode-ui: Add explicit full screen mode HOT 8
- Video playback stops when entering immersive mode in Vision Pro HOT 17
- <a-scene> accessing my webcam HOT 4
- Hiding VR mode UI not working in 1.5.0 HOT 2
- a-videosphere: 180 degree support and SBS support. HOT 2
- Component/attribute inheritance and precedence for primitives HOT 5
- ar hit test can only place once,but i need it can place many times HOT 1
- Updating reflection not possible when using postprocessing HOT 2
- Sudden increase in GPU load when using postprocessing HOT 3
- Utils device isIOS and isMobile checks fail on iPad Pro 12.9 Safari HOT 5
- Add documentation for before/after API
- Duplicate pinch events on the Quest Pro HOT 3
- OBB isn't centered (includes proposed fix) HOT 6
- Support for transient input on Vision Pro HOT 1
- a-scene Chrome non-passive violation warnings for touchmove and touchstart event handlers HOT 5
- GLB frosted glass material only marginally affect primitives, doens't affect <a-text> or <a-image> HOT 3
- hand-tracking-controls component detaches children (+fix & ideas) HOT 2
- Loading Insta360 Videos HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aframe.