I'm making an A-Frame project which will allow users to interact with math models. I'm using the aframe-super-hands-component
with aframe-physics-extras
for its nice "sleep" effect. To add a layer of control, I'm trying to make it so that the user can use a controller's joysticks to bring a model closer/farther away from the controller, similar to the Oculus Dash controls (https://youtu.be/sMjlM5vFSA0?t=1m55s).
However, when I try to update a model's position, as my model entities are defined as dynamic bodies, they don't move. I know that I can remove the dynamic-body
component, move the body, and then reattach dynamic-body
, but I want to avoid that as I'm planning to move models in tick
. Is there a way I can move a dynamic body without breaking dynamic-body
behavior?
Here's a link to an example which tries to update a box's position: https://codepen.io/kchen1250/pen/MBmRYo
You can sync the position of the entity and the dynamic-body
using the dynamic-body
s method syncToPhysics()
el.components["dynamic-body"].syncToPhysics()
like i did here.
syncFromPhysics()
if you'd ever need it.