- Home /
Calling Physics Yourself
I would like to basically force Physics calculations to take place multiple times, something (conceptually) like this:
function FixedUpdate() { Time.fixedDeltaTime /= 60; for( i =0;i<60;++i) { //do stuff calculatePhysics(); } }
If the reason is necessary to know, it is because we are running into a tunneling issue with physics when connecting it to the gyro. Basically, there is a rotating object that has its attitude synchronized with the device's gyro. So as you spin the device this object spins onscreen. The rotating object has a collider which can hit other objects in the scene. Unfortunately, if the user tilts the device too quickly, the synchronized rotating object tunnels through the objects it is supposed to collide with. This is I believe due to the fact that we get gyro data slower than the rate physics goes. So frame 1 it is behind the object, frame 2 it is way in front of the object.So I believe the ideal solution is to slerp between the current attitude and the newly reported gyro attitude, then run these intermediary values.
Your answer
Follow this Question
Related Questions
2D 360 degress platformer example needed 0 Answers
How to balance torque on rigidbody induced by addforce 0 Answers
How do I control a box of objects (marbles or dice) with the accelerometer/gyro? 0 Answers
how to capsule cast from within Entities.ForEach job? ECS 1 Answer
Lifting box 2D C# 0 Answers