OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Events | List of all members
OpenSim.Region.Framework.Scenes.SceneGraph Class Reference

This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components should be migrated out over time. More...

Collaboration diagram for OpenSim.Region.Framework.Scenes.SceneGraph:
Collaboration graph
[legend]

Public Member Functions

void GetCoarseLocations (out List< Vector3 > coarseLocations, out List< UUID > avatarUUIDs, uint maxLocations)
 
bool AddNewSceneObject (SceneObjectGroup sceneObject, bool attachToBackup, Vector3?pos, Quaternion?rot, Vector3 vel)
 Add a newly created object to the scene. More...
 
void updateScenePartGroup (SceneObjectPart part, SceneObjectGroup grp)
 
bool DeleteSceneObject (UUID uuid, bool resultOfObjectLinked)
 Delete an object from the scene More...
 
void FireAttachToBackup (SceneObjectGroup obj)
 
void FireDetachFromBackup (SceneObjectGroup obj)
 
void FireChangeBackup (SceneObjectGroup obj)
 
void removeUserCount (bool TypeRCTF)
 
void RecalculateStats ()
 
int GetChildAgentCount ()
 
int GetRootAgentCount ()
 
int GetTotalObjectsCount ()
 
int GetTotalPrimObjectsCount ()
 
int GetTotalMeshObjectsCount ()
 
int GetActiveObjectsCount ()
 
int GetActiveScriptsCount ()
 
int GetScriptLPS ()
 
IClientAPI GetControllingClient (UUID agentId)
 Get the controlling client for the given avatar, if there is one. More...
 
SceneObjectGroup GetGroupByPrim (uint localID)
 Get a scene object group that contains the prim with the given local id More...
 
SceneObjectGroup GetGroupByPrim (UUID fullID)
 Get a scene object group that contains the prim with the given uuid More...
 
void ForEachAvatar (Action< ScenePresence > action)
 Performs action on all ROOT (not child) scene presences. This is just a shortcut function since frequently actions only appy to root SPs More...
 
void ForEachScenePresence (Action< ScenePresence > action)
 Performs action on all scene presences. This can ultimately run the actions in parallel but any delegates passed in will need to implement their own locking on data they reference and modify outside of the scope of the delegate. More...
 
void UpdatePrimGroupPosition (uint localId, Vector3 pos, IClientAPI remoteClient)
 Update the position of the given group. More...
 
void UpdatePrimGroupPosition (uint localId, Vector3 pos, UUID updatingAgentId)
 Update the position of the given group. More...
 
SceneObjectGroup DuplicateObject (uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
 Duplicate the given object. More...
 

Protected Member Functions

bool AddSceneObject (SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
 Add an object to the scene. This will both update the scene, and send information about the new object to all clients interested in the scene. More...
 

Protected Attributes

OpenMetaverse.ReaderWriterLockSlim m_scenePresencesLock = new OpenMetaverse.ReaderWriterLockSlim()
 
Dictionary< UUID, ScenePresencem_scenePresenceMap = new Dictionary<UUID, ScenePresence>()
 
List< ScenePresencem_scenePresenceArray = new List<ScenePresence>()
 
Scene m_parentScene
 
Dictionary< UUID,
SceneObjectGroup
m_updateList = new Dictionary<UUID, SceneObjectGroup>()
 
int m_numRootAgents = 0
 
int m_numTotalPrim = 0
 
int m_numPrim = 0
 
int m_numMesh = 0
 
int m_numChildAgents = 0
 
int m_physicalPrim = 0
 
int m_activeScripts = 0
 
int m_scriptLPS = 0
 

Properties

PhysicsScene PhysicsScene [get, set]
 

Events

AttachToBackupDelegate OnAttachToBackup
 
DetachFromBackupDelegate OnDetachFromBackup
 
ChangedBackupDelegate OnChangeBackup
 

Detailed Description

This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components should be migrated out over time.

Definition at line 54 of file SceneGraph.cs.

Member Function Documentation

bool OpenSim.Region.Framework.Scenes.SceneGraph.AddNewSceneObject ( SceneObjectGroup  sceneObject,
bool  attachToBackup,
Vector3?  pos,
Quaternion?  rot,
Vector3  vel 
)
inline

Add a newly created object to the scene.

This method does not send updates to the client - callers need to handle this themselves. Caller should also trigger EventManager.TriggerObjectAddedToScene

Parameters
sceneObject
attachToBackup
posPosition of the object. If null then the position stored in the object is used.
rotRotation of the object. If null then the rotation stored in the object is used.
velVelocity of the object. This parameter only has an effect if the object is physical
Returns

Definition at line 375 of file SceneGraph.cs.

bool OpenSim.Region.Framework.Scenes.SceneGraph.AddSceneObject ( SceneObjectGroup  sceneObject,
bool  attachToBackup,
bool  sendClientUpdates 
)
inlineprotected

Add an object to the scene. This will both update the scene, and send information about the new object to all clients interested in the scene.

The object's stored position, rotation and velocity are used.

Parameters
sceneObject
attachToBackupIf true, the object is made persistent into the scene. If false, the object will not persist over server restarts
sendClientUpdatesIf true, updates for the new scene object are sent to all viewers in range. If false, it is left to the caller to schedule the update
Returns
true if the object was added, false if an object with the same uuid was already in the scene

Definition at line 419 of file SceneGraph.cs.

Here is the call graph for this function:

bool OpenSim.Region.Framework.Scenes.SceneGraph.DeleteSceneObject ( UUID  uuid,
bool  resultOfObjectLinked 
)
inline

Delete an object from the scene

Returns
true if the object was deleted, false if there was no object to delete

Definition at line 518 of file SceneGraph.cs.

Here is the call graph for this function:

SceneObjectGroup OpenSim.Region.Framework.Scenes.SceneGraph.DuplicateObject ( uint  originalPrimID,
Vector3  offset,
uint  flags,
UUID  AgentID,
UUID  GroupID,
Quaternion  rot 
)
inline

Duplicate the given object.

Parameters
originalPrim
offset
flags
AgentID
GroupID
rot
Returns
null if duplication fails, otherwise the duplicated object

Definition at line 2158 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.FireAttachToBackup ( SceneObjectGroup  obj)
inline

Definition at line 585 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.FireChangeBackup ( SceneObjectGroup  obj)
inline

Definition at line 601 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.FireDetachFromBackup ( SceneObjectGroup  obj)
inline

Definition at line 593 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.ForEachAvatar ( Action< ScenePresence action)
inline

Performs action on all ROOT (not child) scene presences. This is just a shortcut function since frequently actions only appy to root SPs

Parameters
action

Definition at line 1286 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.ForEachScenePresence ( Action< ScenePresence action)
inline

Performs action on all scene presences. This can ultimately run the actions in parallel but any delegates passed in will need to implement their own locking on data they reference and modify outside of the scope of the delegate.

Parameters
action

Definition at line 1301 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.GetActiveObjectsCount ( )
inline

Definition at line 844 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.GetActiveScriptsCount ( )
inline

Definition at line 849 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.GetChildAgentCount ( )
inline

Definition at line 819 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.GetCoarseLocations ( out List< Vector3 >  coarseLocations,
out List< UUID >  avatarUUIDs,
uint  maxLocations 
)
inline

Definition at line 239 of file SceneGraph.cs.

IClientAPI OpenSim.Region.Framework.Scenes.SceneGraph.GetControllingClient ( UUID  agentId)
inline

Get the controlling client for the given avatar, if there is one.

FIXME: The only user of the method right now is Caps.cs, in order to resolve a client API since it can't use the ScenePresence. This could be better solved in a number of ways - we could establish an OpenSim.Framework.IScenePresence, or move the caps code into a region package (which might be the more suitable solution).

Parameters
agentId
Returns
null if either the avatar wasn't in the scene, or they do not have a controlling client

this used to be protected internal, but that prevents CapabilitiesModule from accessing it

Definition at line 878 of file SceneGraph.cs.

SceneObjectGroup OpenSim.Region.Framework.Scenes.SceneGraph.GetGroupByPrim ( uint  localID)
inline

Get a scene object group that contains the prim with the given local id

Parameters
localID
Returns
null if no scene object group containing that prim is found

Definition at line 973 of file SceneGraph.cs.

Here is the call graph for this function:

SceneObjectGroup OpenSim.Region.Framework.Scenes.SceneGraph.GetGroupByPrim ( UUID  fullID)
inline

Get a scene object group that contains the prim with the given uuid

Parameters
fullID
Returns
null if no scene object group containing that prim is found

Definition at line 1032 of file SceneGraph.cs.

Here is the call graph for this function:

int OpenSim.Region.Framework.Scenes.SceneGraph.GetRootAgentCount ( )
inline

Definition at line 824 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.GetScriptLPS ( )
inline

Definition at line 854 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.GetTotalMeshObjectsCount ( )
inline

Definition at line 839 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.GetTotalObjectsCount ( )
inline

Definition at line 829 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.GetTotalPrimObjectsCount ( )
inline

Definition at line 834 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.RecalculateStats ( )
inline

Definition at line 802 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.removeUserCount ( bool  TypeRCTF)
inline

Definition at line 790 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.UpdatePrimGroupPosition ( uint  localId,
Vector3  pos,
IClientAPI  remoteClient 
)
inline

Update the position of the given group.

Parameters
localId
pos
remoteClient

Definition at line 1550 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.UpdatePrimGroupPosition ( uint  localId,
Vector3  pos,
UUID  updatingAgentId 
)
inline

Update the position of the given group.

Parameters
localId
pos
updatingAgentId

Definition at line 1561 of file SceneGraph.cs.

void OpenSim.Region.Framework.Scenes.SceneGraph.updateScenePartGroup ( SceneObjectPart  part,
SceneObjectGroup  grp 
)
inline

Definition at line 504 of file SceneGraph.cs.

Member Data Documentation

int OpenSim.Region.Framework.Scenes.SceneGraph.m_activeScripts = 0
protected

Definition at line 86 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.m_numChildAgents = 0
protected

Definition at line 83 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.m_numMesh = 0
protected

Definition at line 82 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.m_numPrim = 0
protected

Definition at line 81 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.m_numRootAgents = 0
protected

Definition at line 79 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.m_numTotalPrim = 0
protected

Definition at line 80 of file SceneGraph.cs.

Scene OpenSim.Region.Framework.Scenes.SceneGraph.m_parentScene
protected

Definition at line 77 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.m_physicalPrim = 0
protected

Definition at line 84 of file SceneGraph.cs.

List<ScenePresence> OpenSim.Region.Framework.Scenes.SceneGraph.m_scenePresenceArray = new List<ScenePresence>()
protected

Definition at line 73 of file SceneGraph.cs.

Dictionary<UUID, ScenePresence> OpenSim.Region.Framework.Scenes.SceneGraph.m_scenePresenceMap = new Dictionary<UUID, ScenePresence>()
protected

Definition at line 72 of file SceneGraph.cs.

OpenMetaverse.ReaderWriterLockSlim OpenSim.Region.Framework.Scenes.SceneGraph.m_scenePresencesLock = new OpenMetaverse.ReaderWriterLockSlim()
protected

Definition at line 71 of file SceneGraph.cs.

int OpenSim.Region.Framework.Scenes.SceneGraph.m_scriptLPS = 0
protected

Definition at line 87 of file SceneGraph.cs.

Dictionary<UUID, SceneObjectGroup> OpenSim.Region.Framework.Scenes.SceneGraph.m_updateList = new Dictionary<UUID, SceneObjectGroup>()
protected

Definition at line 78 of file SceneGraph.cs.

Property Documentation

PhysicsScene OpenSim.Region.Framework.Scenes.SceneGraph.PhysicsScene
getset

Definition at line 123 of file SceneGraph.cs.

Event Documentation

AttachToBackupDelegate OpenSim.Region.Framework.Scenes.SceneGraph.OnAttachToBackup

Definition at line 63 of file SceneGraph.cs.

ChangedBackupDelegate OpenSim.Region.Framework.Scenes.SceneGraph.OnChangeBackup

Definition at line 65 of file SceneGraph.cs.

DetachFromBackupDelegate OpenSim.Region.Framework.Scenes.SceneGraph.OnDetachFromBackup

Definition at line 64 of file SceneGraph.cs.


The documentation for this class was generated from the following file: