Detecting Mouselook
|
|
Mist Hydraconis
Registered User
Join date: 5 May 2009
Posts: 16
|
06-07-2009 16:29
I have created a little sprite that follows me around and goes to ppl when commanded.... etc
I want to teach this sprite to detect if someone has me targeted with Mouselook. Is this possible? Anyone willing to point me in the right direction?
Thanks in advance, Mist Hydraconis
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-07-2009 18:05
not within LSL, no
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
06-07-2009 18:20
llGetAgentInfo has AGENT_MOUSELOOK
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
06-07-2009 18:29
What Day said, plus some checks to see how close their rotation is to the one that represents the directional vector from their position to you.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
06-07-2009 18:34
From: Day Oh llGetAgentInfo has AGENT_MOUSELOOK That's only part of the challenge, though. You can tell whether the agent is in mouselook, but you can't tell what s/he is mouselooking at. Another partway solution ..... you can enable Show Look At in the Advanced >> Character menu to see what you and others are looking at, but I doubt that there's a way for a script to pick up that information.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
06-07-2009 18:39
From: Rolig Loon That's only part of the challenge, though. You can tell whether the agent is in mouselook, but you can't tell what s/he is mouselooking at. YES YOU CANNNNNNNNNN! You guys need to do some research before answering. 
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
06-07-2009 19:03
From: Tyken Hightower What Day said, plus some checks to see how close their rotation is to the one that represents the directional vector from their position to you. That's clever. The trick is figuring out "how close" you are to knowing that the other person is actually looking at you and not over your shoulder at something in the distance. Nice, though. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-07-2009 19:04
From: Tyken Hightower YES YOU CANNNNNNNNNN! You guys need to do some research before answering.  within LSL.... uhm no. not unless I've seriously missed some basic function. you can tell if they are in mouselook, and you can even take a stab at guessing if their rotation is facing you (which is has a HIGH error margin thanks to the body rotation being a bit fuzzy, and trailing behind the soft head view), but you can't get whether or not they're actually looking directly at you, and the difference for angle when looking up or down between elevations is even more absurd since IIRC only z rotation is returned unless they are sitting on an object which is applying a rotation. and we won't even get into intervening terrain/objects/otherAvs...
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
06-07-2009 19:04
From: Rolig Loon That's clever. The trick is figuring out "how close" you are to knowing that the other person is actually looking at you and not over your shoulder at something in the distance. Nice, though.  Well, if they're aiming within a certain amount of degrees of your avatar, they're going to hit you with a projectile or whatnot regardless of whether they're actually aiming behind you.
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
06-07-2009 19:07
From: Void Singer within LSL.... uhm no. not unless I've seriously missed some basic function.
is even more absurd since IIRC only z rotation is returned unless they are sitting on an object which is applying a rotation Try this out yourself, minus the sitting part.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
06-07-2009 19:15
From: Tyken Hightower Well, if they're aiming within a certain amount of degrees of your avatar, they're going to hit you with a projectile or whatnot regardless of whether they're actually aiming behind you. Nobody said anything about hitting me with a projectile. I thought the question was about whether you could tell that I was looking at you in mouselook. The answer seems to be, "Well, I can tell you're looking in my general direction." That's a pretty neat answer -- I like it  -- but if you're going to be shooting at me, I hope you have a better reason than "Ma! I think he's looking at me!"
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
06-07-2009 19:15
If you couldn't do this, I think they wouldn't be able to aim a projectile at you in the first place P:
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-07-2009 19:26
From: Tyken Hightower Try this out yourself, minus the sitting part. even minus the elevation issue (used to be issue?) the other issues remain, and your 'few degrees" are magnified with distance (at 5m, no big deal, at 50m you're talking about being off by over 2.5m for only a 3deg difference). now I'm guessing that the soft head rotation is ignored in mouselook but that still leaves the fuzzy difference between server and viewer, which I'm pretty sure is more than 3deg. like I said, you can guesstimate, but you'll either have lots of false positives, or lots of false negatives in a casual environment (in a combat environment false positives are often considered a bonus, especially if you're on your own otherwise it's the old adage: friendly fire, isn't) From: Day Oh If you couldn't do this, I think they wouldn't be able to aim a projectile at you in the first place P: the problem is the server isn't using the same data available to scripts to calculate that firing.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
06-07-2009 19:29
From: Void Singer even minus the elevation issue (used to be issue?) the other issues remain, and your 'few degrees" are magnified with distance (at 5m, no big deal, at 50m you're talking about being off by over 2.5m for only a 3deg difference).
now I'm guessing that the soft head rotation is ignored in mouselook but that still leaves the fuzzy difference between server and viewer, which I'm pretty sure is more than 3deg.
like I said, you can guesstimate, but you'll either have lots of false positives, or lots of false negatives in a casual environment (in a combat environment false positives are often considered a bonus, especially if you're on your own otherwise it's the old adage: friendly fire, isn't) There are HUDs that already do this feature accurately. It's not terribly difficult. In mouselook, the rotation returned by llGetObjectDetails is actually exact, and not as lagged as you think. Factoring distance in is relatively simple as well; just compare the distance from your point location to their line of sight instead of the angle.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-07-2009 19:45
From: Tyken Hightower In mouselook, the rotation returned by llGetObjectDetails is actually exact, well I guess I learn something new each day.=) is it accurate across detected calls for mouselook as well? that would reduce the problem to intervening object false positives, which is certainly bearable for combat, not so much for social, but potentially correctable (narrow beam sensor fired back along the LoS to get the nearest intervening object, might lose some finesse in extremity targeting though (head/feet))
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|