Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-01-2005 00:00
Hi,
I'm using llVolumeDetect to trigger my scripts when someone/something passes through a window.
My question is how can I tell a) which direction (which side of the window) they came from & b) whether they passed right through - as opposed to going 1/2 way through then going back out the way they came
Tks
|
Luc Aubret
Oreo-eater
Join date: 14 Sep 2005
Posts: 86
|
12-01-2005 00:17
What I would do in your instance is use the collision_start event triggered in llVolumeDetect to obtain an llDetectedPos(0), and the collision_end to do the same. Since collision_start is triggered when the object begins interpenetrating the volume detected prim, and ends when the object ceases to interpenetrate it, you can determine roughly (allow for some minor script delay, depending on how fast the offending object is moving) where the object was when it hit the window, and where it was when it exited. Using the position and rotation of the window itself, you can use this information to tell which side of the window was hit, and whether or not the object made it through to the other side. Keep in mind that thicker windows will serve you better in this instance, as a thinner prim will return less differentiated values between the two positions and make it harder to determine precisely what happened to the window. Either way, it's going to take some clever tweaking, I'd imagine, to get an accurate picture of what happened.
I must confess some intrigue as to what you plan to do with this information. I'm assuming you plan to either make the window solid on impact (using llVolumeDetect(FALSE)), or else to push the offending object on collision; otherwise, there's no reason why an object would not go straight through the phantomed window. In this case, it would make more sense to simply make a solid window, as the object is stationary and needs no phantom state. So my curiosity is raised a bit. Perhaps, however, I'm misunderstanding your use of the word window as a literal window when you meant something else entirely.
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-01-2005 01:46
Thanks - I was wondering if it would come to that.
I guess I really wanted a sure fire way to tell that someone/something actually went through the window precisely. I thought a few days back when I looked up the sensor functions it was not going to possible to do this precisely (perhaps I need to double check?)
|
Luc Aubret
Oreo-eater
Join date: 14 Sep 2005
Posts: 86
|
12-01-2005 07:58
Read my above posting again. I have no idea what the hell I was rambling on about when I wrote it, so I've edited it. You can use just llVolumeDetect, though I can't make any guarantees on how accurate it will be.
You could also use two invisible llVolumeDetect prims if the window is too thin to work properly - one thick one outside the window and one thick one inside the window, each taking an llDetectedPos from a collision. Big honking volume detects won't bother anything - you won't even know they're there as long as you don't put anything other than info gathering in the collision events.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
12-01-2005 09:27
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-01-2005 14:03
From: Eloise Pasteur Why not llDetectedVel()?
As someone can pass 1/2 way through the window, wait, then go back in the same way, I imagine this would not be foolproof. i.e. want to know that someone passed from one side to the other for sure. Luc's idea seems the best so far, OR perhaps using llDetectedVel triggered both on (a) entry to into the window and then (b) leaving it. i.e. then if you were going in one direction and left in teh same direction that should be pretty sound I would imagine. This would also mean you only need one window, not 2 close together. comments?
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-01-2005 20:07
PS. Also wondering if it's possible to make a completely invisible window - when I create a flat disk and mark as transparent (only goes up to 90%) you can still kind of see it.
Is there a way to make it totally invisible?
This would be useful when trying to tell when an objected passed through an opening (as opposed to a glass window).
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
12-01-2005 20:10
llSetAlpha(0.0, ALL_SIDES);
The edit window only lets you get to 90% transparency, with a script you can go all the way to 100%.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
12-01-2005 23:44
You can also get the various completely clear textures, or make one of your own, and apply it to the object.
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-02-2005 16:29
Having played more, r.e. a way to confirm someone passed through a window/opening: Using 2 panes does work, however you really need to maintain some state per user, i.e. information re which pane the user started passingn through. At least whilst they are in transit. What perhaps would be better is the one pane (i.e. llVolumeDetect object) only case and then use comparison of relative velocity (as was suggested). Does anyone have a set of functions to help perform relative angular velocity calculations. In this case what I really want is the relative velocity of the object passing through a flattened cylinder (i.e. looks like a circle), relative to the main axis of the cylinder? ACTUALLY I'VE BROKEN THIS OUT TO A NEW THREAD AT: /54/e2/75033/1.html
|