Sensors are driving me loopy
|
|
Eata Kitty
Registered User
Join date: 21 Jan 2005
Posts: 387
|
06-23-2006 03:30
I've been experimenting with a moving nonphysical sensor and I'm having trouble getting the sensor cone to be the right size. As it uses llSetPos it's moving in 10M jumps, I don't want it to miss anything so it has to have quite a long sensor range. It's meant to only detect things directly in front of it so I've been trying a sensor arc of PI/4, this still seems to be far too large, I've gradually been increasing this to PI/10 but it still seems to be very big.
Suggestions? I'm considering moving to smaller sensor range with shorter movement hops but this slows it down a lot and will require a lot more sensor calls.
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
06-23-2006 06:30
From: Eata Kitty I've been trying a sensor arc of PI/4, this still seems to be far too large, I've gradually been increasing this to PI/10 but it still seems to be very big. PI/10 is 36 degree cone, so would say that's pretty narrow... means ~6 m across at 10 m distance, or ~3 m at 5 m ahead. That said, for detecting things _really_ just in front of your sensor, a very narrow prim sticking out in front with llVolumeDetect applied could work better, maybe? o.O;
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
06-23-2006 07:04
The angle across the cone will actually be 72 degrees... the angle in the scan represents the angle from the forward axis, so a scan of PI covers a globe. (Sorry if that was what you meant.) EDIT: This is not true
The trouble with really narrow scans is that you can quite easily miss the centre of an object even if you would otherwise bump into it. If you want to use sensors, you can do a wider scan and then work out whether the detected object is actually in front of your scanner using some stuff with llDetectedPos and llGetRot and so on... you could also fire out an invisible full buoyancy projectile that shouts an alert if it hits something (and then dies). That actually works better IME if you want to detect potential collisions.
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
06-23-2006 07:14
From: Ordinal Malaprop The angle across the cone will actually be 72 degrees... the angle in the scan represents the angle from the forward axis, so a scan of PI covers a globe. (Sorry if that was what you meant.) But since PI actually covers full 360 degree, then PI/10 the OP uses would cover 1/10th of that i.e. 36 degree... wouldn't it? ^^;;
|
|
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
|
06-23-2006 07:15
Actually PI / 10 radians is 18 degrees, which gives a 36 degree cone in total...  What sensor range are you using? and how big is your object? If it is a 0.5m cube, then a 6m scan at 10m range really is a huge area to check. It may be worth considering something like a particle effect, with the radius set to your sensor range, and the angle set the same as your sensor, so you get a nice clear visualisation of the area that your sensor is sweeping.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
06-23-2006 07:19
er, yes, ignore that bit, I'm talking rubbish again  but the sensor projectile thing works, honest it does
|
|
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
|
06-23-2006 07:21
Wouldn't linking on an llVolumeDetect()ed prim make the whole object phantom though?
|
|
Eata Kitty
Registered User
Join date: 21 Jan 2005
Posts: 387
|
06-23-2006 07:22
The target is avatars,, so they are somewhat large. I really don't want to scan a very large area, just what is pretty much directly in front (Say 0.5M to either side). PI /10 sounds like it should be right but doesn't seem to work.
The particle idea sounds like a good suggestion, I'm going to try that and see what shape it makes.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
06-23-2006 07:22
From: someone Wouldn't linking on an llVolumeDetect()ed prim make the whole object phantom though? It would, and if I remember rightly, if you setpos a volume detect onto something else, it doesn't trigger the collision event... at least, when I tried using a setposing volume detect for my sensor gun it just ignored everything it passed through. *crosses fingers that that's not rubbish as well*
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
06-23-2006 08:07
From: Ordinal Malaprop It would, and if I remember rightly, if you setpos a volume detect onto something else, it doesn't trigger the collision event... at least, when I tried using a setposing volume detect for my sensor gun it just ignored everything it passed through.
*crosses fingers that that's not rubbish as well* I've not tested it recently, but that's certainly my experience of it. There isn't a "collision" because the object moves and happens to now be intersecting with something, rather than something "walking" into it is how I remember it. (Or collisions get fired by the surface if you prefer, not the whole prim.)
|