OpenSim.Region.Framework.Scenes.SceneObjectPart.SetCameraEyeOffset C# (CSharp) Method

SetCameraEyeOffset() public method

public SetCameraEyeOffset ( Vector3 v ) : void
v Vector3
return void
        public void SetCameraEyeOffset(Vector3 v)
        {
            m_cameraEyeOffset = v;
        }

Usage Example

コード例 #1
0
        private SceneObjectPart BuildPrim(IDataReader row)
        {
            SceneObjectPart prim = new SceneObjectPart();

            // depending on the MySQL connector version, CHAR(36) may be already converted to Guid! 
            prim.UUID = DBGuid.FromDB(row["UUID"]);
            prim.CreatorIdentification = (string)row["CreatorID"];
            prim.OwnerID = DBGuid.FromDB(row["OwnerID"]);
            prim.GroupID = DBGuid.FromDB(row["GroupID"]);
            prim.LastOwnerID = DBGuid.FromDB(row["LastOwnerID"]);
            if (row["RezzerID"] != DBNull.Value)
                prim.RezzerID = DBGuid.FromDB(row["RezzerID"]);
            else
                prim.RezzerID = UUID.Zero;

            // explicit conversion of integers is required, which sort
            // of sucks.  No idea if there is a shortcut here or not.
            prim.CreationDate = (int)row["CreationDate"];
            if (row["Name"] != DBNull.Value)
                prim.Name = (string)row["Name"];
            else
                prim.Name = String.Empty;
            // Various text fields
            prim.Text = (string)row["Text"];
            prim.Color = Color.FromArgb((int)row["ColorA"],
                                        (int)row["ColorR"],
                                        (int)row["ColorG"],
                                        (int)row["ColorB"]);
            prim.Description = (string)row["Description"];
            prim.SitName = (string)row["SitName"];
            prim.TouchName = (string)row["TouchName"];
            // Permissions
            prim.Flags = (PrimFlags)(int)row["ObjectFlags"];
            prim.OwnerMask = (uint)(int)row["OwnerMask"];
            prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"];
            prim.GroupMask = (uint)(int)row["GroupMask"];
            prim.EveryoneMask = (uint)(int)row["EveryoneMask"];
            prim.BaseMask = (uint)(int)row["BaseMask"];

            // Vectors
            prim.OffsetPosition = new Vector3(
                (float)(double)row["PositionX"],
                (float)(double)row["PositionY"],
                (float)(double)row["PositionZ"]
                );
            prim.GroupPosition = new Vector3(
                (float)(double)row["GroupPositionX"],
                (float)(double)row["GroupPositionY"],
                (float)(double)row["GroupPositionZ"]
                );
            prim.Velocity = new Vector3(
                (float)(double)row["VelocityX"],
                (float)(double)row["VelocityY"],
                (float)(double)row["VelocityZ"]
                );
            prim.AngularVelocity = new Vector3(
                (float)(double)row["AngularVelocityX"],
                (float)(double)row["AngularVelocityY"],
                (float)(double)row["AngularVelocityZ"]
                );
            prim.Acceleration = new Vector3(
                (float)(double)row["AccelerationX"],
                (float)(double)row["AccelerationY"],
                (float)(double)row["AccelerationZ"]
                );
            // quaternions
            prim.RotationOffset = new Quaternion(
                (float)(double)row["RotationX"],
                (float)(double)row["RotationY"],
                (float)(double)row["RotationZ"],
                (float)(double)row["RotationW"]
                );
            prim.SitTargetPositionLL = new Vector3(
                (float)(double)row["SitTargetOffsetX"],
                (float)(double)row["SitTargetOffsetY"],
                (float)(double)row["SitTargetOffsetZ"]
                );
            prim.SitTargetOrientationLL = new Quaternion(
                (float)(double)row["SitTargetOrientX"],
                (float)(double)row["SitTargetOrientY"],
                (float)(double)row["SitTargetOrientZ"],
                (float)(double)row["SitTargetOrientW"]
                );

            prim.PayPrice[0] = (int)row["PayPrice"];
            prim.PayPrice[1] = (int)row["PayButton1"];
            prim.PayPrice[2] = (int)row["PayButton2"];
            prim.PayPrice[3] = (int)row["PayButton3"];
            prim.PayPrice[4] = (int)row["PayButton4"];

            prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString());
            prim.SoundGain = (float)(double)row["LoopedSoundGain"];
            prim.SoundFlags = 1; // If it's persisted at all, it's looped

            if (!(row["TextureAnimation"] is DBNull))
                prim.TextureAnimation = (byte[])row["TextureAnimation"];
            if (!(row["ParticleSystem"] is DBNull))
                prim.ParticleSystem = (byte[])row["ParticleSystem"];

            prim.AngularVelocity = new Vector3(
                (float)(double)row["OmegaX"],
                (float)(double)row["OmegaY"],
                (float)(double)row["OmegaZ"]
                );

            prim.SetCameraEyeOffset(new Vector3(
                (float)(double)row["CameraEyeOffsetX"],
                (float)(double)row["CameraEyeOffsetY"],
                (float)(double)row["CameraEyeOffsetZ"]
                ));

            prim.SetCameraAtOffset(new Vector3(
                (float)(double)row["CameraAtOffsetX"],
                (float)(double)row["CameraAtOffsetY"],
                (float)(double)row["CameraAtOffsetZ"]
                ));

            prim.SetForceMouselook((sbyte)row["ForceMouselook"] != 0);
            prim.ScriptAccessPin = (int)row["ScriptAccessPin"];
            prim.AllowedDrop = ((sbyte)row["AllowedDrop"] != 0);
            prim.DIE_AT_EDGE = ((sbyte)row["DieAtEdge"] != 0);

            prim.SalePrice = (int)row["SalePrice"];
            prim.ObjectSaleType = unchecked((byte)(sbyte)row["SaleType"]);

            prim.Material = unchecked((byte)(sbyte)row["Material"]);

            if (!(row["ClickAction"] is DBNull))
                prim.ClickAction = unchecked((byte)(sbyte)row["ClickAction"]);

            prim.CollisionSound = DBGuid.FromDB(row["CollisionSound"]);
            prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"];
            
            prim.PassTouches = ((sbyte)row["PassTouches"] != 0);
            prim.PassCollisions = ((sbyte)row["PassCollisions"] != 0);
            prim.LinkNum = (int)row["LinkNumber"];
            
            if (!(row["MediaURL"] is System.DBNull))
                prim.MediaUrl = (string)row["MediaURL"];

            if (!(row["AttachedPosX"] is System.DBNull))
            {
                prim.AttachedPos = new Vector3(
                    (float)(double)row["AttachedPosX"],
                    (float)(double)row["AttachedPosY"],
                    (float)(double)row["AttachedPosZ"]
                    );
            }

            if (!(row["DynAttrs"] is System.DBNull))
                prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
            else
                prim.DynAttrs = new DAMap();        

            if (!(row["KeyframeMotion"] is DBNull))
            {
                Byte[] data = (byte[])row["KeyframeMotion"];
                if (data.Length > 0)
                    prim.KeyframeMotion = KeyframeMotion.FromData(null, data);
                else
                    prim.KeyframeMotion = null;
            }
            else
            {
                prim.KeyframeMotion = null;
            }

            prim.PhysicsShapeType = (byte)Convert.ToInt32(row["PhysicsShapeType"].ToString());
            prim.Density = (float)(double)row["Density"];
            prim.GravityModifier = (float)(double)row["GravityModifier"];
            prim.Friction = (float)(double)row["Friction"];
            prim.Restitution = (float)(double)row["Restitution"];
            prim.RotationAxisLocks = (byte)Convert.ToInt32(row["RotationAxisLocks"].ToString());

            SOPVehicle vehicle = null;

            if (row["Vehicle"].ToString() != String.Empty)
            {
                vehicle = SOPVehicle.FromXml2(row["Vehicle"].ToString());
                if (vehicle != null)
                    prim.VehicleParams = vehicle;
            }

            return prim;
        }
All Usage Examples Of OpenSim.Region.Framework.Scenes.SceneObjectPart::SetCameraEyeOffset
SceneObjectPart