Jump to content

How does the Sim know my Camera's Location?


Extrude Ragu
 Share

You are about to reply to a thread that has been inactive for 786 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I've been working on a simple script to compliment an RLV setup that checks if the user has alt-cammed further than a certain distance from the owner.

I notice that llGetCameraPos will return my camera's position, even when 'Look at targets' are turned off.

What I wonder about is the guts of the viewer-simulator relationship. Does the simulator require the viewer to tell the sim where the Camera is, in order to receive information/updates about objects near the camera?

IE. I'm trying to figure out if in theory it would be possible for a user to 'cheat' a system that relies on detecting the camera position, by  getting the viewer to lie about their true camera position to the simulator, whilst still viewing objects and avatars far off in the distance.

Link to comment
Share on other sites

2 hours ago, Extrude Ragu said:

I'm trying to figure out if in theory it would be possible for a user to 'cheat' a system that relies on detecting the camera position, by  getting the viewer to lie about their true camera position to the simulator, whilst still viewing objects and avatars far off in the distance.

It's possible, though unlikely.

The specific packet/message from the viewer is AgentUpdate, which contains the camera position and orientation:

{
    AgentUpdate High 4 NotTrusted Zerocoded
    {
        AgentData           Single
        {   AgentID         LLUUID          }
        {   SessionID       LLUUID          }
        {   BodyRotation    LLQuaternion    }
        {   HeadRotation    LLQuaternion    }
        {   State           U8              }
        {   CameraCenter    LLVector3       }
        {   CameraAtAxis    LLVector3       }
        {   CameraLeftAxis  LLVector3       }
        {   CameraUpAxis    LLVector3       }
        {   Far             F32             }
        {   ControlFlags    U32             }
        {   Flags           U8              }
    }
}

This is almost definitely what llGetCameraPosition relies on.

 

2 hours ago, Extrude Ragu said:

Does the simulator require the viewer to tell the sim where the Camera is, in order to receive information/updates about objects near the camera?

It does. The simulator sends the viewer a so-called Interest List of objects.

Edit: Actually, since the 360 screenshots became a thing, there's now a way for a viewer to request all objects rather than a camera-based list.

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Extrude Ragu said:

Does the simulator require the viewer to tell the sim where the Camera is, in order to receive information/updates about objects near the camera?

Yes.

The simulator also updates the camera position in relation to physical objects such as walls. As with everything in SL, if in doubt  .. it's server side.

  • Like 3
Link to comment
Share on other sites

5 hours ago, Extrude Ragu said:

RLV setup that checks if the user has alt-cammed further than a certain distance from the owner.

I'll just point out that there are specific RLV commands that prevent the user from doing exactly that. I'd recommend using them rather than ex. blinding the user when they don't obey.

Quote
  • Allow/prevent moving the camera too far from the avatar : "@camdistmax:<max_distance>=<y/n>"

Implemented in v2.9

When active, this restriction prevents the user from moving the camera too far from the avatar, either with the mouse wheel or when focusing with the Alt key. If <max_distance> is set to 0, this command forces the avatar to stay in Mouselook. If several objects issue this restriction, the viewer retains the smallest value of all. This does not impact scripts that move the camera themselves, though.

https://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI

of course, the user ~could cheat by using a scripted object to set their camera position, but my philosophy with RLV is just to make it fun. Trust people to enguage with your stuff in the way that's most fun for them. If someone realizes they're able to cheat and does so, then has less fun, that's generally on them, not the script.

Link to comment
Share on other sites

2 hours ago, Quistess Alpha said:

I'll just point out that there are specific RLV commands that prevent the user from doing exactly that. I'd recommend using them rather than ex. blinding the user when they don't obey.

https://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI

of course, the user ~could cheat by using a scripted object to set their camera position, but my philosophy with RLV is just to make it fun. Trust people to enguage with your stuff in the way that's most fun for them. If someone realizes they're able to cheat and does so, then has less fun, that's generally on them, not the script.

Yes I am already making use of such commands, although it occurred to me whilst messing with RLV that it would be possible for a user to spoof having RLV with enough technical knowledge, which is why I wondered if camera info was server side. Obviously beyond the lengths a typical SL user would go to but there's always the possibility with the demand that someone would create and share such a thing.

6 hours ago, Wulfie Reanimator said:

Edit: Actually, since the 360 screenshots became a thing, there's now a way for a viewer to request all objects rather than a camera-based list.

Interesting. I wonder if that is just centered around the camera though, rather than all objects in the region?

If it were all objects in the region, a user could with a modified viewer falsely report the camera location to the simulator, and still be able to view the things where there camera really is.

Link to comment
Share on other sites

54 minutes ago, Extrude Ragu said:

Interesting. I wonder if that is just centered around the camera though, rather than all objects in the region?

If it were all objects in the region, a user could with a modified viewer falsely report the camera location to the simulator, and still be able to view the things where there camera really is.

I haven't tested it. I would guess it's probably affected by draw distance, but maybe not.

Second Life doesn't really enforce any kind of "cheat detection." The client is open-source and reporting the camera position is not required in general, if the viewer even has a 3D view.

Edited by Wulfie Reanimator
Link to comment
Share on other sites

a interesting thing about the scripted camera is that if we put one on a region and then teleport to another region then until we press ESC the camera view keeps displaying on our screen the region on which we were on.  And we can still pan the camera on the other region.  We can't see any avatars tho on that region, just the terrain/water/sky/rezzed objects

i think this should be seen as a bug, is just an interesting effect

Edited by Mollymews
typs
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 786 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...