本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectGroup.SetGroup方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectGroup.SetGroup方法的具体用法?C# SceneObjectGroup.SetGroup怎么用?C# SceneObjectGroup.SetGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.SceneObjectGroup
的用法示例。
在下文中一共展示了SceneObjectGroup.SetGroup方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddNewPrim
/// <summary>
/// Create a New SceneObjectGroup/Part by raycasting
/// </summary>
/// <param name="ownerID"></param>
/// <param name="groupID"></param>
/// <param name="RayEnd"></param>
/// <param name="rot"></param>
/// <param name="shape"></param>
/// <param name="bypassRaycast"></param>
/// <param name="RayStart"></param>
/// <param name="RayTargetID"></param>
/// <param name="RayEndIsIntersection"></param>
public virtual ISceneEntity AddNewPrim(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
//m_log.DebugFormat(
// "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
SceneObjectGroup sceneObject = new SceneObjectGroup (ownerID, pos, rot, shape, m_DefaultObjectName, m_parentScene);
// If an entity creator has been registered for this prim type then use that
if (m_entityCreators.ContainsKey((PCode)shape.PCode))
{
sceneObject = (SceneObjectGroup)m_entityCreators[(PCode)shape.PCode].CreateEntity (sceneObject, ownerID, groupID, pos, rot, shape);
}
else
{
// Otherwise, use this default creation code;
sceneObject.SetGroup(groupID, null);
AddPrimToScene(sceneObject);
sceneObject.ScheduleGroupUpdate(PrimUpdateFlags.FullUpdate);
}
return sceneObject;
}
示例2: AddNewPrim
public virtual SceneObjectGroup AddNewPrim(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
//m_log.DebugFormat(
// "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
SceneObjectGroup sceneObject = null;
// If an entity creator has been registered for this prim type then use that
if (m_entityCreators.ContainsKey((PCode)shape.PCode))
{
sceneObject = m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
}
else
{
// Otherwise, use this default creation code;
sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
}
if (UserManagementModule != null)
sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
sceneObject.ScheduleGroupForFullUpdate();
return sceneObject;
}
示例3: AddNewPrim
public virtual SceneObjectGroup AddNewPrim(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
//m_log.DebugFormat(
// "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
SceneObjectGroup sceneObject = null;
// If an entity creator has been registered for this prim type then use that
if (m_entityCreators.ContainsKey((PCode)shape.PCode))
{
sceneObject = m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
}
else
{
// Otherwise, use this default creation code;
sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
if (AgentPreferencesService != null) // This will override the brave new full perm world!
{
AgentPrefs prefs = AgentPreferencesService.GetAgentPreferences(ownerID);
// Only apply user selected prefs if the user set them
if (prefs != null && prefs.PermNextOwner != 0)
{
sceneObject.RootPart.GroupMask = (uint)prefs.PermGroup;
sceneObject.RootPart.EveryoneMask = (uint)prefs.PermEveryone;
sceneObject.RootPart.NextOwnerMask = (uint)prefs.PermNextOwner;
}
}
}
if (UserManagementModule != null)
sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
sceneObject.ScheduleGroupForFullUpdate();
return sceneObject;
}
示例4: AddNewPrim
public virtual SceneObjectGroup AddNewPrim(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
//m_log.DebugFormat(
// "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
// If an entity creator has been registered for this prim type then use that
if (m_entityCreators.ContainsKey((PCode)shape.PCode))
return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
// Otherwise, use this default creation code;
SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
return sceneObject;
}
示例5: RezSingleObjectToWorld
private SceneObjectGroup RezSingleObjectToWorld(IClientAPI remoteClient, UUID itemID,
SceneObjectGroup group, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, byte bRayEndIsIntersection,
bool RezSelected, bool attachment, Vector3 pos, string name,
string description, IInventoryItem item, ItemPermissionBlock itemPermissions,
int? startParam, UUID? newAvatarGroupId, UUID? rezzedByObjectUUID)
{
bool ownerChanged = false; // record this for the CHANGED_OWNER changed event
if (IsBadUserLoad(group))
{
if (remoteClient != null)
remoteClient.SendAgentAlertMessage("You are currently not allowed to rez objects in this region.", false);
return null; // already reported above
}
if (IsBlacklistedLoad(group))
{
if (remoteClient != null)
remoteClient.SendAgentAlertMessage("Cannot rez blacklisted object '" + group.Name + "'.", false);
return null; // already reported above
}
//set the group here so that positioning in world will enable/disable the
//script correctly based on the group the use is currently in
// Initialize the server weight (LI)
group.RecalcPrimWeights();
group.RezzedFromFolderId = item.Folder;
//group.FromAssetId = item.AssetID; //not needed yet
if (newAvatarGroupId.HasValue)
{
//set the object's land group
group.SetGroup(newAvatarGroupId.Value, null);
}
if (attachment)
{
group.SetFromItemID(itemID);
}
else
{
group.RootPart.SetGroupPositionDirect(pos);
if (RezSelected)
{
//also tell the client there is a new object being rezzed
foreach (SceneObjectPart part in group.GetParts())
{
part.AddFlag(PrimFlags.CreateSelected);
}
}
}
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
if (rootPart == null) {
string what = "object ";
if (attachment)
what = " attachment ";
m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + what + " root part not found.");
return null;
}
// Since renaming the item in the inventory does not affect the name stored
// in the serialization, transfer the correct name from the inventory to the
// object itself before we rez.
rootPart.Name = name;
rootPart.Description = description;
var partList = group.GetParts();
foreach (SceneObjectPart part in partList)
{
/// This fixes inconsistencies between this part and the root part.
/// In the past, there was a bug in Link operations that did not force
/// these permissions on child prims when linking.
part.SyncChildPermsWithRoot();
}
if (rootPart.OwnerID != item.Owner)
{
if (Permissions.PropagatePermissions())
{
if ((itemPermissions.CurrentPermissions & ScenePermBits.SLAM) != 0)
{ // enforce slam bit, apply item perms to the group parts
foreach (SceneObjectPart part in partList)
{
part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions;
part.GroupMask = 0; // DO NOT propagate here
}
}
group.ApplyNextOwnerPermissions();
}
}
ownerChanged |= group.Rationalize(item.Owner, false);
foreach (SceneObjectPart part in partList)
//.........这里部分代码省略.........
示例6: RezPrim
public virtual SceneObjectGroup RezPrim(SceneObjectPart sourcePart, SceneObjectPart newPart, int param, out string reason)
{
// Rez object
Vector3 pos = newPart.AbsolutePosition;
SceneObjectGroup group = new SceneObjectGroup(newPart);
bool isTemp = (group.RootPart.GetEffectiveObjectFlags() & PrimFlags.TemporaryOnRez) != 0;
ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y);
if (parcel == null)
{
reason = "land";
return null;
}
// Pass 0 for landImpact here so that it can be tested separately.
if (!Permissions.CanRezObject(0, newPart.OwnerID, sourcePart.UUID, pos, isTemp))
{
reason = "permission";
return null;
}
if (!CheckLandImpact(parcel, group.LandImpact, out reason))
{
return null;
}
// Check for grey goo fence
if (!CheckGreyGoo(sourcePart, group))
{
reason = "fence";
return null;
}
// Allowing the rez... update the last rez time and the new group fields
sourcePart.StampLastRez();
group.CurrentParcel = parcel; // initialize _currentParcel (and auto-return)
group.SetGeneration(group.RootPart.Generation); // now update the rest of the parts
group.ResetIDs();
//set the group's group before setting the object's position.
//this will make sure that the group id is correct during the script
//engine's group check
group.SetGroup(sourcePart.ParentGroup.RootPart.GroupID, null);
AddNewSceneObject(group, !isTemp);
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
rootPart.TrimPermissions();
if (group.RootPart.IsPrim)
{
group.ClearPartAttachmentData();
}
group.CreateScriptInstances(param, ScriptStartFlags.PostOnRez, DefaultScriptEngine, (int)ScriptStateSource.PrimData, null);
rootPart.ScheduleFullUpdate(PrimUpdateFlags.ForcedFullUpdate);
reason = "success";
return rootPart.ParentGroup;
}
示例7: CreateEntity
public SceneObjectGroup CreateEntity(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
if (Array.IndexOf(creationCapabilities, (PCode)shape.PCode) < 0)
{
m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name);
return null;
}
SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape, m_scene);
SceneObjectPart rootPart = sceneObject.GetChildPart(sceneObject.UUID);
rootPart.AddFlag(PrimFlags.Phantom);
if (rootPart.Shape.PCode != (byte)PCode.Grass)
{
// Tree size has to be adapted depending on its type
switch ((Tree)rootPart.Shape.State)
{
case Tree.Cypress1:
case Tree.Cypress2:
case Tree.Palm1:
case Tree.Palm2:
case Tree.WinterAspen:
rootPart.Scale = new Vector3(4, 4, 10);
break;
case Tree.WinterPine1:
case Tree.WinterPine2:
rootPart.Scale = new Vector3(4, 4, 20);
break;
case Tree.Dogwood:
rootPart.Scale = new Vector3(6.5f, 6.5f, 6.5f);
break;
// case... other tree types
// tree.Scale = new Vector3(?, ?, ?);
// break;
default:
rootPart.Scale = new Vector3(4, 4, 4);
break;
}
}
m_scene.AddPrimToScene(sceneObject);
sceneObject.ScheduleGroupForFullUpdate(PrimUpdateFlags.FullUpdate);
sceneObject.SetGroup(groupID, null);
return sceneObject;
}
示例8: CreateEntity
public SceneObjectGroup CreateEntity(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
if (Array.IndexOf(creationCapabilities, (PCode)shape.PCode) < 0)
{
m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name);
return null;
}
SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
SceneObjectPart rootPart = sceneObject.GetChildPart(sceneObject.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.AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
return sceneObject;
}
示例9: AddNewPrim
public virtual SceneObjectGroup AddNewPrim(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
//m_log.DebugFormat(
// "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
SceneObjectGroup sceneObject = null;
// If an entity creator has been registered for this prim type then use that
if (m_entityCreators.ContainsKey((PCode)shape.PCode))
{
sceneObject = m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
}
else
{
// Otherwise, use this default creation code;
sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape, this);
//This has to be set, otherwise it will break things like rezzing objects in an area where crossing is disabled, but rez isn't
sceneObject.m_lastSignificantPosition = pos;
AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
}
return sceneObject;
}
示例10: CreateEntity
public SceneObjectGroup CreateEntity(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
if (Array.IndexOf(creationCapabilities, (PCode)shape.PCode) < 0)
{
m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name);
return null;
}
SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID);
rootPart.AddFlag(PrimFlags.Phantom);
m_scene.AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
return sceneObject;
}
示例11: AddNewPrim
/// <summary>
/// Create a New SceneObjectGroup/Part by raycasting
/// </summary>
/// <param name="ownerID"></param>
/// <param name="groupID"></param>
/// <param name="pos"></param>
/// <param name="rot"></param>
/// <param name="shape"></param>
public virtual ISceneEntity AddNewPrim(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
{
SceneObjectGroup sceneObject = new SceneObjectGroup (ownerID, pos, rot, shape, m_DefaultObjectName, m_parentScene);
// If an entity creator has been registered for this prim type then use that
if (m_entityCreators.ContainsKey((PCode)shape.PCode))
{
sceneObject = (SceneObjectGroup)m_entityCreators[(PCode)shape.PCode].CreateEntity (sceneObject, ownerID, groupID, pos, rot, shape);
}
else
{
// Otherwise, use this default creation code;
sceneObject.SetGroup(groupID, ownerID, false);
AddPrimToScene(sceneObject);
sceneObject.ScheduleGroupUpdate(PrimUpdateFlags.ForcedFullUpdate);
}
return sceneObject;
}