fernandojsg / aframe-teleport-controls

A-Frame teleport controls component
https://fernandojsg.github.io/aframe-teleport-controls
MIT License
174 stars 72 forks source link

isValidNormalsAngle should apply mesh rotation before checking angle #49

Open vincentfretin opened 6 years ago

vincentfretin commented 6 years ago

This is a follow-up on https://github.com/feiss/aframe-environment-component/pull/21#issuecomment-335930480

It is currently not possible to teleport on generated ground (which is a THREE.PlaneGeometry with mesh rotated to -90 0 0), dressing, and cubes with the following parameters collisionEntities: .environmentGround, .environmentDressing, .cube. If you use landingNormal: 0 0 1, this fixes teleporting on ground, but for dressing and cubes, it will not work anymore.

I don't know how feasible it is, but I think isValidNormalsAngle should check the normal of the intersected object with the mesh rotation applied.

vincentfretin commented 6 years ago

Currently in my project, I edit isValidNormalsAngle function to just return true. Maybe we should add an option to disable the angle check? I'd prefer we find a good fix though.

vincentfretin commented 6 years ago

There is already such an option actually! It's landingMaxAngle: 360. I can use landingMaxAngle: 135 it works well enough. I can teleport on horizontal and vertical planes, but not say below a mushroom.