VR - spinning a globe
Posted: Fri Jul 28, 2017 5:35 am
I'm mucking around in VR right now. In my world, I have a btRigidBody collision box representing my hand, and under kinematic control from the VR Device (setting position and rotation).
I also have a world globe (like those table top globes of the earth) that I want to be able to touch and spin.
The globe is constructed as a btRigidBody collision sphere, and is not kinematic. I also have the LinearFactor set to 0,0,0 to prevent it from moving. Angular factor is still 1,1,1.
I want to reach out and 'grab' the globe (using the controller, and check the button state to see if we're 'grabbing') - and *do something* to make the globe turn as I drag the controller across the surface.
I am unsure what that *do something* looks like. It's not an impulse or a force... it's almost as if I want to take the linear velocity of the controller and somehow apply that to the rotation of the globe -- but I don't know how to do that, or if that's the right approach. I did consider setting up a 6-dof constraint between the controller and the globe, but I don't think that will have the effect that I want (like if I try and flick/spin across the surface of the globe)
Any suggestions?
I also have a world globe (like those table top globes of the earth) that I want to be able to touch and spin.
The globe is constructed as a btRigidBody collision sphere, and is not kinematic. I also have the LinearFactor set to 0,0,0 to prevent it from moving. Angular factor is still 1,1,1.
I want to reach out and 'grab' the globe (using the controller, and check the button state to see if we're 'grabbing') - and *do something* to make the globe turn as I drag the controller across the surface.
I am unsure what that *do something* looks like. It's not an impulse or a force... it's almost as if I want to take the linear velocity of the controller and somehow apply that to the rotation of the globe -- but I don't know how to do that, or if that's the right approach. I did consider setting up a 6-dof constraint between the controller and the globe, but I don't think that will have the effect that I want (like if I try and flick/spin across the surface of the globe)
Any suggestions?