[sldev] [ATTN-LL] Physics engine status update?

Dale Mahalko dmahalko at gmail.com
Fri Sep 21 17:28:27 PDT 2007


On 9/20/07, Dale Glass <dale at daleglass.net> wrote:
> Why would it test for collisions on triangles?
>
> Prims are ideal for collision testing. Testing for collisions against a
> mesh which happens to be a sphere would take a lot of processing time,
> while checking against a sphere prim would be near instant in comparison
> since as you KNOW it's a sphere you can do the check against an imaginary
> perfect sphere.
>

SL goes by triangles, and you can test this for yourself. Make a 10m x
10m x 10m sphere, hollow to 95% (lower mass) and then roll it around
on a very slight incline, such as 3 - 5 degrees. It will roll a little
ways and then come to a stop on one of the "flat spots" on the sphere.

This usually drives people like me nuts since I'm trying to build
marble rollercoasters and marble time clocks and other stuff where
things are often precisely balanced and adjusted. A rough marble with
flat spots that stops halfway down the slope screws things up.


You can actually make a sphere "more round" than normal by doing a
little trick I discovered. The sphere seems to use an odd number of
triangles around its circumference, so if you overlay multiple offset
spheres on top of each other and link them, they will form a far more
perfect sphere that rolls much more smoothly.

- Create a sphere, align it on x.000 y.000 z.000 (for easier
alignment) and the euler rotation at 0,0,0.
- copy it and set the copy nearby.
- duplicate the copy an Rotate it to 90,0,0 on the main sphere
- duplicate the copy an Rotate it to 180,0,0 on the main sphere
- duplicate the copy an Rotate it to 270,0,0 on the main sphere
- duplicate the copy an Rotate it to 0,90,0 on the main sphere
- duplicate the copy an Rotate it to 0,180,0 on the main sphere

This forms a cross of six overlapping spheres pointing to -X +X -Y +Y -Z +Z
Select all, Link them and set aside another copy

- duplicate the crossed-copy and rotate it to 45,0,0 on the main six
- duplicate the crossed-copy and rotate it to 45,45,0 on the main six
- duplicate the crossed-copy and rotate it to 45,90,0 on the main six
- duplicate the crossed-copy and rotate it to 45,135,0 on the main six

Now you have 24 overlapping spheres covering the six cardinal
directions plus all points halfway between. Link them all together.

Roll this ulra-sphere around and you will discover it rolls far more
smoothly than any sphere you've ever seen before, because it has been
forced to have a far higher than normal triangle count, making the
collision volume extremely high detail. Even a large sphere with huge
triangles will roll around quite smoothly, and you'll notice it has
almost a perfectly round appearance.

However, since it now has about 300 * 24 triangles the physics
processing load is going to be much higher, and two such ultra-spheres
generally only work against other simple 1-surface flat and round
prims. Two ultra-spheres colliding can lead to Deep Think or object
freezing since the load on the engine is so much higher than normal.


Here I am experimenting with ultra-spheres in my oversize pinball
machine project last year (bigger physics objects usually seem to work
better):

http://img151.imageshack.us/my.php?image=pinballflipperll2.png
http://img152.imageshack.us/my.php?image=pinballballhoppersa2.png
http://img174.imageshack.us/my.php?image=pinballballlauncherig0.png
http://img151.imageshack.us/my.php?image=pinballpopbumpersgy2.png

-Scalar Tardis / Dale Mahalko


More information about the SLDev mailing list