本文整理汇总了C#中ObjectShapePacket类的典型用法代码示例。如果您正苦于以下问题:C# ObjectShapePacket类的具体用法?C# ObjectShapePacket怎么用?C# ObjectShapePacket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectShapePacket类属于命名空间,在下文中一共展示了ObjectShapePacket类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UpdateShape
/// <summary>
/// Update the shape of this part.
/// </summary>
/// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
{
m_shape.PathBegin = shapeBlock.PathBegin;
m_shape.PathEnd = shapeBlock.PathEnd;
m_shape.PathScaleX = shapeBlock.PathScaleX;
m_shape.PathScaleY = shapeBlock.PathScaleY;
m_shape.PathShearX = shapeBlock.PathShearX;
m_shape.PathShearY = shapeBlock.PathShearY;
m_shape.PathSkew = shapeBlock.PathSkew;
m_shape.ProfileBegin = shapeBlock.ProfileBegin;
m_shape.ProfileEnd = shapeBlock.ProfileEnd;
m_shape.PathCurve = shapeBlock.PathCurve;
m_shape.ProfileCurve = shapeBlock.ProfileCurve;
m_shape.ProfileHollow = shapeBlock.ProfileHollow;
m_shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
m_shape.PathRevolutions = shapeBlock.PathRevolutions;
m_shape.PathTaperX = shapeBlock.PathTaperX;
m_shape.PathTaperY = shapeBlock.PathTaperY;
m_shape.PathTwist = shapeBlock.PathTwist;
m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
if (PhysActor != null)
{
PhysActor.Shape = m_shape;
ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
}
// This is what makes vehicle trailers work
// A script in a child prim re-issues
// llSetPrimitiveParams(PRIM_TYPE) every few seconds. That
// prevents autoreturn. This is not well known. It also works
// in SL.
//
if (ParentGroup.RootPart != this)
ParentGroup.RootPart.Rezzed = DateTime.UtcNow;
ParentGroup.HasGroupChanged = true;
TriggerScriptChangedEvent(Changed.SHAPE);
ScheduleFullUpdate();
}
开发者ID:justasabc,项目名称:opensim,代码行数:44,代码来源:SceneObjectPart.cs
示例2: UpdateShape
/// <summary>
///
/// </summary>
/// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
part.UpdateShape(shapeBlock);
if (part.PhysActor != null)
m_scene.SceneGraph.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
}
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:15,代码来源:SceneObjectGroup.cs
示例3: SetSculpt
/// <summary>
/// Set the sculptie texture and data on an object
/// </summary>
/// <param name="simulator">A reference to the <seealso cref="OpenMetaverse.Simulator"/> object where the object resides</param>
/// <param name="localID">The objects ID which is local to the simulator the object is in</param>
/// <param name="sculpt">A <seealso cref="Primitive.SculptData"/> object containing the data to set</param>
public void SetSculpt(Simulator simulator, uint localID, Primitive.SculptData sculpt)
{
ObjectExtraParamsPacket extra = new ObjectExtraParamsPacket();
extra.AgentData.AgentID = Client.Self.AgentID;
extra.AgentData.SessionID = Client.Self.SessionID;
extra.ObjectData = new ObjectExtraParamsPacket.ObjectDataBlock[1];
extra.ObjectData[0] = new ObjectExtraParamsPacket.ObjectDataBlock();
extra.ObjectData[0].ObjectLocalID = localID;
extra.ObjectData[0].ParamType = (byte)ExtraParamType.Sculpt;
extra.ObjectData[0].ParamInUse = true;
extra.ObjectData[0].ParamData = sculpt.GetBytes();
extra.ObjectData[0].ParamSize = (uint)extra.ObjectData[0].ParamData.Length;
Client.Network.SendPacket(extra, simulator);
// Not sure why, but if you don't send this the sculpted prim disappears
ObjectShapePacket shape = new ObjectShapePacket();
shape.AgentData.AgentID = Client.Self.AgentID;
shape.AgentData.SessionID = Client.Self.SessionID;
shape.ObjectData = new OpenMetaverse.Packets.ObjectShapePacket.ObjectDataBlock[1];
shape.ObjectData[0] = new OpenMetaverse.Packets.ObjectShapePacket.ObjectDataBlock();
shape.ObjectData[0].ObjectLocalID = localID;
shape.ObjectData[0].PathScaleX = 100;
shape.ObjectData[0].PathScaleY = 150;
shape.ObjectData[0].PathCurve = 32;
Client.Network.SendPacket(shape, simulator);
}
开发者ID:RavenB,项目名称:gridsearch,代码行数:38,代码来源:ObjectManager.cs
示例4: SetShape
/// <summary>
/// Set the Shape data of an object
/// </summary>
/// <param name="simulator">A reference to the <seealso cref="OpenMetaverse.Simulator"/> object where the object resides</param>
/// <param name="localID">The objects ID which is local to the simulator the object is in</param>
/// <param name="prim">Data describing the prim shape</param>
public void SetShape(Simulator simulator, uint localID, Primitive.ConstructionData prim)
{
ObjectShapePacket shape = new ObjectShapePacket();
shape.AgentData.AgentID = Client.Self.AgentID;
shape.AgentData.SessionID = Client.Self.SessionID;
shape.ObjectData = new OpenMetaverse.Packets.ObjectShapePacket.ObjectDataBlock[1];
shape.ObjectData[0] = new OpenMetaverse.Packets.ObjectShapePacket.ObjectDataBlock();
shape.ObjectData[0].ObjectLocalID = localID;
shape.ObjectData[0].PathCurve = (byte)prim.PathCurve;
shape.ObjectData[0].PathBegin = Primitive.PackBeginCut(prim.PathBegin);
shape.ObjectData[0].PathEnd = Primitive.PackEndCut(prim.PathEnd);
shape.ObjectData[0].PathScaleX = Primitive.PackPathScale(prim.PathScaleX);
shape.ObjectData[0].PathScaleY = Primitive.PackPathScale(prim.PathScaleY);
shape.ObjectData[0].PathShearX = (byte)Primitive.PackPathShear(prim.PathShearX);
shape.ObjectData[0].PathShearY = (byte)Primitive.PackPathShear(prim.PathShearY);
shape.ObjectData[0].PathTwist = Primitive.PackPathTwist(prim.PathTwist);
shape.ObjectData[0].PathTwistBegin = Primitive.PackPathTwist(prim.PathTwistBegin);
shape.ObjectData[0].PathRadiusOffset = Primitive.PackPathTwist(prim.PathRadiusOffset);
shape.ObjectData[0].PathTaperX = Primitive.PackPathTaper(prim.PathTaperX);
shape.ObjectData[0].PathTaperY = Primitive.PackPathTaper(prim.PathTaperY);
shape.ObjectData[0].PathRevolutions = Primitive.PackPathRevolutions(prim.PathRevolutions);
shape.ObjectData[0].PathSkew = Primitive.PackPathTwist(prim.PathSkew);
shape.ObjectData[0].ProfileCurve = prim.profileCurve;
shape.ObjectData[0].ProfileBegin = Primitive.PackBeginCut(prim.ProfileBegin);
shape.ObjectData[0].ProfileEnd = Primitive.PackEndCut(prim.ProfileEnd);
shape.ObjectData[0].ProfileHollow = Primitive.PackProfileHollow(prim.ProfileHollow);
Client.Network.SendPacket(shape, simulator);
}
开发者ID:RavenB,项目名称:gridsearch,代码行数:40,代码来源:ObjectManager.cs
示例5: UpdateShape
/// <summary>
///
/// </summary>
/// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{
SceneObjectPart part = GetPart(localID);
if (part != null)
{
part.UpdateShape(shapeBlock);
PhysicsActor pa = m_rootPart.PhysActor;
if (pa != null)
m_scene.PhysicsScene.AddPhysicsActorTaint(pa);
}
}
开发者ID:justasabc,项目名称:opensim75grid,代码行数:17,代码来源:SceneObjectGroup.cs
示例6: UpdateShape
/// <summary>
/// Update the shape of this part.
/// </summary>
/// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
{
IOpenRegionSettingsModule module = ParentGroup.Scene.RequestModuleInterface<IOpenRegionSettingsModule>();
if (module != null)
{
if (shapeBlock.ProfileHollow > module.MaximumHollowSize * 500 &&
module.MaximumHollowSize != -1) //This is so that it works correctly, since the packet sends (N * 500)
{
shapeBlock.ProfileHollow = (ushort)(module.MaximumHollowSize * 500);
}
if (shapeBlock.PathScaleY > (200 - (module.MinimumHoleSize * 100)) &&
module.MinimumHoleSize != -1 && shapeBlock.PathCurve == 32) //This is how the packet is set up... so this is how we check for it...
{
shapeBlock.PathScaleY = Convert.ToByte((200 - (module.MinimumHoleSize * 100)));
}
}
m_shape.PathBegin = shapeBlock.PathBegin;
m_shape.PathEnd = shapeBlock.PathEnd;
m_shape.PathScaleX = shapeBlock.PathScaleX;
m_shape.PathScaleY = shapeBlock.PathScaleY;
m_shape.PathShearX = shapeBlock.PathShearX;
m_shape.PathShearY = shapeBlock.PathShearY;
m_shape.PathSkew = shapeBlock.PathSkew;
m_shape.ProfileBegin = shapeBlock.ProfileBegin;
m_shape.ProfileEnd = shapeBlock.ProfileEnd;
m_shape.PathCurve = shapeBlock.PathCurve;
m_shape.ProfileCurve = shapeBlock.ProfileCurve;
m_shape.ProfileHollow = shapeBlock.ProfileHollow;
m_shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
m_shape.PathRevolutions = shapeBlock.PathRevolutions;
m_shape.PathTaperX = shapeBlock.PathTaperX;
m_shape.PathTaperY = shapeBlock.PathTaperY;
m_shape.PathTwist = shapeBlock.PathTwist;
m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
Shape = m_shape;
if (PhysActor != null)
{
PhysActor.Shape = m_shape;
m_parentGroup.Scene.SceneGraph.PhysicsScene.AddPhysicsActorTaint(PhysActor);
}
// This is what makes vehicle trailers work
// A script in a child prim re-issues
// llSetPrimitiveParams(PRIM_TYPE) every few seconds. That
// prevents autoreturn. This is not well known. It also works
// in SL.
//
if (ParentGroup.RootPart != this)
ParentGroup.RootPart.Rezzed = DateTime.UtcNow;
ParentGroup.HasGroupChanged = true;
ScheduleUpdate(PrimUpdateFlags.Shape);
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:61,代码来源:SceneObjectPart.cs
示例7: UpdateShape
/// <summary>
/// Update the shape of this part.
/// </summary>
/// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
{
m_shape.PathBegin = shapeBlock.PathBegin;
m_shape.PathEnd = shapeBlock.PathEnd;
m_shape.PathScaleX = shapeBlock.PathScaleX;
m_shape.PathScaleY = shapeBlock.PathScaleY;
m_shape.PathShearX = shapeBlock.PathShearX;
m_shape.PathShearY = shapeBlock.PathShearY;
m_shape.PathSkew = shapeBlock.PathSkew;
m_shape.ProfileBegin = shapeBlock.ProfileBegin;
m_shape.ProfileEnd = shapeBlock.ProfileEnd;
m_shape.PathCurve = shapeBlock.PathCurve;
m_shape.ProfileCurve = shapeBlock.ProfileCurve;
m_shape.ProfileHollow = shapeBlock.ProfileHollow;
m_shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
m_shape.PathRevolutions = shapeBlock.PathRevolutions;
m_shape.PathTaperX = shapeBlock.PathTaperX;
m_shape.PathTaperY = shapeBlock.PathTaperY;
m_shape.PathTwist = shapeBlock.PathTwist;
m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
PhysicsActor physActor = PhysActor;
if (physActor != null)
{
physActor.Shape = m_shape;
}
// We calculate mesh ServerWeight seperately on upload. Any change to the shape
// however is to a non-mesh one (there is no way to force a prim to be a mesh).
// So reset ServerWeight and StreamingCost to be 1.0 which is default for all other prims.
ServerWeight = 1.0f;
StreamingCost = 1.0f;
// This is what makes vehicle trailers work
// A script in a child prim re-issues
// llSetPrimitiveParams(PRIM_TYPE) every few seconds. That
// prevents autoreturn. This is not well known. It also works
// in SL.
//
if (ParentGroup.RootPart != this)
ParentGroup.RootPart.Rezzed = DateTime.Now;
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate(PrimUpdateFlags.Shape);
}
开发者ID:kf6kjg,项目名称:halcyon,代码行数:49,代码来源:SceneObjectPart.cs
示例8: UpdateShape
///<summary>
///</summary>
///<param name = "shapeBlock"></param>
///<param name="localID"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{
SceneObjectPart part = (SceneObjectPart) GetChildPart(localID);
if (part != null)
{
part.UpdateShape(shapeBlock);
if (part.PhysActor != null)
m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
m_ValidgrpOOB = false;
}
}
开发者ID:Gnu32,项目名称:Silverfin,代码行数:16,代码来源:SceneObjectGroup.cs
示例9: UpdateShape
/// <summary>
/// </summary>
/// <param name="shapeBlock"></param>
/// <param name="localID"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{
SceneObjectPart part = (SceneObjectPart) GetChildPart(localID);
if (part != null)
{
part.UpdateShape(shapeBlock);
m_ValidgrpOOB = false;
}
}
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:13,代码来源:SceneObjectGroup.cs
示例10: UpdateShape
/// <summary>
/// Having this function because I found when scripts updated the shape.. over and over, it would fill up the memory
/// Having the extra paramater updatePhysics can prevent physics updates on the changes
/// The onlyplace this effects is if a script changes the shape
/// If the LocklessQueue gets updated this can be removed
/// </summary>
/// <param name = "shapeBlock"></param>
/// <param name="UpdatePhysics"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, bool UpdatePhysics)
{
IOpenRegionSettingsModule module = ParentGroup.Scene.RequestModuleInterface<IOpenRegionSettingsModule>();
if (module != null)
{
if (shapeBlock.ProfileHollow > (module.MaximumHollowSize * 500) &&
module.MaximumHollowSize != -1)
//This is so that it works correctly, since the packet sends (N * 500)
{
shapeBlock.ProfileHollow = (ushort)(module.MaximumHollowSize * 500);
}
if (shapeBlock.PathScaleY > (200 - (module.MinimumHoleSize * 100)) &&
module.MinimumHoleSize != -1 && shapeBlock.PathCurve == 32)
//This is how the packet is set up... so this is how we check for it...
{
shapeBlock.PathScaleY = Convert.ToByte((200 - (module.MinimumHoleSize * 100)));
}
}
m_shape.PathBegin = shapeBlock.PathBegin;
m_shape.PathEnd = shapeBlock.PathEnd;
m_shape.PathScaleX = shapeBlock.PathScaleX;
m_shape.PathScaleY = shapeBlock.PathScaleY;
m_shape.PathShearX = shapeBlock.PathShearX;
m_shape.PathShearY = shapeBlock.PathShearY;
m_shape.PathSkew = shapeBlock.PathSkew;
m_shape.ProfileBegin = shapeBlock.ProfileBegin;
m_shape.ProfileEnd = shapeBlock.ProfileEnd;
m_shape.PathCurve = shapeBlock.PathCurve;
m_shape.ProfileCurve = shapeBlock.ProfileCurve;
m_shape.ProfileHollow = shapeBlock.ProfileHollow;
m_shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
m_shape.PathRevolutions = shapeBlock.PathRevolutions;
m_shape.PathTaperX = shapeBlock.PathTaperX;
m_shape.PathTaperY = shapeBlock.PathTaperY;
m_shape.PathTwist = shapeBlock.PathTwist;
m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
if (m_shape.SculptEntry && UpdatePhysics)
m_parentGroup.Scene.AssetService.Get(m_shape.SculptTexture.ToString(), true, AssetReceived);
else
{
Shape = m_shape;
if ((UpdatePhysics) && (PhysActor != null))
PhysActor.Shape = m_shape;
}
// This is what makes vehicle trailers work
// A script in a child prim re-issues
// llSetPrimitiveParams(PRIM_TYPE) every few seconds. That
// prevents autoreturn. This also works in SL.
if (ParentGroup.RootPart != this)
ParentGroup.RootPart.Rezzed = DateTime.UtcNow;
ValidpartOOB = false;
ParentGroup.HasGroupChanged = true;
ScheduleUpdate(PrimUpdateFlags.FullUpdate);
}
开发者ID:JAllard,项目名称:Aurora-Sim,代码行数:68,代码来源:SceneObjectPart.cs
示例11: UpdateShape
/// <summary>
///
/// </summary>
/// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
part.UpdateShape(shapeBlock);
}
}
开发者ID:zwagoth,项目名称:halcyon,代码行数:12,代码来源:SceneObjectGroup.cs
示例12: UpdateShape
public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket)
{
this.primData.PathBegin = addPacket.PathBegin;
this.primData.PathEnd = addPacket.PathEnd;
this.primData.PathScaleX = addPacket.PathScaleX;
this.primData.PathScaleY = addPacket.PathScaleY;
this.primData.PathShearX = addPacket.PathShearX;
this.primData.PathShearY = addPacket.PathShearY;
this.primData.PathSkew = addPacket.PathSkew;
this.primData.ProfileBegin = addPacket.ProfileBegin;
this.primData.ProfileEnd = addPacket.ProfileEnd;
this.primData.PathCurve = addPacket.PathCurve;
this.primData.ProfileCurve = addPacket.ProfileCurve;
this.primData.ProfileHollow = addPacket.ProfileHollow;
this.primData.PathRadiusOffset = addPacket.PathRadiusOffset;
this.primData.PathRevolutions = addPacket.PathRevolutions;
this.primData.PathTaperX = addPacket.PathTaperX;
this.primData.PathTaperY = addPacket.PathTaperY;
this.primData.PathTwist = addPacket.PathTwist;
this.primData.PathTwistBegin = addPacket.PathTwistBegin;
this.dirtyFlag = true;
}
开发者ID:BackupTheBerlios,项目名称:ulife-svn,代码行数:22,代码来源:Primitive.cs
注:本文中的ObjectShapePacket类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论