Project5
30-04-2006 16:10:05
I ran into a quandry, and figured that someone on here would know more than me about this sort of thing
I'm running a network simulation, and use client prediction for each client. So each client has a Newton simulation running for the objects immediately around that player. The trouble is that each player is in a different location, and so has their Newton world centered in a different place than all other clients.
This trouble happens when one client gets a network update for an object to move outside that client's Newton world. The system will place the object there, and Newton will tell me that it left the world, and then not move it any more.
This has the result that distant objects seem to lurch across the client's field of view instead of moving smoothly, much as expected when objects leave Newton's world and go to sleep.
Assuming that I cannot increace Newton's world size due to processing power limitations, I tried moving the objects myself using simple euler integration and ignoring collisions, thinking that future network updates would correct from collisions I wasn't calculating, and even if it was incorrect, smooth non colliding motion looks less jarring than correct colliding motion at long distances.
Which brings me to the integration and my question. Thanks for staying with me so far
Integrating linear movement is easy, I just keep track of what forces / impulses should be applied to a newton object and apply them myself.
Rotation has me a bit stumped. First, in what order are the values in Omega applied? My idea was to construct a rotation matrix or quaternion based on each of the x,y,and z values in Omega, multiply them by time, and add it to the current orientation. But combining rotations yields different results depending on what order they're applied. Does anyone know in what order Newton applies the rotations given in Omega?
Secondly, is the inertia vector normalized? i.e. do I need to multiply it by mass before using it?
Anything else I should be aware of?
--Ben
I'm running a network simulation, and use client prediction for each client. So each client has a Newton simulation running for the objects immediately around that player. The trouble is that each player is in a different location, and so has their Newton world centered in a different place than all other clients.
This trouble happens when one client gets a network update for an object to move outside that client's Newton world. The system will place the object there, and Newton will tell me that it left the world, and then not move it any more.
This has the result that distant objects seem to lurch across the client's field of view instead of moving smoothly, much as expected when objects leave Newton's world and go to sleep.
Assuming that I cannot increace Newton's world size due to processing power limitations, I tried moving the objects myself using simple euler integration and ignoring collisions, thinking that future network updates would correct from collisions I wasn't calculating, and even if it was incorrect, smooth non colliding motion looks less jarring than correct colliding motion at long distances.
Which brings me to the integration and my question. Thanks for staying with me so far
Integrating linear movement is easy, I just keep track of what forces / impulses should be applied to a newton object and apply them myself.
Rotation has me a bit stumped. First, in what order are the values in Omega applied? My idea was to construct a rotation matrix or quaternion based on each of the x,y,and z values in Omega, multiply them by time, and add it to the current orientation. But combining rotations yields different results depending on what order they're applied. Does anyone know in what order Newton applies the rotations given in Omega?
Secondly, is the inertia vector normalized? i.e. do I need to multiply it by mass before using it?
Anything else I should be aware of?
--Ben