本文整理汇总了C#中ISceneEntity类的典型用法代码示例。如果您正苦于以下问题:C# ISceneEntity类的具体用法?C# ISceneEntity怎么用?C# ISceneEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISceneEntity类属于命名空间,在下文中一共展示了ISceneEntity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Remove
public void Remove(ISceneEntity sceneEntity)
{
if (!_items.Contains(sceneEntity))
throw new ItemDoesNotExistException(Resources.Message_Scene_entity_does_not_exists_in_the_stage);
_items.Remove(sceneEntity);
OnSceneEntityRemoved(sceneEntity);
}
开发者ID:satr,项目名称:VirtualSceneConstructor,代码行数:7,代码来源:Stage.cs
示例2: AddOrUpdate
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <returns>True if the entity was added to the scene graph, false if
/// it was updated</returns>
public bool AddOrUpdate(ISceneEntity entity)
{
bool added;
m_syncRoot.EnterWriteLock();
try
{
if (!m_entityLocalIDs.ContainsKey(entity.LocalID))
{
// Sanity check
if (m_entityUUIDs.ContainsKey(entity.ID))
throw new ArgumentException("Cannot add entity with LocalID " + entity.LocalID + ", ID " + entity.ID + " already exists in the scene");
// Insert this entity into the scene graph, uint map, and UUID map
m_entityLocalIDs.Add(entity.LocalID, entity);
m_entityUUIDs.Add(entity.ID, entity);
added = true;
}
else
{
added = false;
}
// If this is a scene presence, add/update it in the presence collection
if (entity is IScenePresence)
m_presences.Add(entity.ID, (IScenePresence)entity);
}
finally { m_syncRoot.ExitWriteLock(); }
return added;
}
开发者ID:osgrid,项目名称:openmetaverse,代码行数:37,代码来源:SceneGraph.cs
示例3: GetPriorityByDistance
private double GetPriorityByDistance(IClientAPI client, ISceneEntity entity)
{
ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
if (presence != null)
{
// If this is an update for our own avatar give it the highest priority
if (presence == entity)
return 0.0;
// Use the camera position for local agents and avatar position for remote agents
Vector3 presencePos = (presence.IsChildAgent) ?
presence.AbsolutePosition :
presence.CameraPosition;
// Use group position for child prims
Vector3 entityPos;
if (entity is SceneObjectPart)
entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
else
entityPos = entity.AbsolutePosition;
return Vector3.DistanceSquared(presencePos, entityPos);
}
return double.NaN;
}
开发者ID:AlexRa,项目名称:opensim-mods-Alex,代码行数:26,代码来源:Prioritizer.cs
示例4: Add
public void Add(ISceneEntity sceneEntity)
{
if (_items.Contains(sceneEntity))
throw new ItemAlreadyExistsException(Resources.Message_Scene_entity_already_exists_in_the_stage);
_items.Add(sceneEntity);
OnSceneEntityAdded(sceneEntity);
}
开发者ID:satr,项目名称:VirtualSceneConstructor,代码行数:7,代码来源:Stage.cs
示例5: PreloadSound
public void PreloadSound(ISceneEntity source, UUID soundID, float radius)
{
m_scene.CreateInterestListEvent(new InterestListEvent(
UUID.Combine(soundID, PRELOAD_EVENT_ID),
PRELOAD_SOUND,
source.ScenePosition,
new Vector3(radius),
new object[] { source, soundID })
);
}
开发者ID:thoys,项目名称:simian,代码行数:10,代码来源:Sounds.cs
示例6: GetColor
/// <summary>
/// Gets the color representation of the given entity.
/// </summary>
/// <returns>The color.</returns>
/// <param name="entity">Entity.</param>
public static Color GetColor(ISceneEntity entity)
{
// Build Color
if (entity.InBuild) {
if (entity.IsEnabled)
return SceneOpenButton_InBuild_Enabled;
else
return SceneOpenButton_InBuild_Disabled;
}
return SceneOpenButton_Regular;
}
开发者ID:TuxedoBerries,项目名称:ScenePanel,代码行数:17,代码来源:ColorPalette.cs
示例7: GetUpdatePriority
public double GetUpdatePriority(IClientAPI client, ISceneEntity entity)
{
double priority = 0;
if (entity == null)
return 100000;
switch (m_scene.UpdatePrioritizationScheme)
{
case UpdatePrioritizationSchemes.Time:
priority = GetPriorityByTime();
break;
case UpdatePrioritizationSchemes.Distance:
priority = GetPriorityByDistance(client, entity);
break;
case UpdatePrioritizationSchemes.SimpleAngularDistance:
priority = GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance
break;
case UpdatePrioritizationSchemes.FrontBack:
priority = GetPriorityByFrontBack(client, entity);
break;
case UpdatePrioritizationSchemes.BestAvatarResponsiveness:
priority = GetPriorityByBestAvatarResponsiveness(client, entity);
break;
default:
throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
}
// Adjust priority so that root prims are sent to the viewer first. This is especially important for
// attachments acting as huds, since current viewers fail to display hud child prims if their updates
// arrive before the root one.
if (entity is SceneObjectPart)
{
SceneObjectPart sop = ((SceneObjectPart)entity);
if (sop.IsRoot)
{
if (priority >= double.MinValue + m_childPrimAdjustmentFactor)
priority -= m_childPrimAdjustmentFactor;
}
else
{
if (priority <= double.MaxValue - m_childPrimAdjustmentFactor)
priority += m_childPrimAdjustmentFactor;
}
}
return priority;
}
开发者ID:N3X15,项目名称:VoxelSim,代码行数:49,代码来源:Prioritizer.cs
示例8: GetUpdatePriority
public double GetUpdatePriority(IClientAPI client, ISceneEntity entity)
{
switch (m_scene.UpdatePrioritizationScheme)
{
case UpdatePrioritizationSchemes.Time:
return GetPriorityByTime();
case UpdatePrioritizationSchemes.Distance:
return GetPriorityByDistance(client, entity);
case UpdatePrioritizationSchemes.SimpleAngularDistance:
return GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance
case UpdatePrioritizationSchemes.FrontBack:
return GetPriorityByFrontBack(client, entity);
case UpdatePrioritizationSchemes.BestAvatarResponsiveness:
return GetPriorityByBestAvatarResponsiveness(client, entity);
default:
throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
}
}
开发者ID:AlexRa,项目名称:opensim-mods-Alex,代码行数:18,代码来源:Prioritizer.cs
示例9: GetUpdatePriority
/// <summary>
/// Returns the priority queue into which the update should be placed. Updates within a
/// queue will be processed in arrival order. There are currently 12 priority queues
/// implemented in PriorityQueue class in LLClientView. Queue 0 is generally retained
/// for avatar updates. The fair queuing discipline for processing the priority queues
/// assumes that the number of entities in each priority queues increases exponentially.
/// So for example... if queue 1 contains all updates within 10m of the avatar or camera
/// then queue 2 at 20m is about 3X bigger in space & about 3X bigger in total number
/// of updates.
/// </summary>
public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity)
{
// If entity is null we have a serious problem
if (entity == null)
{
m_log.WarnFormat("[PRIORITIZER] attempt to prioritize null entity");
throw new InvalidOperationException("Prioritization entity not defined");
}
// If this is an update for our own avatar give it the highest priority
if (client.AgentId == entity.UUID)
return 0;
uint priority;
// HACK
return GetPriorityByBestAvatarResponsiveness(client, entity);
switch (m_scene.UpdatePrioritizationScheme)
{
case UpdatePrioritizationSchemes.Time:
priority = GetPriorityByTime(client, entity);
break;
case UpdatePrioritizationSchemes.Distance:
priority = GetPriorityByDistance(client, entity);
break;
case UpdatePrioritizationSchemes.SimpleAngularDistance:
priority = GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance
break;
case UpdatePrioritizationSchemes.FrontBack:
priority = GetPriorityByFrontBack(client, entity);
break;
case UpdatePrioritizationSchemes.BestAvatarResponsiveness:
priority = GetPriorityByBestAvatarResponsiveness(client, entity);
break;
default:
throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
}
return priority;
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:53,代码来源:Prioritizer.cs
示例10: LinkChild
/// <summary>
/// Add this child to the group and set the parent ID's,
/// but do NOT set the link number,
/// the caller wants to deal with it if they call this
/// </summary>
/// <param name="child"></param>
/// <returns></returns>
public override bool LinkChild(ISceneEntity child)
{
lock (m_partsLock)
{
if (child is SceneObjectPart)
{
SceneObjectPart part = (SceneObjectPart)child;
//Root part is first
if (m_partsList.Count == 0)
{
m_rootPart = part;
}
//Set the parent prim
part.SetParent(this);
part.SetParentLocalId(m_rootPart.LocalId);
if (!m_parts.ContainsKey(child.UUID))
{
m_parts.Add(child.UUID, part);
m_partsList.Add(part);
}
m_partsList.Sort(m_scene.SceneGraph.linkSetSorter);
return true;
}
}
return false;
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:34,代码来源:SceneObjectGroup.cs
示例11: GetChildPrim
/// <summary>
/// Get a child prim of this group by UUID
/// </summary>
/// <param name="UUID"></param>
/// <param name="entity"></param>
/// <returns></returns>
public override bool GetChildPrim(UUID UUID, out ISceneEntity entity)
{
entity = GetChildPart(UUID);
return entity != null;
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:11,代码来源:SceneObjectGroup.cs
示例12: SendAgentTerseUpdate
// this is diferente from SendTerseUpdateToClient
// this sends bypassing entities updates
public void SendAgentTerseUpdate(ISceneEntity p)
{
ControllingClient.SendAgentTerseUpdate(p);
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:6,代码来源:ScenePresence.cs
示例13: AddPrimBackupTaint
/// <summary>
/// Add a backup taint to the prim
/// </summary>
/// <param name="sceneObjectGroup"></param>
public void AddPrimBackupTaint (ISceneEntity sceneObjectGroup)
{
lock (m_backupTaintedPrims)
{
if (sceneObjectGroup is SceneObjectGroup)
{
if (!m_backupTaintedPrims.ContainsKey(sceneObjectGroup.UUID))
m_backupTaintedPrims.Add(sceneObjectGroup.UUID, (SceneObjectGroup)sceneObjectGroup);
}
}
}
开发者ID:x8ball,项目名称:Aurora-Sim,代码行数:15,代码来源:Backup.cs
示例14: TriggerSignificantObjectMovement
public void TriggerSignificantObjectMovement (ISceneEntity group)
{
SignificantObjectMovement handlerSignificantObjectMovement = OnSignificantObjectMovement;
if (handlerSignificantObjectMovement != null)
{
foreach (SignificantObjectMovement d in handlerSignificantObjectMovement.GetInvocationList ())
{
try
{
d (group);
}
catch (Exception e)
{
m_log.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerSignificantObjectMovement failed - continuing. {0} {1}",
e.ToString (), e.StackTrace);
}
}
}
}
开发者ID:salahzar,项目名称:Aurora-Sim,代码行数:20,代码来源:ISceneEntity.cs
示例15: ReturnObjects
/// <summary>
/// Return the given objects to the agent given
/// </summary>
/// <param name="returnobjects">The objects to return</param>
/// <param name="AgentId">The agent UUID that will get the inventory items for these objects</param>
/// <returns></returns>
public bool ReturnObjects(ISceneEntity[] returnobjects,
UUID AgentId)
{
if (returnobjects.Length == 0)
return true;
//AddReturns(returnobjects[0].OwnerID, returnobjects[0].Name, returnobjects.Length, returnobjects[0].AbsolutePosition, "parcel owner return");
#if (!ISWIN)
List<uint> IDs = new List<uint>();
foreach (ISceneEntity grp in returnobjects)
IDs.Add(grp.LocalId);
#else
List<uint> IDs = returnobjects.Select(grp => grp.LocalId).ToList();
#endif
IClientAPI client;
m_scene.ClientManager.TryGetValue(AgentId, out client);
//Its ok if the client is null, its taken care of
DeRezObjects(client, IDs, returnobjects[0].RootChild.GroupID, DeRezAction.Return, UUID.Zero);
return true;
}
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:25,代码来源:LLClientInventory.cs
示例16: CheckAllocationOfLocalIds
/// <summary>
/// Check all the localIDs in this group to make sure that they have not been used previously
/// </summary>
/// <param name="group"></param>
public void CheckAllocationOfLocalIds(ISceneEntity group)
{
foreach (ISceneChildEntity part in group.ChildrenEntities())
{
if (part.LocalId != 0)
CheckAllocationOfLocalId(part.LocalId);
}
}
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:12,代码来源:SceneGraph.cs
示例17: CreateEntity
public ISceneEntity CreateEntity(
ISceneEntity baseEntity, UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
if (Array.IndexOf(creationCapabilities, (PCode) shape.PCode) < 0)
{
MainConsole.Instance.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name);
return null;
}
ISceneChildEntity rootPart = baseEntity.GetChildPart(baseEntity.UUID);
// if grass or tree, make phantom
//rootPart.TrimPermissions();
rootPart.AddFlag(PrimFlags.Phantom);
if (rootPart.Shape.PCode != (byte) PCode.Grass)
AdaptTree(ref shape);
m_scene.SceneGraph.AddPrimToScene(baseEntity);
baseEntity.SetGroup(groupID, ownerID, true);
baseEntity.ScheduleGroupUpdate(PrimUpdateFlags.ForcedFullUpdate);
return baseEntity;
}
开发者ID:QueenStarfinder,项目名称:WhiteCore-Dev,代码行数:23,代码来源:VegetationModule.cs
示例18: DeLinkPartFromEntity
/// <summary>
/// Delinks the object from the group in the EntityManager
/// </summary>
/// <param name="entity"></param>
/// <param name="part"></param>
/// <returns></returns>
public bool DeLinkPartFromEntity(ISceneEntity entity, ISceneChildEntity part)
{
//Remove the entity so that we can rebuild
RemoveEntity(entity);
bool RetVal = entity.RemoveChild(part);
AddEntity(entity, false);
//Now that everything is linked, destroy the undo states because it will fry the object otherwise
entity.ClearUndoState();
return RetVal;
}
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:16,代码来源:SceneGraph.cs
示例19: TriggerObjectBeingRemovedFromScene
public void TriggerObjectBeingRemovedFromScene (ISceneEntity obj)
{
ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
if (handlerObjectBeingRemovedFromScene != null)
{
foreach (ObjectBeingRemovedFromScene d in handlerObjectBeingRemovedFromScene.GetInvocationList ())
{
try
{
d (obj);
}
catch (Exception e)
{
m_log.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}",
e.ToString (), e.StackTrace);
}
}
}
}
开发者ID:salahzar,项目名称:Aurora-Sim,代码行数:20,代码来源:ISceneEntity.cs
示例20: UpdateEntity
/// <summary>
/// THIS IS TO ONLY BE CALLED WHEN AN OBJECT UUID IS UPDATED!!!
/// This method is HIGHLY unsafe and destroys the integrity of the checks above!
/// This is NOT to be used lightly! Do NOT use this unless you have to!
/// </summary>
/// <param name="entity"></param>
/// <param name="newID">new UUID to set the root part to</param>
public void UpdateEntity(ISceneEntity entity, UUID newID)
{
RemoveEntity(entity);
//Set it to the root so that we don't create an infinite loop as the ONLY place this should be being called is from the setter in SceneObjectGroup.UUID
entity.RootChild.UUID = newID;
AddEntity(entity, false);
}
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:14,代码来源:SceneGraph.cs
注:本文中的ISceneEntity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论