#Use rigidbody without allowing it to update position
1 messages · Page 1 of 1 (latest)
What do you mean by "my application requires this update to be slightly finer"?
What you're creating isn't actually finer, because collisions aren't checked where you're updating the position
If you wanted finer rigidbody movement, decrease the fixed timestep
@restive hare
I don't understand your first point
Will note, I don't particularly care how accurate the collisions themselves are so long as they do indeed collide.
Decreasing the fixed timestep isn't a particularly viable solution. This is a 2-body gravity simulation with a fixed central body. Because the gravitational pull is only calculated once per fixed timestep, I miss out on the infinite number of acceleration steps in between each position, which means accuracy is lost - especially if the object is moving faster.
I can't record a video right now to demonstrate it, but I can see this by looking at how the orbital parameters change as the object moves. The period for instance should remain constant, but due to inaccuracies it changes slightly - especially as the object accelerates toward the central body.
So, the only part of this I need to be more accurate is the gravitational force on the orbiting object. I can do this by decreasing the timestep, but this has an undesirable negative performance affect. Instead, I've opted to calculate a number ('resolution') of steps between each frame based on the sqrMagnitude of the orbiting objects velocity. (resolution = this.rigidbody.velocity.sqrMagnitude * this.resolutionScale)
This requires I update the position manually in my own timestep, per object.
This allows slow orbiting objects to remain performant whereas fast orbiting objects stay accurate.
Also, I tried to accomplish this mathematically to avoid physics altogether (which is apparently possible) but I couldn't get it to work.
I'm confused. You understand that collision will be relatively low resolution
Also your integrator is crap no offense
use velocity verlet or rk4
yo! I've never heard of that, sounds like exactly what I need lol, thanks
And yeah fully get that, not experimented with it yet but so long as when things hit stuff happens that's all good, doesn't necessarily need to be accurate in this case
What I'm trying to say is that no matter how high resolution you make your position update, collisions will always update at the lower resolution fixed timestep
This might be a obvious suggestion, but did you set the collision updates on your rigidbodies to continuous?
MovePosition