Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems integrating aframe-extras, to obtain collisions and player rotation. (nav-mesh or static-body). #193

Closed
deskmath opened this issue May 2, 2020 · 9 comments

Comments

@deskmath
Copy link

deskmath commented May 2, 2020

I am trying to integrate physics in my project, the best option is using nav-mesh but when integrating "movement-controls =" constrainToNavMesh: true "in the player it gives error:
aframe-extras.min.js: 1 Uncaught TypeError: Cannot read property 'object3D' of null
at i. (aframe-extras.min.js: 1)
at i. (aframe-extras.min.js: 1)
at HTMLElement.tick (a-scene.js: 709)
at HTMLElement.render (a-scene.js: 759)
at bind.js: 12
at f (three.js: 24686)
at e (three.js: 15038)

The first option was to integrate static-body but I had to remove the camera from the player and lost the possibility of seeing the player rotate.

Is it possible to integrate aframe-extras within the player? and be able to use physics and have the position and rotation of the player?

@deskmath deskmath changed the title Integrate physics to frame-extras (nav mesh or static-body) Problems integrating aframe-extras, to obtain collisions and player rotation. (nav-mesh or static-body). May 2, 2020
@haydenjameslee
Copy link
Collaborator

I'm not very familiar with aframe-extras unfortunately.

It might help other folks answer this issue if you make a glitch.com example project.

@deskmath
Copy link
Author

deskmath commented May 6, 2020

Hi Hayden ,
I share a simple project with nav mesh aframe-extras and networker in git, the intention is to be able to integrate the rotation into the avatar without error.

https://github.com/deskmath/NavmeshRotationavatar

https://glitch.com/edit/#!/caseta?path=public%2FferiaAvatar01.html%3A1%3A0

I need to put physics in the project and static-body is deprecated, and the nav mesh option is the most recommended, but when integrating it in the movements it produces an error, in this project that I share I have had to separate that part in the player .
I think if that option can be solved it would be great for many projects with its development.

thanks and great work.

@djoksimo
Copy link
Contributor

djoksimo commented Jun 5, 2020

I'm experiencing the same rotation-tracking issue with a-frame extras.

I'm currently looking into a potential solution.

Edit: I did a bit of debugging @haydenjameslee @deskmath, and it doesn't seem like this will be an easy fix. It would be nice to be able to use NAF with a-frame extras 😄

@matroskin87
Copy link

I was able to successfully integrate physical system only with older versions of the a-frame. A-Frame version 0.7.0 and aframe-extras version 3.13.1

@kylebakerio
Copy link
Member

I do know there were breaking changes in how the camera was handled (in regards to rotation) in Aframe 0.8. That may be related.

@vincentfretin
Copy link
Member

This discussion is quite old now and the glitch you shared @deskmath doesn't exist anymore.
Do you have a cameraRig, an entity that is the parent of the camera? This is really needed I think.
Can somebody create a glitch with aframe 1.1.0 and latest aframe-extras and physics (I know aframe-extras has issues with latest threejs included in aframe 1.2.0) with cannon or ammo backend?
Hubs is doing it so there is definitely no issue in networked-aframe. :D

@kylebakerio
Copy link
Member

I use aframe-extras and physics in mine. Unfortunately, A-Frame itself uses a version of THREE that breaks all the physics libraries, but it tentatively worked for me, though I haven't deeply tested this yet. I also wasn't yet using anything to constrain to nav mesh.

However, that in itself shouldn't cause a problem, I think.

I would like to build up an NAF demo that has physics with it as a kind of 'multi-user A-Frame starter kit' down the road.

@vincentfretin
Copy link
Member

If you didn't see it, I started an example with the ammo driver #270 any contributions are welcome.

@vincentfretin
Copy link
Member

I didn't do any project that uses navmesh with aframe-extras movement-controls component, so I can't help with this.
Do you have an error in the console? Maybe aframe-extras current released version is not compatible with aframe 1.3.0? Did you try the master branch https://github.com/n5ro/aframe-extras ?
Does someone that use it have feedback on this?

You may be interested in Ada's simple-navmesh-constraint component as an alternative to aframe-extras movement-controls.
https://github.com/AdaRoseCannon/aframe-xr-boilerplate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants