Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Detecting a collision to a specific side of an object

Robby Lawl
Registered User
Join date: 17 Feb 2007
Posts: 7
06-17-2007 23:37
I've searched the WIKI and the forums and I think I know the answer already but thought I'd ask.

Is there anyway to have a collision start when an object has a specific side hit or contacted.

From what I've read its not an easy thing to do if at all.

Gives the possibility to have different events triggered depending on which side an object is collided with.

Thanks in Advance....
Jacks Sparrow
Registered User
Join date: 17 Aug 2006
Posts: 6
06-17-2007 23:50
Hello,

You can compare the positions of the collided object and the current object.
that will help you identify from which side the object came from.

Best regards
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
06-18-2007 03:02
I made a two-way door that opened the direction you were walking in on collision
what i did was use 3 prims one for door and two invisable one on each side
the one that collided first told me what way to swing door.
you can see them on Dots Diner in Kaili(180,200,26)
-LW
_____________________
L$ is the root of all evil
videos work! thanks SL :)
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
06-18-2007 08:57
From: Robby Lawl
I've searched the WIKI and the forums and I think I know the answer already but thought I'd ask.

Is there anyway to have a collision start when an object has a specific side hit or contacted.

From what I've read its not an easy thing to do if at all.

Gives the possibility to have different events triggered depending on which side an object is collided with.

Thanks in Advance....



you can compare the location of the collision with the rotation/position of what's being hit. and get a relatively accurate side as to which part of the object was collided with.
_____________________
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.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
06-18-2007 09:35
From: Senuka Harbinger
you can compare the location of the collision with the rotation/position of what's being hit. and get a relatively accurate side as to which part of the object was collided with.


I would probably lean more towards the 2 collision prims however, as this detection could be messed up if the AV is moving fast or if the sim is laggy. Actually it would probably be best to test it both ways to find out which way you prefer.
Robby Lawl
Registered User
Join date: 17 Feb 2007
Posts: 7
06-18-2007 13:33
Using the 2 Prim method:

Are you using the 2 Prims as child objects to report to the Parent Object?

Using llMessageLink?

Also wouldn't a collision on any side of a child object send a message to the Parent? How do you control not sending a message on the wrong side of the object? Will overlapping Prims stop the trigger on the 2 overlapped sides?

NOTE: Got it working with DetectPos...as long as the object is square works great, just give the object thickness and I can do an IF statement to the value of the position.

Thanks for the ideas....