|
On the behavior of wandering cats
Recently, I had occasion to observe what happens when a cat finds itself floating in mid-air.
The cat in question has a Home location on a platform at 4000 meters elevation. The platform had been removed. It had a range of only 5 meters.
When the cat was asleep, it was floating at 4000. I watched it wake. It sat a while, rolled over, etc., and remained floating at 4000.
The cat then decided to walk: it began circling the 5-meter radius of it's Range. While it was walking, it slowly circled downwards, akin to walking down an invisible spiral staircase, moving down about 20 meters. There, it decided to sit a moment, and stay floating at that point. Then began spiraling downward when it began walking again.
This continued for most of the next hour: spiral, pause, spiral, pause, ... Until, eventually, the cat landed on the ground. For the next few hours it continued sitting and circling on the ground, until it decided it was time to sleep, again.
At this point, the cat moved in jumps (nearly) straight back up to 4000 meters, where it remains, floating, sleeping, waiting to do it all again in a few hours when it wakes.
This is NOT a bug!
It is a consequence of the fact that, while walking and running, the cat is Physical and, therefore, subject to the force of gravity; but when not walking or running, the cat is Non-Physical.
For this cat, there was no platform. But, for many, there is. And, often, there are also prim walls.
When physical (walking and running) prim walls and floors present a barrier, preventing the cat from falling or walking off the edge.
But cats change from Physical to Non-physical.
When a cat is Non-physical, prim floors and walls have no effect. The cat is not moving and, being non-physical, gravity has no effect either. Visually, the cat is where we expect, apparently sitting on the floor, curled up next to the wall. But this is an illusion. Actually, the cat is floating in space and the fact there are floors and walls is immaterial.
But, while not moving, cats shift and roll. This moves their "root" position around a bit (an invisible box you can see if you Highlight Transparent). Remember, though, the cat is non-physical. So it's possible that the root shifts INSIDE a wall or floor.
If, when the cat decides to walk or run, that root is STILL INSIDE the wall or floor, THAT wall or floor prim becomes non-physical .. but ONLY for the cat! So long as the root stays inside the wall/floor prim, that prim remains non-physical (to the cat, only!). If it's a floor, the cat will begin to spiral downward, as above. If it's a wall, the cat may walk back "inside your house" and all is well; or may walk "outside the house" and, when it stops, then begins walking again, finds that wall is now physical, and blocks the cat's movement.
Many suggest placing additional prims to block your cat. This USUALLY works. But is is NOT guaranteed. Having your cat sit/roll/whatever and move its root INSIDE your main prim does not happen often, but DOES happen. Adding a second, lower, prim does just the same. So, there is always a chance that your cat will wiggle through your floor, then wiggle through your invisible sub-floor. In fact, you could stack up several hundred sub-floors and there is STILL a chance (tiny, but still there) your cat will wiggle through ALL of them!
As a side note: there is no way to completely prevent a cat wiggling into a wall or floor prim. This is a consequence of the floating point arithmetic used to determine location and size. Floating point math is not exact. Except in rare cases, there is some rounding-off error. The size of this error increases with altitude.
Let's use half-digit rounding to "three places of significance" to show how it works.
At 25 meters, a normal ground position, we're actually at 2.50x10^1 (2 and a half, times 10 to the power of 1 .. that is, times 10). So we might specify any number from 24.95 to 25.05 and it will be internally treated as 25.0
At 4000 meters, a common skybox position, we're actually at 4.00x10^3 (4 times 10 to the power 3 .. that is, times 1000). So we might specify any number from 3995 to 4005 and it will be internally treated as 4000
See the problem? On the ground, the error is small (about 5 millimeters) .. but up high it's large (5 meters).
Now, in fact, Second Life does not use only three digits of significance. Internally, it actually uses about 20. But, when editing in the viewer, and in scripts, it's more like 5 or 6.
So we're talking about SMALL errors. But they DO have an effect. On the ground, they're too small to see. But at 4000, you can sometimes actually watch your walls wiggle! Gaps appear and disappear! "Perfectly" aligned walls have jags appear and disappear. This is why working with Nano-prims is so much easier on the ground .. and can even be easier at one corner (near <0,0,0>) than another (near <255,255,0>)!
My point is, even if no scripted position changes ever occur, it is still POSSIBLE for the relative positions and sizes of two prims (in this case, your cat and your floor) to "wiggle" a bit and, if it happens at just the right moment, for just the right amount, the cat can find itself inside a wall or floor prim when it decides to become Physical in preparation to walk.
|