#### Archived

This topic is now archived and is closed to further replies.

# 4D Physics?

This topic is 5080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all, I''ll admit outright that I aint a physics inclined person. Physics and network programming are about the only two areas I try to hide from But I was pondering game physics the other day... Was wondering about collision. So you have a bunch of vertices and planes that makes up a bunch of geometry that you calculate collisions and then responsese. great. But, has anyone ever done ''4D'' collsion - that is, taking in the velocity (the fourth ''d'' being time?) of an object into account? such that, surely its possible to work out given suitable constant speeds its possible to work out in one foul swoop when/where an object collides? Is this already done? Have I just "worked out" something thats bog-standard in middleware physics engines? Just curious really... regards, Jack

##### Share on other sites
What would be the purpose of such a thing?

##### Share on other sites
sounds like using swept volumes for collision.

##### Share on other sites
I hate it when people call time a dimension. it''s a universal mesurement. the only mesurements, are size, time and position, however position can be derived from size.

at anyrate, what you would want to do is find the intersection point between two delta v graphs. the best way to do this is the N dimensional colum major vector method (other wise known as the hard way of solving algebra problems.)

##### Share on other sites
There are a number of situations in which time can be considered a fourth dimension. Relativity comes to mind.

##### Share on other sites
everything measurable and representable with one number, has one dimension. everything measurable and representable with 3 numbers had 3 dimensions.

time is a one-dimensional thing. question is, is it a dimension independent of space, or not? relativity sais no.

there are just that tons of people that try to IMAGINE time as a 4th space-dimension. and this is wrong, of course. you can''t walk in direction of time, or rotate around in it, or such. at least, not in the same way (or you would not recept it in the same way), as in the 3 space dimensions.

If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net

##### Share on other sites
I think collision projections that take time into account are fairly standard, if your using a series of instantaneous checks then you will eventually start getting objects passing through one another etc, you can of course account for this in various ways but projecting through time is a much nicer approach.

I'm not sure whether it is quicker to perfrom the collision tests over time or build a hull to contain the objects movement. For example a sphere moving through time will map to a losenge used in an instantaneous check, however using time you get the advantage of the exact point at which the collision occurs.

[edited by - Rdf on March 26, 2004 12:16:50 PM]

##### Share on other sites
Swept volumes is the closest to 4d(3d+time) collision detection.

If you want to work out 4d space collision detection, please do. It would make a helluva conference paper.

##### Share on other sites
quote:
Original post by davepermen
there are just that tons of people that try to IMAGINE time as a 4th space-dimension. and this is wrong, of course. you can''t walk in direction of time, or rotate around in it, or such. at least, not in the same way (or you would not recept it in the same way), as in the 3 space dimensions.

may i argue, that actually:
1) You "walk" in time always , however only in one direction...
2) you rotate in coordinate axis x time axis plane, each time you start moving relatively to something (transition from/into inertial reference frame, or so-called boost)
of course, 4d physics is different from 3d physics, and the things we really feel are connected with 3 dimensions, but this is only because we never mooved too fast, i presume...

C++ RULEZ!!!

##### Share on other sites
it does''nt matter how fast you move, you can never feel or see a difference in the speed of time. rember that einstien guy? yah, remeber what he said about relitivity, and how time was completly and totaly relative to your point of reference? yah...

##### Share on other sites
mathimactically it is conjectured there are actually exactly 10 dimensions or exactly 16 dimensions with the various groups of supporters for each . but anyways back to 4 dimensions. time as a dimension has its grounds in relativity but philosophically we cant prove that we even exist. arguing about the existence of a 4th dimension temporal or spatial is not helping the original poster.

my idea is this: simply have w,x,y,z and use w as time and use standard collision detection along with the w coord taken into account.

##### Share on other sites
pff 10-16, that was sooooo last year, don''t you know some guy (i forget his name) did some major number crunching, and showed that all the string theroies were all describing basicly the same thing, he then combined them all and created mother(or god) theroy. now htier is 11 dimensions in our super brane, however a infinite number of dimensions in the omni-verse.

##### Share on other sites
so yeah, back on topic, this has been done. you can do really good collision detection utilizing a time variable with something called "interval arithmetic". I read a paper on it, but the math itself was a bit over my head. anyway the point of using the interval arithmetic is that it essentially (if i''m remembering right) breaks down the movement of the object into time intervals. if you work out the magic of the equations correctly you get the precise time when the 2 objects first touched eachother. it was really quite elegant, but like i said a bit over my head.

anyway, most good collision detection takes time into account (swept volumes was mentioned). you find the time when the objects collided and then move them back to that moment and start the collision handling then.

-me

##### Share on other sites
Now, I'm not terribly knowledgeable about physics...

Consider this set of statements, whether they are true or not:
(philosophical/technical/linguistic considerations aside)

Time is just a line in 4-space- the t-axis.

new_pos_vector = loc_function(cur_pos_vector)
Where cur_pos_vector has 4 values,
And new_pos_vector has some [x',y',z',inc_time(t)]

work out the intersections for differing objects having different vector functions.

That should give you good collision.

[edited by - Vlion on March 28, 2004 7:00:30 PM]

##### Share on other sites

But I would just like to point out, that it might be able to be done, but there are two large factors making it sorta pointless.

A)The human mind isn''t really made for grasping such concepts(visually at least) as the nth Dimension. So having someone move around, or notice the collision would be hard.

B)You can only project a 4D space and have it accuratly depicted, in 3D form. StereoScopic sortof works for this, but not fantastically well, so until realtime 3D dispalys comes around, it would be almost impossible to move around correctly. Then add in A, and you have a mess.

But I''m certain that it can be done(not that I know how).

##### Share on other sites
Hi, I think I''ve managed to dig myself a deeper hole than I thought regarding this post sorry for the confusion / stupidity!

Basically, in a more concise way, this is my thinking on "4D physics":

Say we have a small object (say a bullet in a FPS game) traveling at in a given direction [X,Y,Z] and at a known speed.. and you want it to collide with a wall (For example).

Now, my idea being that you calculate, based on the current position, and the line generated by the direction vector, a collision point between the bullet and the wall (simple line-plane intersection). Now based on the speed/velocity you can work out how long it''ll take to travel from current position -> collision position. You then bookmark the Objects "Bullet_1" and "Wall_1" with a collision at a given point in time. On the frame >= to that given time you calculate the result of the collision.

So, instead of just checking every frame for a collision with objects, you can do this check once and provided other geometry does not move (the tricky part) and/or the bullet doesn''t move, then you can calculate collision once and then just ignore it until it happens... or more importantly, know from the ''start'' that it wont happen..

Does that make any sense? Bare in mind, as I said in the OP I''m not a physics programmer, I don''t know if this makes any ''physics'' sense or if it''s been done before

cheers,
Jack

##### Share on other sites
quote:
Original post by jollyjeffers
So, instead of just checking every frame for a collision with objects, you can do this check once and provided other geometry does not move (the tricky part) and/or the bullet doesn''t move, then you can calculate collision once and then just ignore it until it happens... or more importantly, know from the ''start'' that it wont happen..

i think this is the key point...it will probably have limited use in a really robust and dynamic physical simulation. that said, you might be able to work it into a game, where the fps count is the unforgiving master.

##### Share on other sites
ah, got your idea. in principle i think it sounds nice, but in practice you'll end up with bad situations. for instance, say you fire a rocket in some direction. the game draws the line and determines it will hit a wall so you bookmark the collision and just forget about it. a couple frames later, some dumb monster changes direction and moves right into the path of the rocket. since you're no longer looking at it for collision, it passes right through the monster and just hits the wall. the player is pissed. you could solve this by calculating everyones position and max speed and if they couldn't possibly intersect with the bullet, you do the bookmark thing. however the overhead of doing this for every object in the game with every other object in the game is back to an O(N^2) algorithm and you dump any benefit this method would have gained you.

what you can do, is do something like this only for very very fast moving objects. certain bullet types (typically sniper rifles) you can do this with, but only if the collision is near-instantaneous. so the short is, yes people use this method but only in very rare circumstances where the projectile moves fast enough that there is no real possibility of someone moving into the predetermined path.

-me

[edited by - Palidine on March 29, 2004 12:43:10 PM]

##### Share on other sites
If you think about it, its generally alot more sure for the game engine to keep track of which objects the current object WONT collide with for some period of time than it is for the game to keep track of who it thinks that you WILL collide with. If you make your game engine depend on a mostly static and predictable world where predictions made ancient milliseconds ago matter, then it will get very slow and possibly unstable when it is loaded with players and bots doing all sorts of unpredictable events.

Use simple tests to eliminate the total cost of collision testing, but be willing to do costly tests and throw the results away fairly often. Computers are getting faster, be willing to spend the new power to make better physics

Only great minds know that everything they do is there for the pleasure of those who can enjoy the fruits of their labor. Who wants to make a kick-ass game that only you think is cool?

##### Share on other sites
It''s a good idea, but I''m not sure how much of a benefit you will have. The reason why is because the only way I can see you preventing having something interfere with the predicted collision is to create a volume which encompasses the area of movement at any given time, and test for collisions of this volume against other moving volumes - which means in effect that you''re doing the same thing you would do in any collision system.

##### Share on other sites
quote:
it will probably have limited use in a really robust and dynamic physical simulation.

yeah, I see that now... I was thinking it might be possible to have some sort of "nullify" flag, whereby if anything nearby (e.g. the monster) moves then the collision must be re-calculated.

But I can still see that leading to a huge number of combinations, and removing any advantage to doing this in the first place

oh well, maybe next time my clever idea(s) will work

Jack

##### Share on other sites
Personally, I think 4D physics are overused.

They sould remove the 4th dimensions so that the remaining 3D objects just sit there holding still even to the molecular level, and nothing ever changes.