Forum Discussion
BaseDeltaZero
12 years agoHonored Guest
Look Flight Mechanics
Maybe someone clever can shed some light on how to implement something im wanting to test.
I have a Rigidbody with a nice force based flight script using the controller, say if i want it to switch over to a look based flight, how would i alter my script to apply relative torque based on moving my head?
here is what i have working with the controller
rigidbody.AddRelativeTorque(pitch*PitchSensitivity*Time.deltaTime
Cheers
I have a Rigidbody with a nice force based flight script using the controller, say if i want it to switch over to a look based flight, how would i alter my script to apply relative torque based on moving my head?
here is what i have working with the controller
rigidbody.AddRelativeTorque(pitch*PitchSensitivity*Time.deltaTime
Cheers
4 Replies
Replies have been turned off for this discussion
- daatgamingHonored GuestFigure out if the camera is pointing in the same direction as the plane, and if not, figure out the angles. Use those to calculate how much torque should be applied to the plane, and use those floats in AddRelativeTorque(float x, float y, float z). That way the amount of torque increases when you move your head further away (If you're faster than the torque that is applied), and it max out at 90 degrees or something.
- BaseDeltaZeroHonored GuestI understand the theory of what needs to be done, was hoping someone could help me express that in javascript.
thanks anyway - moltonExplorerIn C#
Quaternion head_tilt = Quaternion.identity;
OVRDevice.GetOrientation(0, ref head_tilt);
head_tilt.ToAngleAxis(out head_tilt_angle, out head_tilt_vector);
out head_tilt_angle is a float i think, out head_tilt_vector is vector3 data, I think out head_tilt_vector.x is good head tilt info, print out the results when you tilt your head to see what you're working with.
then just use head_tilt_vector values to determine head movement and apply those values to your torque function I guess. - BaseDeltaZeroHonored GuestThanks, its all sorted now
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 7 months ago
- 1 month ago
- 9 months ago
- 5 years ago