The schome community

Schome Park Programme => Reflection and forward planning => Topic started by: Doctor Schomer on May 29, 2008, 12:23:55 PM



Title: Physics Phenomenon - Havok4
Post by: Doctor Schomer on May 29, 2008, 12:23:55 PM
bugs in Havok4 have opened it again.

Also, that strange physics phenomenon is due to Havok4, (you know, that one that causes a prim to shoot off wildly)


This topic is splitted from here  (http://www.schome.ac.uk/forum/index.php?topic=2488.30) - Alice


Title: Physics Phenomenon - Havok4
Post by: An¡mus on May 29, 2008, 12:43:41 PM

I've seen that happen quite a bit


Title: Physics Phenomenon - Havok4
Post by: Achilles Schomer on May 29, 2008, 12:53:01 PM
I assume this won't be fixed at any point before saturday so there isn't much schome can do


Title: Physics Phenomenon - Havok4
Post by: Kathy Schomer on May 29, 2008, 01:33:18 PM
bugs in Havok4 have opened it again.

Your information is about two weeks out of date. It was fixed again, and the bugs were completely unrelated to Havok4 in the first place.

I haven't had any experience of objects shooting off, except where they're penetrating eachother. In which case the behaviour is intentional.


Title: Physics Phenomenon - Havok4
Post by: Doctor Schomer on June 06, 2008, 01:25:34 PM
Topper was playing with it; a sphere placed inside two hollowed cubes 'thus generating space between the cubes of a hollow sphere, would shoot off widly. Far enough to throw me a good half a mile! :P


(I really need to stop using imperial and metric, it's getting confusing)


Title: Physics Phenomenon - Havok4
Post by: Marko Schomer on June 06, 2008, 04:11:34 PM
Topper was playing with it; a sphere placed inside two hollowed cubes 'thus generating space between the cubes of a hollow sphere, would shoot off widly. Far enough to throw me a good half a mile! :P


(I really need to stop using imperial and metric, it's getting confusing)

The odd thing is that the forces required to push objects into each other so that they do fly off seem to vary quite a bit- 150m/s seemed to be around the requisite speed in the old physics engine, but only around 50m/s was necessary for lighter cubes.


Title: Physics Phenomenon - Havok4
Post by: Kathy Schomer on June 06, 2008, 06:28:01 PM
The force is, in fact, totally irrelevant to anything. Not to mention that metres per second is not a unit of force.

This is a result of interpenetration - if you can convince a physical object to penetrate something else, you have created a physically impossible scenario in which two objects exist at the some point. The response of the physics engine is to enter an infinite loop trying to work out what's going on. In order to avoid this, a program running in front of the physics engine resolves the issue by basically throwing the penetrating objects in opposite directions really fast. This resolver changed between 1 and 4 - Havok 1 didn't actually have one, so Linden Lab wrote their own that didn't always work, and thus sometimes let sim crashes through anyway. Havok 4 uses a much better one included in Havok 4 (and, indeed, which cannot be disabled by Linden Lab). As such, the behaviour of interpenetrating objects has changed.



Title: Physics Phenomenon - Havok4
Post by: Doctor Schomer on June 06, 2008, 06:31:19 PM
Kathy, what would happen to physical stability of the sim entire should the 'interrupter' stop?


Title: Physics Phenomenon - Havok4
Post by: Kathy Schomer on June 06, 2008, 06:34:47 PM
It'd crash sixty seconds after the next time an object hit another too fast.


Title: Physics Phenomenon - Havok4
Post by: Doctor Schomer on June 06, 2008, 06:41:49 PM
Oh joy!

Another question, could the physics engine be modded to allow for lack of gravity? (I'm thinking a space-sim here)


Title: Physics Phenomenon - Havok4
Post by: Kathy Schomer on June 06, 2008, 06:49:48 PM
I believe so. You can actually make objects that have no gravity acting on them. However, there is no atmosphere, so the end result is that objects tend to end up flying in the same direction forever.


Title: Physics Phenomenon - Havok4
Post by: Explo Schomer on June 06, 2008, 10:27:43 PM
Wouldn't you have to individually add an llSetBuoyancy to each object?


Title: Physics Phenomenon - Havok4
Post by: Kathy Schomer on June 06, 2008, 10:36:54 PM
Basically, yes.

With the upcoming mono runtime, this would have negligible effect on simulator speed. You could just use a HUD to rez objects with the script already inside to make building easier.


Title: Physics Phenomenon - Havok4
Post by: Marko Schomer on June 06, 2008, 10:37:26 PM
The force is, in fact, totally irrelevant to anything. Not to mention that metres per second is not a unit of force.

I referred to forces because that's what I was applying directly to the cubes (or their equivalent, as, as far as I know, instantaneous acceleration is achieved by impulses, which is impossible in RL), and to metres per second because it's simpler to say "around 150m/s" than "an impulse equal to approximately the cube's mass multiplied by around 150". I apologise for being basically incorrect, but I thought it worth it for the simplicity of explanation. It probably wasn't.

In order to avoid this, a program running in front of the physics engine resolves the issue by basically throwing the penetrating objects in opposite directions really fast. This resolver changed between 1 and 4 - Havok 1 didn't actually have one, so Linden Lab wrote their own that didn't always work, and thus sometimes let sim crashes through anyway.

I recognise this, and the testing I've done was on the old physics engine rather than on Havok 4. Because of various other projects, and the fact that data collection began to be rather less interesting than other stuff, I haven't done thorough tests on the current system (though the basic principles seem at first investigation to be similar)


Title: Physics Phenomenon - Havok4
Post by: Kathy Schomer on June 06, 2008, 10:42:17 PM
They're exactly the same - I explained them in that post. The only change is in how it decides what to throw where how fast. With the exception of the so-called "Schome Strange Force" - known to the rest of the world as the "physics simulation resolution limitation". In Havok 1, every object had a space of 0.05m which the physics engine saw as part of the object. So objects couldn't get closer than 0.1m apart.

In Havok 4, the same rules apply - except to spheres. The simulator models every object as a collection of triangles in the approximate shape of the object. In Havok 4, this does not apply to perfect spheres, which are modelled as perfect spheres, and behave accordingly. As a result, they do not have this 0.05m imprecision, and will thus hover exactly 0.05m above other objects, or correctly collide exactly with other perfect spheres.


Title: Physics Phenomenon - Havok4
Post by: Doctor Schomer on June 07, 2008, 12:22:27 PM
....could we have a spherical source of gravity?


Title: Physics Phenomenon - Havok4
Post by: Explo Schomer on June 07, 2008, 01:59:50 PM
Aren't we allowed to have at least some fun calling it the SSF?-we know it's reliant entirely upon pragmatism in the physics engine, but that doesn't mean we can't invent silly names for things. :P


Title: Physics Phenomenon - Havok4
Post by: Marko Schomer on June 07, 2008, 02:01:19 PM
....could we have a spherical source of gravity?

I think the only way to mimic that would be to apply at periodic intervals impulses to all objects which pushes them towards a given point, so an object below the point would be pulled upwards, and one orbitting the point would be pushed in different directions over time, towards the centre of the orbit, so that the approximate effect would be that of gravity. If that's the best way to do it, lag would be high.

They're exactly the same - I explained them in that post. The only change is in how it decides what to throw where how fast.

The precise details of what is thrown, and how fast, were what I was experimenting on, and what I haven't looked into for Havok 4 (I already knew that interpenetration caused objects to fly apart, both from you and from my own tests). Sorry for not explaining this better. As for SSF being a product of the simulator's resolution limit, you've explained this before (for which I am thankful)- I just think that SSF is a nicer name.


Title: Physics Phenomenon - Havok4
Post by: Kathy Schomer on June 07, 2008, 02:49:50 PM
The direction is random (no time to figure out something better), and the speed is vaguely related to the depth of penetration, but largely also random. Happy? :P


Title: Physics Phenomenon - Havok4
Post by: Alice SParker on June 07, 2008, 05:02:27 PM
Thread gone off-topic? Would you like a split?


Title: Physics Phenomenon - Havok4
Post by: Doctor Schomer on June 07, 2008, 08:10:59 PM
A banana split would go down well, thank you, Alice :P


Title: Physics Phenomenon - Havok4
Post by: Marko Schomer on June 08, 2008, 01:56:42 PM
The direction is random (no time to figure out something better), and the speed is vaguely related to the depth of penetration, but largely also random. Happy? :P

Well that's useful. :P. Now I just have to try to work out how SL's random number generators work and use that to construct useful laws.
...
Actually, I think I'll leave it to someone else. :D


Title: Physics Phenomenon - Havok4
Post by: An¡mus on June 08, 2008, 04:22:33 PM
A banana split would go down well, thank you, Alice :P

 :o haven't had a banana split in ageeees, I'm gonna have one today.