C# Class OpenSim.Region.Framework.Scenes.ScenePresence

Inheritance: EntityBase, IScenePresence
ファイルを表示 Open project: N3X15/VoxelSim Class Usage Examples

Public Properties

Property Type Description
CollisionPlane Vector4
IsRestrictedToRegion bool
JID string
SitGround bool
currentParcelUUID UUID
lastKnownAllowedPosition Vector3
sentMessageAboutRestrictedParcelFlyingDown bool

Protected Properties

Property Type Description
crossingFromRegion ulong
m_CameraAtAxis Vector3
m_CameraCenter Vector3
m_CameraLeftAxis Vector3
m_CameraUpAxis Vector3
m_DrawDistance float
m_allowMovement bool
m_animator ScenePresenceAnimator
m_appearance AvatarAppearance
m_attachments List
m_lastCameraCenter Vector3
m_parentPosition Vector3
m_physicsActor PhysicsActor
m_regionInfo RegionInfo
m_reprioritization_called bool
m_reprioritization_timer Timer
m_reprioritizing bool

Public Methods

Method Description
AddAttachment ( SceneObjectGroup gobj ) : void
AddNeighbourRegion ( ulong regionHandle, string cap ) : void
AddNewMovement ( System.Vector3 vec, Quaternion rotation ) : void

Rotate the avatar to the given rotation and apply a movement in the given relative vector

AddToPhysicalScene ( bool isFlying ) : void

Adds a physical representation of the avatar to the Physics plugin

AdjustKnownSeeds ( ) : void
ChildAgentDataUpdate ( AgentData cAgentData ) : void
ChildAgentDataUpdate ( AgentPosition cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY ) : void

This updates important decision making data about a child agent The main purpose is to figure out what objects to send to a child agent that's in a neighboring region

Close ( ) : void
CloseChildAgents ( uint newRegionX, uint newRegionY ) : void

Computes which child agents to close when the scene presence moves to another region. Removes those regions from m_knownRegions.

CompleteMovement ( IClientAPI client ) : void

Complete Avatar's movement into the region. This is called upon a very important packet sent from the client, so it's client-controlled. Never call this method directly.

CopyAgent ( IAgentData &agent ) : bool
CopyFrom ( AgentData cAgent ) : void
CopyTo ( AgentData cAgent ) : void
DoAutoPilot ( uint not_used, Vector3 Pos, IClientAPI remote_client ) : void
DoMoveToPosition ( Object sender, string method, List args ) : void
DropOldNeighbours ( List oldRegions ) : void
DumpKnownRegions ( ) : void
GenerateClientFlags ( UUID ObjectID ) : uint
GetAttachments ( uint attachmentPoint ) : List

Get the scene object attached to the given point.

GetKnownRegionList ( ) : List
GrantGodlikePowers ( UUID agentID, UUID sessionID, UUID token, bool godStatus ) : void

This allows the Sim owner the abiility to kick users from their sim currently. It tells the client that the agent has permission to do so.

HandleAgentRequestSit ( IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset ) : void
HandleAgentRequestSit ( IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset, string sitAnimation ) : void
HandleAgentSit ( IClientAPI remoteClient, UUID agentID ) : void
HandleAgentSit ( IClientAPI remoteClient, UUID agentID, string sitAnimation ) : void
HandleAgentUpdate ( IClientAPI remoteClient, AgentUpdateArgs agentData ) : void

This is the event handler for client movement. If a client is moving, this event is triggering.

HandleForceReleaseControls ( IClientAPI remoteClient, UUID agentID ) : void
HandleSetAlwaysRun ( IClientAPI remoteClient, bool pSetAlwaysRun ) : void

Event handler for the 'Always run' setting on the client Tells the physics plugin to increase speed of movement.

HandleStartAnim ( IClientAPI remoteClient, UUID animID ) : void
HandleStopAnim ( IClientAPI remoteClient, UUID animID ) : void
HasAttachments ( ) : bool
HasScriptedAttachments ( ) : bool
InTransit ( ) : void
MakeChildAgent ( ) : void

This turns a root agent into a child agent when an agent departs this region for a neighbor, this gets called. It doesn't get called for a teleport. Reason being, an agent that teleports out may not end up anywhere near this region

MakeRootAgent ( Vector3 pos, bool isFlying ) : void

This turns a child agent, into a root agent This is called when an agent teleports into a region, or if an agent crosses into this region from a neighbor over the border

NotInTransit ( ) : void
RayCastCameraCallback ( bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal ) : void

Callback for the Camera view block check. Gets called with the results of the camera view block test hitYN is true when there's something in the way.

RegisterControlEventsToScript ( int controls, int accept, int pass_on, uint Obj_localID, UUID Script_item_UUID ) : void
RegisterToEvents ( ) : void
RemoveAttachment ( SceneObjectGroup gobj ) : void
RemoveNeighbourRegion ( ulong regionHandle ) : void
Reset ( ) : void
RestoreInCurrentScene ( ) : void
RezAttachments ( ) : void

RezAttachments. This should only be called upon login on the first region. Attachment rezzings on crossings and TPs are done in a different way.

ScenePresence ( ) : System
ScenePresence ( IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance ) : System
SendAppearanceToAllOtherAgents ( ) : void

SendAppearanceToOtherAgent ( ScenePresence avatar ) : void

Send appearance data to an agent that isn't this one.

SendCoarseLocations ( List coarseLocations, List avatarUUIDs ) : void
SendCoarseLocationsDefault ( UUID sceneId, ScenePresence p, List coarseLocations, List avatarUUIDs ) : void
SendFullUpdateToAllClients ( ) : void
SendFullUpdateToOtherClient ( ScenePresence remoteAvatar ) : void

Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar)

SendInitialData ( ) : void

Do everything required once a client completes its movement into a region

SendInitialFullUpdateToAllClients ( ) : void

Tell *ALL* agents about this agent

SendPrimUpdates ( ) : void

Send updates to the client about prims which have been placed on the update queue. We don't necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent timestamp has already been sent.

SendScriptEventToAttachments ( string eventName, Object args ) : void

Send a script event to this scene presence's attachments

SendTerseUpdateToAllClients ( ) : void

Send a location/velocity/accelleration update to all agents in scene

SendTerseUpdateToClient ( IClientAPI remoteClient ) : void

Sends a location update to the client connected to this scenePresence

SetHeight ( float height ) : void

Sets avatar height in the phyiscs plugin

SetSendCourseLocationMethod ( SendCourseLocationsMethod d ) : void
StandUp ( ) : void

Perform the logic necessary to stand the avatar up. This method also executes the stand animation.

StopFlying ( ) : void
StopMovement ( ) : void

Teleport ( Vector3 pos ) : void

TeleportWithMomentum ( Vector3 pos ) : void
UnRegisterControlEventsToScript ( uint Obj_localID, UUID Script_item_UUID ) : void
Update ( ) : void
UpdateMovement ( ) : void

Handles part of the PID controller function for moving an avatar.

ValidateAttachments ( ) : bool
initializeScenePresence ( IClientAPI client, RegionInfo region, Scene scene ) : void
setHealthWithUpdate ( float health ) : void

Protected Methods

Method Description
CheckForBorderCrossing ( ) : void

Checks to see if the avatar is in range of a border and calls CrossToNewRegion

CheckForSignificantMovement ( ) : void

This checks for a significant movement and sends a courselocationchange update

CrossToNewRegion ( ) : void

Moves the agent outside the region bounds Tells neighbor region that we're crossing to it If the neighbor accepts, remove the agent's viewable avatar from this scene set them to a child agent.

HaveNeighbor ( Cardinals car, int &fix ) : int

Private Methods

Method Description
CheckAtSitTarget ( ) : void
CreateSceneViewer ( ) : void
FindNextAvailableSitTarget ( UUID targetID ) : SceneObjectPart
GetWalkDirectionVectors ( ) : Vector3[]
OutOfBoundsCall ( Vector3 pos ) : void
PhysicsCollisionUpdate ( EventArgs e ) : void
PushForce ( Vector3 impulse ) : void
RemoveFromPhysicalScene ( ) : void

Removes physics plugin scene representation of this agent if it exists.

RemoveIgnoredControls ( AgentManager flags, ScriptControlled ignored ) : AgentManager.ControlFlags
Reprioritize ( object sender, ElapsedEventArgs e ) : void
ReprioritizeUpdates ( ) : void
ScenePresence ( IClientAPI client, Scene world, RegionInfo reginfo ) : System
SendControlToScripts ( uint flags ) : void
SendSitResponse ( IClientAPI remoteClient, UUID targetID, Vector3 offset, Quaternion pSitOrientation ) : void
SetDirectionVectors ( ) : void

Method Details

AddAttachment() public method

public AddAttachment ( SceneObjectGroup gobj ) : void
gobj SceneObjectGroup
return void

AddNeighbourRegion() public method

public AddNeighbourRegion ( ulong regionHandle, string cap ) : void
regionHandle ulong
cap string
return void

AddNewMovement() public method

Rotate the avatar to the given rotation and apply a movement in the given relative vector
public AddNewMovement ( System.Vector3 vec, Quaternion rotation ) : void
vec System.Vector3 The vector in which to move. This is relative to the rotation argument
rotation Quaternion
return void

AddToPhysicalScene() public method

Adds a physical representation of the avatar to the Physics plugin
public AddToPhysicalScene ( bool isFlying ) : void
isFlying bool
return void

AdjustKnownSeeds() public method

public AdjustKnownSeeds ( ) : void
return void

CheckForBorderCrossing() protected method

Checks to see if the avatar is in range of a border and calls CrossToNewRegion
protected CheckForBorderCrossing ( ) : void
return void

CheckForSignificantMovement() protected method

This checks for a significant movement and sends a courselocationchange update
protected CheckForSignificantMovement ( ) : void
return void

ChildAgentDataUpdate() public method

public ChildAgentDataUpdate ( AgentData cAgentData ) : void
cAgentData OpenSim.Framework.AgentData
return void

ChildAgentDataUpdate() public method

This updates important decision making data about a child agent The main purpose is to figure out what objects to send to a child agent that's in a neighboring region
public ChildAgentDataUpdate ( AgentPosition cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY ) : void
cAgentData OpenSim.Framework.AgentPosition
tRegionX uint
tRegionY uint
rRegionX uint
rRegionY uint
return void

Close() public method

public Close ( ) : void
return void

CloseChildAgents() public method

Computes which child agents to close when the scene presence moves to another region. Removes those regions from m_knownRegions.
public CloseChildAgents ( uint newRegionX, uint newRegionY ) : void
newRegionX uint The new region's x on the map
newRegionY uint The new region's y on the map
return void

CompleteMovement() public method

Complete Avatar's movement into the region. This is called upon a very important packet sent from the client, so it's client-controlled. Never call this method directly.
public CompleteMovement ( IClientAPI client ) : void
client IClientAPI
return void

CopyAgent() public method

public CopyAgent ( IAgentData &agent ) : bool
agent IAgentData
return bool

CopyFrom() public method

public CopyFrom ( AgentData cAgent ) : void
cAgent AgentData
return void

CopyTo() public method

public CopyTo ( AgentData cAgent ) : void
cAgent AgentData
return void

CrossToNewRegion() protected method

Moves the agent outside the region bounds Tells neighbor region that we're crossing to it If the neighbor accepts, remove the agent's viewable avatar from this scene set them to a child agent.
protected CrossToNewRegion ( ) : void
return void

DoAutoPilot() public method

public DoAutoPilot ( uint not_used, Vector3 Pos, IClientAPI remote_client ) : void
not_used uint
Pos Vector3
remote_client IClientAPI
return void

DoMoveToPosition() public method

public DoMoveToPosition ( Object sender, string method, List args ) : void
sender Object
method string
args List
return void

DropOldNeighbours() public method

public DropOldNeighbours ( List oldRegions ) : void
oldRegions List
return void

DumpKnownRegions() public method

public DumpKnownRegions ( ) : void
return void

GenerateClientFlags() public method

public GenerateClientFlags ( UUID ObjectID ) : uint
ObjectID UUID
return uint

GetAttachments() public method

Get the scene object attached to the given point.
public GetAttachments ( uint attachmentPoint ) : List
attachmentPoint uint
return List

GetKnownRegionList() public method

public GetKnownRegionList ( ) : List
return List

GrantGodlikePowers() public method

This allows the Sim owner the abiility to kick users from their sim currently. It tells the client that the agent has permission to do so.
public GrantGodlikePowers ( UUID agentID, UUID sessionID, UUID token, bool godStatus ) : void
agentID UUID
sessionID UUID
token UUID
godStatus bool
return void

HandleAgentRequestSit() public method

public HandleAgentRequestSit ( IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset ) : void
remoteClient IClientAPI
agentID UUID
targetID UUID
offset Vector3
return void

HandleAgentRequestSit() public method

public HandleAgentRequestSit ( IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset, string sitAnimation ) : void
remoteClient IClientAPI
agentID UUID
targetID UUID
offset Vector3
sitAnimation string
return void

HandleAgentSit() public method

public HandleAgentSit ( IClientAPI remoteClient, UUID agentID ) : void
remoteClient IClientAPI
agentID UUID
return void

HandleAgentSit() public method

public HandleAgentSit ( IClientAPI remoteClient, UUID agentID, string sitAnimation ) : void
remoteClient IClientAPI
agentID UUID
sitAnimation string
return void

HandleAgentUpdate() public method

This is the event handler for client movement. If a client is moving, this event is triggering.
public HandleAgentUpdate ( IClientAPI remoteClient, AgentUpdateArgs agentData ) : void
remoteClient IClientAPI
agentData AgentUpdateArgs
return void

HandleForceReleaseControls() public method

public HandleForceReleaseControls ( IClientAPI remoteClient, UUID agentID ) : void
remoteClient IClientAPI
agentID UUID
return void

HandleSetAlwaysRun() public method

Event handler for the 'Always run' setting on the client Tells the physics plugin to increase speed of movement.
public HandleSetAlwaysRun ( IClientAPI remoteClient, bool pSetAlwaysRun ) : void
remoteClient IClientAPI
pSetAlwaysRun bool
return void

HandleStartAnim() public method

public HandleStartAnim ( IClientAPI remoteClient, UUID animID ) : void
remoteClient IClientAPI
animID UUID
return void

HandleStopAnim() public method

public HandleStopAnim ( IClientAPI remoteClient, UUID animID ) : void
remoteClient IClientAPI
animID UUID
return void

HasAttachments() public method

public HasAttachments ( ) : bool
return bool

HasScriptedAttachments() public method

public HasScriptedAttachments ( ) : bool
return bool

HaveNeighbor() protected method

protected HaveNeighbor ( Cardinals car, int &fix ) : int
car Cardinals
fix int
return int

InTransit() public method

public InTransit ( ) : void
return void

MakeChildAgent() public method

This turns a root agent into a child agent when an agent departs this region for a neighbor, this gets called. It doesn't get called for a teleport. Reason being, an agent that teleports out may not end up anywhere near this region
public MakeChildAgent ( ) : void
return void

MakeRootAgent() public method

This turns a child agent, into a root agent This is called when an agent teleports into a region, or if an agent crosses into this region from a neighbor over the border
public MakeRootAgent ( Vector3 pos, bool isFlying ) : void
pos Vector3
isFlying bool
return void

NotInTransit() public method

public NotInTransit ( ) : void
return void

RayCastCameraCallback() public method

Callback for the Camera view block check. Gets called with the results of the camera view block test hitYN is true when there's something in the way.
public RayCastCameraCallback ( bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal ) : void
hitYN bool
collisionPoint Vector3
localid uint
distance float
pNormal Vector3
return void

RegisterControlEventsToScript() public method

public RegisterControlEventsToScript ( int controls, int accept, int pass_on, uint Obj_localID, UUID Script_item_UUID ) : void
controls int
accept int
pass_on int
Obj_localID uint
Script_item_UUID UUID
return void

RegisterToEvents() public method

public RegisterToEvents ( ) : void
return void

RemoveAttachment() public method

public RemoveAttachment ( SceneObjectGroup gobj ) : void
gobj SceneObjectGroup
return void

RemoveNeighbourRegion() public method

public RemoveNeighbourRegion ( ulong regionHandle ) : void
regionHandle ulong
return void

Reset() public method

public Reset ( ) : void
return void

RestoreInCurrentScene() public method

public RestoreInCurrentScene ( ) : void
return void

RezAttachments() public method

RezAttachments. This should only be called upon login on the first region. Attachment rezzings on crossings and TPs are done in a different way.
public RezAttachments ( ) : void
return void

ScenePresence() public method

public ScenePresence ( ) : System
return System

ScenePresence() public method

public ScenePresence ( IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance ) : System
client IClientAPI
world Scene
reginfo RegionInfo
appearance AvatarAppearance
return System

SendAppearanceToAllOtherAgents() public method

public SendAppearanceToAllOtherAgents ( ) : void
return void

SendAppearanceToOtherAgent() public method

Send appearance data to an agent that isn't this one.
public SendAppearanceToOtherAgent ( ScenePresence avatar ) : void
avatar ScenePresence
return void

SendCoarseLocations() public method

public SendCoarseLocations ( List coarseLocations, List avatarUUIDs ) : void
coarseLocations List
avatarUUIDs List
return void

SendCoarseLocationsDefault() public method

public SendCoarseLocationsDefault ( UUID sceneId, ScenePresence p, List coarseLocations, List avatarUUIDs ) : void
sceneId UUID
p ScenePresence
coarseLocations List
avatarUUIDs List
return void

SendFullUpdateToAllClients() public method

public SendFullUpdateToAllClients ( ) : void
return void

SendFullUpdateToOtherClient() public method

Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar)
public SendFullUpdateToOtherClient ( ScenePresence remoteAvatar ) : void
remoteAvatar ScenePresence
return void

SendInitialData() public method

Do everything required once a client completes its movement into a region
public SendInitialData ( ) : void
return void

SendInitialFullUpdateToAllClients() public method

Tell *ALL* agents about this agent
public SendInitialFullUpdateToAllClients ( ) : void
return void

SendPrimUpdates() public method

Send updates to the client about prims which have been placed on the update queue. We don't necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent timestamp has already been sent.
public SendPrimUpdates ( ) : void
return void

SendScriptEventToAttachments() public method

Send a script event to this scene presence's attachments
public SendScriptEventToAttachments ( string eventName, Object args ) : void
eventName string The name of the event
args Object The arguments for the event
return void

SendTerseUpdateToAllClients() public method

Send a location/velocity/accelleration update to all agents in scene
public SendTerseUpdateToAllClients ( ) : void
return void

SendTerseUpdateToClient() public method

Sends a location update to the client connected to this scenePresence
public SendTerseUpdateToClient ( IClientAPI remoteClient ) : void
remoteClient IClientAPI
return void

SetHeight() public method

Sets avatar height in the phyiscs plugin
public SetHeight ( float height ) : void
height float
return void

SetSendCourseLocationMethod() public method

public SetSendCourseLocationMethod ( SendCourseLocationsMethod d ) : void
d SendCourseLocationsMethod
return void

StandUp() public method

Perform the logic necessary to stand the avatar up. This method also executes the stand animation.
public StandUp ( ) : void
return void

StopFlying() public method

public StopFlying ( ) : void
return void

StopMovement() public method

public StopMovement ( ) : void
return void

Teleport() public method

public Teleport ( Vector3 pos ) : void
pos Vector3
return void

TeleportWithMomentum() public method

public TeleportWithMomentum ( Vector3 pos ) : void
pos Vector3
return void

UnRegisterControlEventsToScript() public method

public UnRegisterControlEventsToScript ( uint Obj_localID, UUID Script_item_UUID ) : void
Obj_localID uint
Script_item_UUID UUID
return void

Update() public method

public Update ( ) : void
return void

UpdateMovement() public method

Handles part of the PID controller function for moving an avatar.
public UpdateMovement ( ) : void
return void

ValidateAttachments() public method

public ValidateAttachments ( ) : bool
return bool

initializeScenePresence() public method

public initializeScenePresence ( IClientAPI client, RegionInfo region, Scene scene ) : void
client IClientAPI
region RegionInfo
scene Scene
return void

setHealthWithUpdate() public method

public setHealthWithUpdate ( float health ) : void
health float
return void

Property Details

CollisionPlane public_oe property

public Vector4 CollisionPlane
return Vector4

IsRestrictedToRegion public_oe property

public bool IsRestrictedToRegion
return bool

JID public_oe property

public string JID
return string

SitGround public_oe property

public bool SitGround
return bool

crossingFromRegion protected_oe property

protected ulong crossingFromRegion
return ulong

currentParcelUUID public_oe property

public UUID currentParcelUUID
return UUID

lastKnownAllowedPosition public_oe property

public Vector3 lastKnownAllowedPosition
return Vector3

m_CameraAtAxis protected_oe property

protected Vector3 m_CameraAtAxis
return Vector3

m_CameraCenter protected_oe property

protected Vector3 m_CameraCenter
return Vector3

m_CameraLeftAxis protected_oe property

protected Vector3 m_CameraLeftAxis
return Vector3

m_CameraUpAxis protected_oe property

protected Vector3 m_CameraUpAxis
return Vector3

m_DrawDistance protected_oe property

protected float m_DrawDistance
return float

m_allowMovement protected_oe property

protected bool m_allowMovement
return bool

m_animator protected_oe property

protected ScenePresenceAnimator m_animator
return ScenePresenceAnimator

m_appearance protected_oe property

protected AvatarAppearance m_appearance
return AvatarAppearance

m_attachments protected_oe property

protected List m_attachments
return List

m_lastCameraCenter protected_oe property

protected Vector3 m_lastCameraCenter
return Vector3

m_parentPosition protected_oe property

protected Vector3 m_parentPosition
return Vector3

m_physicsActor protected_oe property

protected PhysicsActor m_physicsActor
return PhysicsActor

m_regionInfo protected_oe property

protected RegionInfo m_regionInfo
return RegionInfo

m_reprioritization_called protected_oe property

protected bool m_reprioritization_called
return bool

m_reprioritization_timer protected_oe property

protected Timer m_reprioritization_timer
return Timer

m_reprioritizing protected_oe property

protected bool m_reprioritizing
return bool

sentMessageAboutRestrictedParcelFlyingDown public_oe property

public bool sentMessageAboutRestrictedParcelFlyingDown
return bool