Giter Site home page Giter Site logo

Comments (16)

dmarcos avatar dmarcos commented on May 20, 2024

Can you share an example to reproduce issues with https://glitch.com/~aframe Thanks!

from aframe.

shabarito avatar shabarito commented on May 20, 2024

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.

dmarcos avatar dmarcos commented on May 20, 2024

For some reason I cannot open the glitch

There was an error starting the editor. Maybe try to reload?

from aframe.

dmarcos avatar dmarcos commented on May 20, 2024

Maybe you want to recreate the glitch. I'm getting the same error.

from aframe.

shabarito avatar shabarito commented on May 20, 2024

Check in these.

https://jsfiddle.net/Lz2n4mrp/
https://candied-puddle-quilt.glitch.me/
https://glitch.com/edit/#!/candied-puddle-quilt

from aframe.

dmarcos avatar dmarcos commented on May 20, 2024

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.

shabarito avatar shabarito commented on May 20, 2024

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.

dmarcos avatar dmarcos commented on May 20, 2024

What are you trying to accomplish? Why are you trying to use / access the trackedObject3D variable?

from aframe.

dmarcos avatar dmarcos commented on May 20, 2024

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.

dmarcos avatar dmarcos commented on May 20, 2024

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.

dmarcos avatar dmarcos commented on May 20, 2024

Also notice you were using <a-sphere> for the model entity where you should be using <a-entity>

from aframe.

shabarito avatar shabarito commented on May 20, 2024

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.

dmarcos avatar dmarcos commented on May 20, 2024

We should probably remove trackedObject3D from the event details. Probably a vestige and not part of the documented public API

from aframe.

dmarcos avatar dmarcos commented on May 20, 2024

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.

shabarito avatar shabarito commented on May 20, 2024

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.

shabarito avatar shabarito commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.