Vectron Unknown
Registered User
Join date: 12 Nov 2005
Posts: 7
|
11-16-2005 10:14
I suppose this falls under the "dumb question" catagory, but is there a way to get the name of an object under the reticle in mouse look? I mean is there like an "llGetObjectUnderReticle()" or something similar that returns the name of the target in a string? havent found anything in the wiki on it...
if there is: what function?
if there is not: I'm guessing you have to do this with a sensor? if so, can you tell a sensor to look only along a SPECIFIC vector? (ie arc and radius being 0? The wiki says it will perform a 0 meter scan but does not specify that arc and radius of 0 will still result in a scan, so i can set the sensor pos to the appropriate location based on the player cam and set it's forward vector to match?
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
11-16-2005 10:39
Unfortunately, there isn't a function to do this directly. A sensor with a very small sweep angle might do the job, but you'll run into a problem of accuracy. llSensor() on an attachment scans from the avatar's base position, which is calculated from the avatar's hip. This means there'll be a little bit of inaccuracy, like the "parallax error" you get when you try to use a camera with a viewfinder on a subject that's really close.
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
11-16-2005 10:43
I don't have an exact solution, but I think that what you could do with the sensor is, get the coordinates of the "target" from the sensor and get your own coordinates and construct a vector, then transform this vector into a rotation value. then you'd need to compare that rotation with the rotation of your avatar (since it should be rotated around mouse look) if it falls within a certain specified boundary (so that your cross hairs aren't .001 meter wide), have it lock onto that sensored target. if not, have it ignore that target.
|