This is a trivial problem, which happens only to my stupidity ... but the physics engine that uses the vector Velocity and coordinates, handle weight? Not only has gravity increased which causes all the objects on the screen to grow downward, but there is an increase in gravity around the same point. I have tried to increase gravity when something goes away, but it creates a very unrealistic effect, when a large number of objects are removed.
It depends on the engine, but generally, an object whose "important" Gravity pulls, it will do it It is just another force to add to the equation.
With this problem, if every object is dragged to a gravity on every other object (as is the real thing), the number of calculations will add you the objects in the system Has to be increased by . There are many customizations that many engineers do, try to put it back in control to sacrifice strict realism. Here are some:
- Only "important" objects use a bridge A classic example of this would be to simulate the solar system: the sun should show the bridge, And the planets probably do too, but the spaceship usually does not. Everything is still subject to drag, so now there is a cost to add "negligible" objects (a calculation according to an important object), but it is too short to add important objects (< Em> every object). If you have many negligible things and only some important things, then it saves you a lot of time.
- Objects apply a bridge only to "nearby" objects, and ignore distant people . Thanks to the inverse-square law, the effects of gravity between the two objects are very low because they are far away. After all, it becomes very small that it is safe to ignore it for many purposes, and it actually has many engines: install some cutoff radius, apart from which gravity is ignored between two objects.
- "Close" objects are tilted together, and their gravitational pull is added to deal with "distant objects" This allows you to gravitate between remote objects Leaves some reality except. Let's say that you have two distant galaxies of 100 stars: If every person has pulled a person on all other stars in the system, then you have to calculate 10 ^ 200 for each pair of each ticket. If you combine them into two galaxies, then you need to calculate 20,001 per tick: 10,000 for the galaxy (100 pairs of stars), 10,000 for the galaxy B, and then for the bridge between two galaxies.
No comments:
Post a Comment