You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2024. It is now read-only.
I'm currently attempting to make an ammo-shape follow the location of a player's head to properly position/adjust a capsule body collider for VR. When I set the values of the offset or halfExtents it doesn't affect the collider at all, which I can see with debug draw on. But if I log the values of either, they come back with the values I expect.
Full demo here: https://glitch.com/~aframe-vr-character-controller I'm at a bit of a loss on what could be causing this. If I'm somehow misunderstanding something or more information is needed, just let me know.
The text was updated successfully, but these errors were encountered:
Okay I don't know the answer (yet) but my first instinct would be to try using a constraint like the "target" property to point the ammo-shape at the camera or player's head. That constraint or property seems to create a visual binding between two entities, which you can see in the Aframe Physics Examples.
Revisiting this one after a little bit. I tried using a constraint but it had no visible effect, and I'm not sure it would have worked to begin with given that the head is a child object of the body. All I've been able to determine is that the offsets/half-extents seem to update exactly once, and no matter what I try to modify the debug drawer shows that there's been no change. I even tried accessing the localTransform of the collisionShape and setting the origin from there, but still nothing.
EDIT:
I think I've figured out what the problem is. I don't think you're able to update the btCollisionShape you get from your three-to-ammo conversion during runtime; it only sets the offset/halfExtents when it's initialized. I tested this by removing and readding the ammo-shape component with updated values every tick, and the collider is finally behaving as expected. Code for reference:
I'm currently attempting to make an ammo-shape follow the location of a player's head to properly position/adjust a capsule body collider for VR. When I set the values of the offset or halfExtents it doesn't affect the collider at all, which I can see with debug draw on. But if I log the values of either, they come back with the values I expect.
Relevant code:
Full demo here: https://glitch.com/~aframe-vr-character-controller I'm at a bit of a loss on what could be causing this. If I'm somehow misunderstanding something or more information is needed, just let me know.
The text was updated successfully, but these errors were encountered: