Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Physical objects can't occupy the same space at the same time, but ...

Enrico Genosse
Registered User
Join date: 11 Jun 2006
Posts: 5
12-07-2006 10:43
I have a problem working around what I think is a Physics Engine bug, and I could sure use some suggestions.

I have the occassion when two moving physical objects target the same location and converge on it. Often when they do, they interpenetrate. (I would expect them to bounce off each other.) Then the sim gets overloaded (time dilation drops dramatically) and sometimes I get knock offline and when I come back I find the two objects locked together with their scripts turned off.

Obviously I can't let this happen!

I've tried using collision events to set the objects non-phys while colliding, or randomly relocate them so they'll separate. But it doesn't seem to work and introduces a whole other set of problems (like if the objects are moving across a floor instead of the ground).

Any ideas?
Damien Took
Meat Popsicle
Join date: 3 Dec 2004
Posts: 151
12-07-2006 11:23
You can use llVolumeDetect when the objects are phantom. It's similar to using collision events when they are physical but at least they can share the same point in space without lagging the sim and causing other problems.
Hope that helps :D
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
12-07-2006 11:24
Presumably you're having this problem using llMoveToTarget? If they were just moving normally they *would* bounce off each other.

You could try having the collision events cancel the llMoveToTarget and cancel their velocity... or you could not use llMoveToTarget at all, just give them an impulse in a direction and then stop them when they get close enough to the target point (you'll probably need a timer to make sure they keep moving towards the target if they get knocked off course).
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
12-07-2006 12:02
It would be easier just to make them phantom than code in anything complicated. They'll just slide right through each other.

Now I have noticed increases in lag when this occurs, but it is no where near as bad as when 2 solid physical objects interpenetrate. (this is assuming that they didn't interpenetrate to the point that physics shut off)
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-07-2006 13:13
I would like to compound the problem with some observations from my A-life:

If there is a spike in lag, two colliding objects can sometimes become "slightly" interpenetrated; this also holds true for object and ground collisions. during this time, if llApplyImpulse is given before the sim shuts off the colliding objects, the resulting movement will visibly much greater than what it should be, resulting in (recorded/observed) speeds of over 50x what would normally be given from the same llApplyImpulse. I do not know of any work around to prevent this, but it may give someone else further insight into the issue.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Enrico Genosse
Registered User
Join date: 11 Jun 2006
Posts: 5
Some good points
12-08-2006 13:39
Thanks to everyone for their responses. You've given me some good information to work with. And thanks, Senuka, for sharing that observation on what happens with llApplyImpulse under similar circumstances. I've observed that behavior as well, but hadn't connected it to the same problem.

I'll try out some of these ideas (and a few more of my own). If I find something that seems to work, I'll post it back here.