Beispiel #1
0
        public static MediaEntrySnapshot FromMediaEntry(OpenMetaverse.MediaEntry ent)
        {
            if (ent == null)
            {
                return(null);
            }

            MediaEntrySnapshot snap = new MediaEntrySnapshot
            {
                AutoLoop              = ent.AutoLoop,
                AutoPlay              = ent.AutoPlay,
                AutoScale             = ent.AutoScale,
                AutoZoom              = ent.AutoZoom,
                ControlPermissions    = ent.ControlPermissions,
                Controls              = ent.Controls,
                CurrentURL            = ent.CurrentURL,
                EnableAlterntiveImage = ent.EnableAlterntiveImage,
                EnableWhiteList       = ent.EnableWhiteList,
                Height  = ent.Height,
                HomeURL = ent.HomeURL,
                InteractOnFirstClick = ent.InteractOnFirstClick,
                InteractPermissions  = ent.InteractPermissions,
                WhiteList            = ent.WhiteList,
                Width = ent.Width
            };

            return(snap);
        }
Beispiel #2
0
        public static MediaEntrySnapshot[] SnapshotArrayFromList(OpenSim.Framework.PrimitiveBaseShape.PrimMedia mediaList)
        {
            if (mediaList == null)
            {
                return(null);
            }

            MediaEntrySnapshot[] snapList = new MediaEntrySnapshot[mediaList.Count];

            for (int index = 0; index < mediaList.Count; index++)
            {
                snapList[index] = MediaEntrySnapshot.FromMediaEntry(mediaList[index]);
            }

            return(snapList);
        }
Beispiel #3
0
 public PrimitiveBaseShape ToPrimitiveBaseShape()
 {
     return(new PrimitiveBaseShape
     {
         ExtraParams = this.ExtraParams,
         FlexiDrag = this.FlexiDrag,
         FlexiEntry = this.FlexiEntry,
         FlexiForceX = this.FlexiForceX,
         FlexiForceY = this.FlexiForceY,
         FlexiForceZ = this.FlexiForceZ,
         FlexiGravity = this.FlexiGravity,
         FlexiSoftness = this.FlexiSoftness,
         FlexiTension = this.FlexiTension,
         FlexiWind = this.FlexiWind,
         HollowShape = this.HollowShape,
         LightColorA = this.LightColor[0],
         LightColorR = this.LightColor[1],
         LightColorG = this.LightColor[2],
         LightColorB = this.LightColor[3],
         LightCutoff = this.LightCutoff,
         LightEntry = this.LightEntry,
         LightIntensity = this.LightIntensity,
         LightRadius = this.LightRadius,
         PathBegin = this.PathBegin,
         PathCurve = this.PathCurve,
         PathEnd = this.PathEnd,
         PathRadiusOffset = this.PathRadiusOffset,
         PathRevolutions = this.PathRevolutions,
         PathScaleX = this.PathScaleX,
         PathScaleY = this.PathScaleY,
         PathShearX = this.PathShearX,
         PathShearY = this.PathShearY,
         PathSkew = this.PathSkew,
         PathTaperX = this.PathTaperX,
         PathTaperY = this.PathTaperY,
         PathTwist = this.PathTwist,
         PathTwistBegin = this.PathTwistBegin,
         PCode = this.PCode,
         PreferredPhysicsShape = this.PreferredPhysicsShape,
         ProfileBegin = this.ProfileBegin,
         ProfileCurve = this.ProfileCurve,
         ProfileEnd = this.ProfileEnd,
         ProfileHollow = this.ProfileHollow,
         ProfileShape = this.ProfileShape,
         ProjectionAmbiance = this.ProjectionAmbiance,
         ProjectionEntry = this.ProjectionEntry,
         ProjectionFocus = this.ProjectionFocus,
         ProjectionFOV = this.ProjectionFOV,
         ProjectionTextureUUID = new OpenMetaverse.UUID(this.ProjectionTextureId),
         Scale = this.Scale,
         SculptEntry = this.SculptEntry,
         SculptTexture = new OpenMetaverse.UUID(this.SculptTexture),
         SculptType = this.SculptType,
         State = this.State,
         TextureEntryBytes = this.TextureEntry,
         Media = MediaEntrySnapshot.SnapshotArrayToList(this.MediaList),
         VertexCount = this.VertexCount,
         HighLODBytes = this.HighLODBytes,
         MidLODBytes = this.MidLODBytes,
         LowLODBytes = this.LowLODBytes,
         LowestLODBytes = this.LowestLODBytes,
         RenderMaterials = this.RenderMaterials
     });
 }
Beispiel #4
0
 public static PrimShapeSnapshot FromShape(PrimitiveBaseShape primitiveBaseShape)
 {
     return(new PrimShapeSnapshot
     {
         ExtraParams = primitiveBaseShape.ExtraParams,
         FlexiDrag = primitiveBaseShape.FlexiDrag,
         FlexiEntry = primitiveBaseShape.FlexiEntry,
         FlexiForceX = primitiveBaseShape.FlexiForceX,
         FlexiForceY = primitiveBaseShape.FlexiForceY,
         FlexiForceZ = primitiveBaseShape.FlexiForceZ,
         FlexiGravity = primitiveBaseShape.FlexiGravity,
         FlexiSoftness = primitiveBaseShape.FlexiSoftness,
         FlexiTension = primitiveBaseShape.FlexiTension,
         FlexiWind = primitiveBaseShape.FlexiWind,
         HollowShape = primitiveBaseShape.HollowShape,
         LightColor = new float[] { primitiveBaseShape.LightColorA, primitiveBaseShape.LightColorR, primitiveBaseShape.LightColorG, primitiveBaseShape.LightColorB },
         LightCutoff = primitiveBaseShape.LightCutoff,
         LightEntry = primitiveBaseShape.LightEntry,
         LightIntensity = primitiveBaseShape.LightIntensity,
         LightRadius = primitiveBaseShape.LightRadius,
         PathBegin = primitiveBaseShape.PathBegin,
         PathCurve = primitiveBaseShape.PathCurve,
         PathEnd = primitiveBaseShape.PathEnd,
         PathRadiusOffset = primitiveBaseShape.PathRadiusOffset,
         PathRevolutions = primitiveBaseShape.PathRevolutions,
         PathScaleX = primitiveBaseShape.PathScaleX,
         PathScaleY = primitiveBaseShape.PathScaleY,
         PathShearX = primitiveBaseShape.PathShearX,
         PathShearY = primitiveBaseShape.PathShearY,
         PathSkew = primitiveBaseShape.PathSkew,
         PathTaperX = primitiveBaseShape.PathTaperX,
         PathTaperY = primitiveBaseShape.PathTaperY,
         PathTwist = primitiveBaseShape.PathTwist,
         PathTwistBegin = primitiveBaseShape.PathTwistBegin,
         PCode = primitiveBaseShape.PCode,
         PreferredPhysicsShape = primitiveBaseShape.PreferredPhysicsShape,
         ProfileBegin = primitiveBaseShape.ProfileBegin,
         ProfileCurve = primitiveBaseShape.ProfileCurve,
         ProfileEnd = primitiveBaseShape.ProfileEnd,
         ProfileHollow = primitiveBaseShape.ProfileHollow,
         ProfileShape = primitiveBaseShape.ProfileShape,
         ProjectionAmbiance = primitiveBaseShape.ProjectionAmbiance,
         ProjectionEntry = primitiveBaseShape.ProjectionEntry,
         ProjectionFocus = primitiveBaseShape.ProjectionFocus,
         ProjectionFOV = primitiveBaseShape.ProjectionFOV,
         ProjectionTextureId = primitiveBaseShape.ProjectionTextureUUID.Guid,
         Scale = primitiveBaseShape.Scale,
         SculptEntry = primitiveBaseShape.SculptEntry,
         SculptTexture = primitiveBaseShape.SculptTexture.Guid,
         SculptType = primitiveBaseShape.SculptType,
         State = primitiveBaseShape.State,
         TextureEntry = primitiveBaseShape.TextureEntryBytes,
         MediaList = MediaEntrySnapshot.SnapshotArrayFromList(primitiveBaseShape.Media),
         VertexCount = primitiveBaseShape.VertexCount,
         HighLODBytes = primitiveBaseShape.HighLODBytes,
         MidLODBytes = primitiveBaseShape.MidLODBytes,
         LowLODBytes = primitiveBaseShape.LowLODBytes,
         LowestLODBytes = primitiveBaseShape.LowestLODBytes,
         RenderMaterials = primitiveBaseShape.RenderMaterials
     });
 }