当前位置: 首页>>代码示例>>C#>>正文


C# SceneObjectPart.SetCameraEyeOffset方法代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.SetCameraEyeOffset方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.SetCameraEyeOffset方法的具体用法?C# SceneObjectPart.SetCameraEyeOffset怎么用?C# SceneObjectPart.SetCameraEyeOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.SetCameraEyeOffset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildPrim

        /// <summary>
        /// Builds the prim from a datarecord.
        /// </summary>
        /// <param name="primRow">datarecord</param>
        /// <returns></returns>
        private static SceneObjectPart BuildPrim(IDataRecord primRow)
        {
            SceneObjectPart prim = new SceneObjectPart();

            prim.UUID = new UUID((Guid)primRow["UUID"]);
            // explicit conversion of integers is required, which sort
            // of sucks.  No idea if there is a shortcut here or not.
            prim.CreationDate = Convert.ToInt32(primRow["CreationDate"]);
            prim.Name = (string)primRow["Name"];
            // various text fields
            prim.Text = (string)primRow["Text"];
            prim.Color = Color.FromArgb(Convert.ToInt32(primRow["ColorA"]),
                                        Convert.ToInt32(primRow["ColorR"]),
                                        Convert.ToInt32(primRow["ColorG"]),
                                        Convert.ToInt32(primRow["ColorB"]));
            prim.Description = (string)primRow["Description"];
            prim.SitName = (string)primRow["SitName"];
            prim.TouchName = (string)primRow["TouchName"];
            // permissions
            prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
            prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
            prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
            prim.GroupID = new UUID((Guid)primRow["GroupID"]);
            prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]);
            prim.OwnerMask = Convert.ToUInt32(primRow["OwnerMask"]);
            prim.NextOwnerMask = Convert.ToUInt32(primRow["NextOwnerMask"]);
            prim.GroupMask = Convert.ToUInt32(primRow["GroupMask"]);
            prim.EveryoneMask = Convert.ToUInt32(primRow["EveryoneMask"]);
            prim.BaseMask = Convert.ToUInt32(primRow["BaseMask"]);
            // vectors
            prim.OffsetPosition = new Vector3(
                                    Convert.ToSingle(primRow["PositionX"]),
                                    Convert.ToSingle(primRow["PositionY"]),
                                    Convert.ToSingle(primRow["PositionZ"]));

            prim.GroupPosition = new Vector3(
                                    Convert.ToSingle(primRow["GroupPositionX"]),
                                    Convert.ToSingle(primRow["GroupPositionY"]),
                                    Convert.ToSingle(primRow["GroupPositionZ"]));

            prim.Velocity = new Vector3(
                                Convert.ToSingle(primRow["VelocityX"]),
                                Convert.ToSingle(primRow["VelocityY"]),
                                Convert.ToSingle(primRow["VelocityZ"]));

            prim.AngularVelocity = new Vector3(
                                    Convert.ToSingle(primRow["AngularVelocityX"]),
                                    Convert.ToSingle(primRow["AngularVelocityY"]),
                                    Convert.ToSingle(primRow["AngularVelocityZ"]));

            prim.Acceleration = new Vector3(
                                Convert.ToSingle(primRow["AccelerationX"]),
                                Convert.ToSingle(primRow["AccelerationY"]),
                                Convert.ToSingle(primRow["AccelerationZ"]));

            // quaternions
            prim.RotationOffset = new Quaternion(
                                Convert.ToSingle(primRow["RotationX"]),
                                Convert.ToSingle(primRow["RotationY"]),
                                Convert.ToSingle(primRow["RotationZ"]),
                                Convert.ToSingle(primRow["RotationW"]));

            prim.SitTargetPositionLL = new Vector3(
                                Convert.ToSingle(primRow["SitTargetOffsetX"]),
                                Convert.ToSingle(primRow["SitTargetOffsetY"]),
                                Convert.ToSingle(primRow["SitTargetOffsetZ"]));

            prim.SitTargetOrientationLL = new Quaternion(
                                Convert.ToSingle(primRow["SitTargetOrientX"]),
                                Convert.ToSingle(primRow["SitTargetOrientY"]),
                                Convert.ToSingle(primRow["SitTargetOrientZ"]),
                                Convert.ToSingle(primRow["SitTargetOrientW"]));

            prim.PayPrice[0] = Convert.ToInt32(primRow["PayPrice"]);
            prim.PayPrice[1] = Convert.ToInt32(primRow["PayButton1"]);
            prim.PayPrice[2] = Convert.ToInt32(primRow["PayButton2"]);
            prim.PayPrice[3] = Convert.ToInt32(primRow["PayButton3"]);
            prim.PayPrice[4] = Convert.ToInt32(primRow["PayButton4"]);

            prim.Sound = new UUID((Guid)primRow["LoopedSound"]);
            prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]);
            prim.SoundFlags = 1; // If it's persisted at all, it's looped

            if (!(primRow["TextureAnimation"] is DBNull))
                prim.TextureAnimation = (Byte[])primRow["TextureAnimation"];
            if (!(primRow["ParticleSystem"] is DBNull))
                prim.ParticleSystem = (Byte[])primRow["ParticleSystem"];

            prim.AngularVelocity = new Vector3(
                                        Convert.ToSingle(primRow["OmegaX"]),
                                        Convert.ToSingle(primRow["OmegaY"]),
                                        Convert.ToSingle(primRow["OmegaZ"]));

            prim.SetCameraEyeOffset(new Vector3(
                                        Convert.ToSingle(primRow["CameraEyeOffsetX"]),
//.........这里部分代码省略.........
开发者ID:openmetaversefoundation,项目名称:fortis-opensim,代码行数:101,代码来源:MSSQLSimulationData.cs

示例2: BuildPrim

        /// <summary>
        /// Builds the prim from a datarecord.
        /// </summary>
        /// <param name="primRow">datarecord</param>
        /// <returns></returns>
        private static SceneObjectPart BuildPrim(IDataRecord primRow)
        {
            SceneObjectPart prim = new SceneObjectPart();

            prim.UUID = new UUID((Guid)primRow["UUID"]);
            // explicit conversion of integers is required, which sort
            // of sucks.  No idea if there is a shortcut here or not.
            prim.CreationDate = Convert.ToInt32(primRow["CreationDate"]);
            prim.Name = (string)primRow["Name"];
            // various text fields
            prim.Text = (string)primRow["Text"];
            prim.Color = Color.FromArgb(Convert.ToInt32(primRow["ColorA"]),
                                        Convert.ToInt32(primRow["ColorR"]),
                                        Convert.ToInt32(primRow["ColorG"]),
                                        Convert.ToInt32(primRow["ColorB"]));
            prim.Description = (string)primRow["Description"];
            prim.SitName = (string)primRow["SitName"];
            prim.TouchName = (string)primRow["TouchName"];
            // permissions
            prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
            //prim.creatorID = new UUID((Guid)primRow["creatorID"]);
            prim.CreatorIdentification = (string)primRow["CreatorID"].ToString();
            prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
            prim.GroupID = new UUID((Guid)primRow["GroupID"]);
            prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]);
            prim.OwnerMask = Convert.ToUInt32(primRow["OwnerMask"]);
            prim.NextOwnerMask = Convert.ToUInt32(primRow["NextOwnerMask"]);
            prim.GroupMask = Convert.ToUInt32(primRow["GroupMask"]);
            prim.EveryoneMask = Convert.ToUInt32(primRow["EveryoneMask"]);
            prim.BaseMask = Convert.ToUInt32(primRow["BaseMask"]);
            // vectors
            prim.OffsetPosition = new Vector3(
                                    Convert.ToSingle(primRow["PositionX"]),
                                    Convert.ToSingle(primRow["PositionY"]),
                                    Convert.ToSingle(primRow["PositionZ"]));

            prim.GroupPosition = new Vector3(
                                    Convert.ToSingle(primRow["GroupPositionX"]),
                                    Convert.ToSingle(primRow["GroupPositionY"]),
                                    Convert.ToSingle(primRow["GroupPositionZ"]));

            prim.Velocity = new Vector3(
                                Convert.ToSingle(primRow["VelocityX"]),
                                Convert.ToSingle(primRow["VelocityY"]),
                                Convert.ToSingle(primRow["VelocityZ"]));

            prim.AngularVelocity = new Vector3(
                                    Convert.ToSingle(primRow["AngularVelocityX"]),
                                    Convert.ToSingle(primRow["AngularVelocityY"]),
                                    Convert.ToSingle(primRow["AngularVelocityZ"]));

            prim.Acceleration = new Vector3(
                                Convert.ToSingle(primRow["AccelerationX"]),
                                Convert.ToSingle(primRow["AccelerationY"]),
                                Convert.ToSingle(primRow["AccelerationZ"]));

            // quaternions
            prim.RotationOffset = new Quaternion(
                                Convert.ToSingle(primRow["RotationX"]),
                                Convert.ToSingle(primRow["RotationY"]),
                                Convert.ToSingle(primRow["RotationZ"]),
                                Convert.ToSingle(primRow["RotationW"]));

            prim.SitTargetPositionLL = new Vector3(
                                Convert.ToSingle(primRow["SitTargetOffsetX"]),
                                Convert.ToSingle(primRow["SitTargetOffsetY"]),
                                Convert.ToSingle(primRow["SitTargetOffsetZ"]));

            prim.SitTargetOrientationLL = new Quaternion(
                                Convert.ToSingle(primRow["SitTargetOrientX"]),
                                Convert.ToSingle(primRow["SitTargetOrientY"]),
                                Convert.ToSingle(primRow["SitTargetOrientZ"]),
                                Convert.ToSingle(primRow["SitTargetOrientW"]));

            prim.PayPrice[0] = Convert.ToInt32(primRow["PayPrice"]);
            prim.PayPrice[1] = Convert.ToInt32(primRow["PayButton1"]);
            prim.PayPrice[2] = Convert.ToInt32(primRow["PayButton2"]);
            prim.PayPrice[3] = Convert.ToInt32(primRow["PayButton3"]);
            prim.PayPrice[4] = Convert.ToInt32(primRow["PayButton4"]);

            prim.Sound = new UUID((Guid)primRow["LoopedSound"]);
            prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]);
            prim.SoundFlags = 1; // If it's persisted at all, it's looped

            if (!(primRow["TextureAnimation"] is DBNull))
                prim.TextureAnimation = (Byte[])primRow["TextureAnimation"];
            if (!(primRow["ParticleSystem"] is DBNull))
                prim.ParticleSystem = (Byte[])primRow["ParticleSystem"];

            prim.AngularVelocity = new Vector3(
                                        Convert.ToSingle(primRow["OmegaX"]),
                                        Convert.ToSingle(primRow["OmegaY"]),
                                        Convert.ToSingle(primRow["OmegaZ"]));

            prim.SetCameraEyeOffset(new Vector3(
//.........这里部分代码省略.........
开发者ID:TomDataworks,项目名称:opensim,代码行数:101,代码来源:PGSQLSimulationData.cs

示例3: buildPrim


//.........这里部分代码省略.........
                Convert.ToSingle(row["VelocityX"]),
                Convert.ToSingle(row["VelocityY"]),
                Convert.ToSingle(row["VelocityZ"])
                );
            prim.AngularVelocity = new Vector3(
                Convert.ToSingle(row["AngularVelocityX"]),
                Convert.ToSingle(row["AngularVelocityY"]),
                Convert.ToSingle(row["AngularVelocityZ"])
                );
            prim.Acceleration = new Vector3(
                Convert.ToSingle(row["AccelerationX"]),
                Convert.ToSingle(row["AccelerationY"]),
                Convert.ToSingle(row["AccelerationZ"])
                );
            // quaternions
            prim.RotationOffset = new Quaternion(
                Convert.ToSingle(row["RotationX"]),
                Convert.ToSingle(row["RotationY"]),
                Convert.ToSingle(row["RotationZ"]),
                Convert.ToSingle(row["RotationW"])
                );

            prim.SitTargetPositionLL = new Vector3(
                                                   Convert.ToSingle(row["SitTargetOffsetX"]),
                                                   Convert.ToSingle(row["SitTargetOffsetY"]),
                                                   Convert.ToSingle(row["SitTargetOffsetZ"]));
            prim.SitTargetOrientationLL = new Quaternion(
                                                         Convert.ToSingle(
                                                                          row["SitTargetOrientX"]),
                                                         Convert.ToSingle(
                                                                          row["SitTargetOrientY"]),
                                                         Convert.ToSingle(
                                                                          row["SitTargetOrientZ"]),
                                                         Convert.ToSingle(
                                                                          row["SitTargetOrientW"]));

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

            prim.Sound = new UUID(row["LoopedSound"].ToString());
            prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]);
            prim.SoundFlags = 1; // If it's persisted at all, it's looped

            if (!row.IsNull("TextureAnimation"))
                prim.TextureAnimation = Convert.FromBase64String(row["TextureAnimation"].ToString());
            if (!row.IsNull("ParticleSystem"))
                prim.ParticleSystem = Convert.FromBase64String(row["ParticleSystem"].ToString());

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

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

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

            if (Convert.ToInt16(row["ForceMouselook"]) != 0)
                prim.SetForceMouselook(true);

            prim.ScriptAccessPin = Convert.ToInt32(row["ScriptAccessPin"]);

            if (Convert.ToInt16(row["AllowedDrop"]) != 0)
                prim.AllowedDrop = true;

            if (Convert.ToInt16(row["DieAtEdge"]) != 0)
                prim.DIE_AT_EDGE = true;

            prim.SalePrice = Convert.ToInt32(row["SalePrice"]);
            prim.ObjectSaleType = Convert.ToByte(row["SaleType"]);

            prim.Material = Convert.ToByte(row["Material"]);

            prim.CollisionSound = new UUID(row["CollisionSound"].ToString());
            prim.CollisionSoundVolume = Convert.ToSingle(row["CollisionSoundVolume"]);

            if (Convert.ToInt16(row["VolumeDetect"]) != 0)
                prim.VolumeDetectActive = true;

            if (!(row["MediaURL"] is System.DBNull))
            {
//                m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
                prim.MediaUrl = (string)row["MediaURL"];
            }

            return prim;
        }
开发者ID:p07r0457,项目名称:opensim,代码行数:101,代码来源:SQLiteSimulationData.cs

示例4: BuildPrim


//.........这里部分代码省略.........

            // 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.LinkNum = (int)row["LinkNumber"];

            return prim;
        }
开发者ID:AlexRa,项目名称:opensim-mods-Alex,代码行数:101,代码来源:MySQLLegacyRegionData.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectPart.SetCameraEyeOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。