本文整理汇总了C#中ISceneChildEntity类的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity类的具体用法?C# ISceneChildEntity怎么用?C# ISceneChildEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISceneChildEntity类属于命名空间,在下文中一共展示了ISceneChildEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializeComponents
/// <summary>
/// Take the serialized string and set up the Components for this object
/// </summary>
/// <param name="obj"></param>
/// <param name="serialized"></param>
public void DeserializeComponents(ISceneChildEntity obj, string serialized)
{
//Pull the OSDMap out for components
OSDMap map;
try
{
if (serialized == "")
map = new OSDMap();
else
map = (OSDMap) OSDParser.DeserializeJson(serialized);
}
catch
{
//Bad JSON? Just return
return;
}
//Now check against the list of components we have loaded
foreach (KeyValuePair<string, OSD> kvp in map)
{
PropertyInfo property = obj.GetType().GetProperty(kvp.Key);
if (property != null)
{
property.SetValue(obj, Util.OSDToObject(kvp.Value, property.PropertyType), null);
}
}
map.Clear();
map = null;
}
示例2: GetMediaEntry
public MediaEntry GetMediaEntry(ISceneChildEntity part, int face)
{
MediaEntry me = null;
CheckFaceParam(part, face);
List<MediaEntry> media = part.Shape.Media;
if (null == media)
{
me = null;
}
else
{
lock (media)
me = media[face];
// TODO: Really need a proper copy constructor down in libopenmetaverse
if (me != null)
me = MediaEntry.FromOSD(me.GetOSD());
}
// MainConsole.Instance.DebugFormat("[MOAP]: GetMediaEntry for {0} face {1} found {2}", part.Name, face, me);
return me;
}
示例3: Initialize
public void Initialize (IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
{
m_itemID = itemID;
m_ScriptEngine = ScriptEngine;
m_host = host;
ScriptProtection = module;
}
示例4: Initialize
public void Initialize (IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
{
m_itemID = itemID;
m_ScriptEngine = ScriptEngine;
m_host = host;
ScriptProtection = module;
AssetConnector = Aurora.DataManager.DataManager.RequestPlugin<IAssetConnector>();
}
示例5: DeleteFrom
public void DeleteFrom(ISceneChildEntity Part, UUID ItemID)
{
lock (StateSaveLock)
{
//if we did remove something, resave it
if (Part.StateSaves.Remove(ItemID))
Part.ParentEntity.HasGroupChanged = true;
}
}
示例6: Initialize
public void Initialize (IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
{
m_ScriptEngine = ScriptEngine;
m_host = host;
m_localID = localID;
m_itemID = itemID;
ScriptProtection = module;
m_comms = World.RequestModuleInterface<IScriptModuleComms>();
}
示例7: Deserialization
public void Deserialization (ISceneChildEntity obj, XmlTextReader reader)
{
string components = reader.ReadElementContentAsString ("Components", string.Empty);
if (components != "") {
try {
DeserializeComponents (obj, components);
} catch (Exception ex) {
MainConsole.Instance.Warn ("[Component manager]: Error on deserializing Components! " + ex);
}
}
}
示例8: PlaybackState
public void PlaybackState (ISceneChildEntity part)
{
if (part != null)
{
part.Undoing = true;
bool ChangedScale = false;
bool ChangedPos = false;
if (part.UUID == part.ParentEntity.UUID)
{
if (Position != Vector3.Zero)
{
ChangedPos = true;
part.ParentEntity.AbsolutePosition = Position;
}
part.SetRotationOffset (true, Rotation, true);
if (Scale != Vector3.Zero)
{
ChangedScale = true;
part.Scale = Scale;
}
foreach (
ISceneChildEntity child in
part.ParentEntity.ChildrenEntities ().Where (child => child.UUID != part.UUID)) {
child.Undo (); //No updates here, child undo will do it on their own
}
} else {
if (Position != Vector3.Zero)
{
ChangedPos = true;
part.FixOffsetPosition (Position, false);
}
part.UpdateRotation (Rotation);
if (Scale != Vector3.Zero)
{
ChangedScale = true;
part.Resize (Scale);
}
}
part.Undoing = false;
var updateFlags =
(ChangedScale ? PrimUpdateFlags.Shape : PrimUpdateFlags.None) |
(ChangedPos ? PrimUpdateFlags.Position : PrimUpdateFlags.None) |
PrimUpdateFlags.Rotation;
part.ScheduleUpdate (updateFlags);
}
}
示例9: UndoState
public UndoState (ISceneChildEntity part)
{
if (part != null) {
if (part.UUID == part.ParentEntity.UUID) {
Position = part.ParentEntity.AbsolutePosition;
Rotation = part.GetRotationOffset ();
Scale = part.Shape.Scale;
} else {
Position = part.OffsetPosition;
Rotation = part.GetRotationOffset ();
Scale = part.Shape.Scale;
}
}
}
示例10: Initialize
//internal IWindLightSettingsModule m_lightShareModule;
public void Initialize(IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
{
m_ScriptEngine = ScriptEngine;
m_host = host;
m_localID = localID;
m_itemID = itemID;
ScriptProtection = module;
if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
m_LSFunctionsEnabled = true;
m_comms = World.RequestModuleInterface<IScriptModuleComms>();
if (m_comms == null)
m_LSFunctionsEnabled = false;
}
示例11: Compare
public bool Compare (ISceneChildEntity part)
{
if (part != null) {
if (part.UUID == part.ParentEntity.UUID) {
if (Position == part.AbsolutePosition && Rotation == part.GetRotationOffset () &&
Scale == part.Shape.Scale)
return true;
return false;
}
if (Position == part.OffsetPosition && Rotation == part.GetRotationOffset () &&
Scale == part.Shape.Scale)
return true;
return false;
}
return false;
}
示例12: Initialize
public void Initialize(IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID, ScriptProtectionModule module)
{
m_ScriptEngine = ScriptEngine;
m_host = host;
m_localID = localID;
m_itemID = itemID;
if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
m_OSFunctionsEnabled = true;
m_ScriptDelayFactor =
m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f);
m_ScriptDistanceFactor =
m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
ScriptProtection = module;
}
示例13: ObjectPhysicsProperties
public static OSD ObjectPhysicsProperties(ISceneChildEntity[] entities)
{
ObjectPhysicsPropertiesMessage message = new ObjectPhysicsPropertiesMessage();
#if (!ISWIN)
int i = 0;
foreach (ISceneChildEntity entity in entities)
{
if (entity != null) i++;
}
#else
int i = entities.Count(entity => entity != null);
#endif
message.ObjectPhysicsProperties = new Primitive.PhysicsProperties[i];
i = 0;
#if (!ISWIN)
foreach (ISceneChildEntity entity in entities)
{
if (entity != null)
{
message.ObjectPhysicsProperties[i] = new Primitive.PhysicsProperties
{
Density = entity.Density,
Friction = entity.Friction,
GravityMultiplier = entity.GravityMultiplier,
LocalID = entity.LocalId,
PhysicsShapeType =
(PhysicsShapeType) entity.PhysicsType,
Restitution = entity.Restitution
};
i++;
}
}
#else
foreach (ISceneChildEntity entity in entities.Where(entity => entity != null))
{
message.ObjectPhysicsProperties[i] = new Primitive.PhysicsProperties
{
Density = entity.Density,
Friction = entity.Friction,
GravityMultiplier = entity.GravityMultiplier,
LocalID = entity.LocalId,
PhysicsShapeType = (PhysicsShapeType) entity.PhysicsType,
Restitution = entity.Restitution
};
i++;
}
#endif
OSDMap m = new OSDMap {{"message", OSD.FromString("ObjectPhysicsProperties")}};
OSD message_body = message.Serialize();
m.Add("body", message_body);
return m;
}
示例14: DeleteFrom
public void DeleteFrom(ISceneChildEntity Part, UUID ItemID)
{
OSDMap component = m_manager.GetComponentState(Part, m_componentName) as OSDMap;
//Attempt to find the state saves we have
if (component != null)
{
//if we did remove something, resave it
if (component.Remove(ItemID.ToString()))
{
if (component.Count == 0)
m_manager.RemoveComponentState(Part.UUID, m_componentName);
else
m_manager.SetComponentState(Part, m_componentName, component);
Part.ParentEntity.HasGroupChanged = true;
}
}
}
示例15: TriggerScriptLandCollidingEnd
public void TriggerScriptLandCollidingEnd (ISceneChildEntity part, ColliderArgs colliders)
{
ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd;
if (handlerLandCollidingEnd != null)
{
foreach (ScriptColliding d in handlerLandCollidingEnd.GetInvocationList ())
{
try
{
d (part, colliders);
}
catch (Exception e)
{
m_log.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}",
e.ToString (), e.StackTrace);
}
}
}
}