• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Mogre类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mogre的典型用法代码示例。如果您正苦于以下问题:C# Mogre类的具体用法?C# Mogre怎么用?C# Mogre使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Mogre类属于命名空间,在下文中一共展示了Mogre类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Trigger

        public Trigger(string _shapename, Mogre.Vector3 _shapesize)
        {
            switch (_shapename)
            {
                case "box":
                    m_collision = new MogreNewt.CollisionPrimitives.Box(
                                    Core.Singleton.NewtonWorld,
                                    _shapesize,
                                    new Mogre.Quaternion(new Mogre.Radian(1.57f), new Mogre.Vector3(0, 0, 1)),
                                    Core.Singleton.GetUniqueBodyId()
                                    );
                    break;
                case "ellipsoid":
                    m_collision = new MogreNewt.CollisionPrimitives.Ellipsoid(
                                    Core.Singleton.NewtonWorld,
                                    _shapesize,
                                    new Mogre.Quaternion(new Mogre.Radian(1.57f), new Mogre.Vector3(0, 0, 1)),
                                    Core.Singleton.GetUniqueBodyId()
                                    );
                    break;
            }

            m_collision.IsTriggerVolume = true;
            m_Body = new MogreNewt.Body(Core.Singleton.NewtonWorld, m_collision, true);
            m_Body.UserData = this;
            m_Body.Type = (int)PhysicsManager.BodyTypes.TRIGGER;
            m_Body.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("Trigger");
        }
开发者ID:secred,项目名称:Tachycardia,代码行数:28,代码来源:Trigger.cs


示例2: NpcController

 public NpcController(Mogre.Node node,Mogre.Entity entity,float mass)
     : base(node, entity, mass)
 {
     m_MainBody.Type = (int)PhysicsManager.BodyTypes.NPC;
     m_MainBody.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("NPC");
     m_SecondBody.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("NPC");
 }
开发者ID:secred,项目名称:Tachycardia,代码行数:7,代码来源:NpcController.cs


示例3: GoToLocation

 /// <summary>
 /// Sends objects in the group to the given position. The objects are not sends to the same position,
 /// the positions are prepeted around the given center point.
 /// </summary>
 /// <param name="group">The moving group.</param>
 /// <param name="to">The point of the moving.</param>
 public void GoToLocation(GroupMovables group, Mogre.Vector3 to)
 {
     var destinations = PreparePositions(group.Count, to);
     foreach (IMovableGameObject imgo in group) {
         imgo.SetNextLocation(destinations[0]);
         destinations.RemoveAt(0);
     }
 }
开发者ID:vavrekmichal,项目名称:StrategyGame,代码行数:14,代码来源:MoveManager.cs


示例4: SolarSystem

 /// <summary>
 /// Initializes dictionaries and sets the name and the position at Space of the SolarSystem.
 /// </summary>
 /// <param name="name">The name of the SolarSystem.</param>
 /// <param name="position">The position of the SolarSystem.</param>
 public SolarSystem(string name, Mogre.Vector3 position)
 {
     this.name = name;
     this.position = position;
     isgoObjectDict = new Dictionary<string, IStaticGameObject>();
     imgoObjectDict = new Dictionary<string, IMovableGameObject>();
     bulletDict = new Dictionary<string, IBullet>();
 }
开发者ID:vavrekmichal,项目名称:Strategy,代码行数:13,代码来源:SolarSystem.cs


示例5: distanceBetweenPythagCartesian

 /// <summary>
 /// This is the Cartesian version of Pythagoras' theorem. In three-dimensional space,
 /// the distance between points (x1,y1,z1) and (x2,y2,z2) is
 /// http://upload.wikimedia.org/math/3/a/e/3ae1d79e0bfcc8f38223c7df4a7320c5.png
 /// which can be obtained by two consecutive applications of Pythagoras' theorem.
 /// http://en.wikipedia.org/wiki/Cartesian_coordinate_system#Distance_between_two_points
 /// the square root of (
 ///      ((point2.x - point1.x)squared) + 
 ///      ((point2.y - point1.y)squared) + 
 ///      ((point2.z - point1.z)squared)
 /// )
 /// </summary>
 public static float distanceBetweenPythagCartesian(Mogre.Vector3 point1, Mogre.Vector3 point2)
 {
     return Mogre.Math.Sqrt(
         (Mogre.Math.Sqr(point2.x - point1.x) +
         Mogre.Math.Sqr(point2.y - point1.y) +
         Mogre.Math.Sqr(point2.z - point1.z)
         ));
 }
开发者ID:andyhebear,项目名称:extramegablob,代码行数:20,代码来源:Math.cs


示例6: __gl_meshCheckMesh

        /* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
        */
        public static void __gl_meshCheckMesh(Mogre.Utils.GluTesselator.GLUmesh mesh)
        {
            Mogre.Utils.GluTesselator.GLUface fHead = mesh.fHead;
            Mogre.Utils.GluTesselator.GLUvertex vHead = mesh.vHead;
            Mogre.Utils.GluTesselator.GLUhalfEdge eHead = mesh.eHead;
            Mogre.Utils.GluTesselator.GLUface f, fPrev;
            Mogre.Utils.GluTesselator.GLUvertex v, vPrev;
            Mogre.Utils.GluTesselator.GLUhalfEdge e, ePrev;

            fPrev = fHead;
            for (fPrev = fHead; (f = fPrev.next) != fHead; fPrev = f)
            {
                //assert(f.prev == fPrev);
                e = f.anEdge;
                do
                {
                    //assert(e.Sym != e);
                    //assert(e.Sym.Sym == e);
                    //assert(e.Lnext.Onext.Sym == e);
                    //assert(e.Onext.Sym.Lnext == e);
                    //assert(e.Lface == f);
                    e = e.Lnext;
                }
                while (e != f.anEdge);
            }
            //assert(f.prev == fPrev && f.anEdge == null && f.data == null);

            vPrev = vHead;
            for (vPrev = vHead; (v = vPrev.next) != vHead; vPrev = v)
            {
                //assert(v.prev == vPrev);
                e = v.anEdge;
                do
                {
                    //assert(e.Sym != e);
                    //assert(e.Sym.Sym == e);
                    //assert(e.Lnext.Onext.Sym == e);
                    //assert(e.Onext.Sym.Lnext == e);
                    //assert(e.Org == v);
                    e = e.Onext;
                }
                while (e != v.anEdge);
            }
            //assert(v.prev == vPrev && v.anEdge == null && v.data == null);

            ePrev = eHead;
            for (ePrev = eHead; (e = ePrev.next) != eHead; ePrev = e)
            {
                //assert(e.Sym.next == ePrev.Sym);
                //assert(e.Sym != e);
                //assert(e.Sym.Sym == e);
                //assert(e.Org != null);
                //assert(e.Sym.Org != null);
                //assert(e.Lnext.Onext.Sym == e);
                //assert(e.Onext.Sym.Lnext == e);
            }
            //assert(e.Sym.next == ePrev.Sym && e.Sym == mesh.eHeadSym && e.Sym.Sym == e && e.Org == null && e.Sym.Org == null && e.Lface == null && e.Sym.Lface == null);
        }
开发者ID:agustinsantos,项目名称:mogregis3d,代码行数:60,代码来源:Mesh.cs


示例7: killtest

 public void killtest(Mogre.Vector3 position)
 {
     Mogre.OverlayManager.Singleton.GetByName("BrokenScreen").Show();
     Mogre.MaterialPtr mat = Mogre.MaterialManager.Singleton.GetByName("BrokenScreen");
     Mogre.TextureUnitState tus = mat.GetTechnique(0).GetPass(0).GetTextureUnitState(0);
     mat.GetTechnique(0).GetPass(0).SetSceneBlending(Mogre.SceneBlendType.SBT_TRANSPARENT_ALPHA);
     tus.SetAlphaOperation(Mogre.LayerBlendOperationEx.LBX_MODULATE, Mogre.LayerBlendSource.LBS_MANUAL, Mogre.LayerBlendSource.LBS_TEXTURE, 1);
     Core.Singleton.SoundDict.Play("die_01.wav", position);
 }
开发者ID:secred,项目名称:Tachycardia,代码行数:9,代码来源:GroundPlayerCallback.cs


示例8: BillboardSystem

 public BillboardSystem(SceneManager sceneManager, SceneNode worldNode, string materialName, Mogre.BillboardType type, Vector2 defaultDimension, float defaultTimeToLive)
 {
     BillboardSet = sceneManager.CreateBillboardSet();
     BillboardSet.SetMaterialName(materialName);
     BillboardSet.SetBillboardsInWorldSpace(true);
     BillboardSet.BillboardType = type;
     worldNode.AttachObject(BillboardSet);
     this.DefaultDimension = defaultDimension;
     this.DefaultTimeToLive = defaultTimeToLive;
 }
开发者ID:nigelchanyk,项目名称:Archetype,代码行数:10,代码来源:BillboardSystem.cs


示例9: FrameRenderingQueued

        public Boolean FrameRenderingQueued( Mogre.FrameEvent evt)
        {
            if( m_stateManager->getActiveState() )
                m_stateManager->getActiveState()->updateFrameEvent( evt );

            double time = evt.timeSinceLastFrame;
            ///// Bullet time tymczasowo wyci?ty
            //if( m_keyStates[OIS.KC_B] )
            //	time = 0.3 * evt.timeSinceLastFrame;
            //else
            //	time = 1.0 * evt.timeSinceLastFrame;

            double tElapsed = m_elapsed += time;
            double tUpdate = m_update;

            // loop through and update as many times as necessary (up to 10 times maximum).
            if ((tElapsed > tUpdate) && (tElapsed < (tUpdate * 10)) )
            {
                while (tElapsed > tUpdate)
                {
                    //for( std.list<TimeObserver *>.iterator it = m_TimeObservers.begin(); it != m_TimeObservers.end(); it++ )
                    //	(*it)->update( tUpdate );
                    m_stateManager->update( tUpdate );
                    tElapsed -= tUpdate;
                }
            }
            else
            {
                if (tElapsed < tUpdate)
                {
                    // not enough time has passed this loop, so ignore for now.
                }
                else
                {
                    // too much time has passed (would require more than 10 updates!), so just update once and reset.
                    // this often happens on the first frame of a game, where assets and other things were loading, then
                    // the elapsed time since the last drawn frame is very long.
                    //for( std.list<TimeObserver *>.iterator it = m_TimeObservers.begin(); it != m_TimeObservers.end(); it++ )
                    //	(*it)->update( tUpdate );
                    m_stateManager->update( tUpdate );
                    tElapsed = 0.0f; // reset the elapsed time so we don't become "eternally behind".
                }
            }

            Core.Singleton().m_elapsed = tElapsed;
            Core.Singleton().m_update = tUpdate;

            //wstrzykiwanie uplywu czasu do CEgui
            //CEGUI.System.getSingleton().injectTimePulse(evt.timeSinceLastFrame);

            return true;
        }
开发者ID:Marchew,项目名称:Tachycardia,代码行数:52,代码来源:core.cs


示例10: GetObjectProperties

        public override void GetObjectProperties(Mogre.NameValuePairList retList)
        {
            base.GetObjectProperties(retList);

            retList["MeshFile"] = this.meshFile;
            retList["CastShadows"] = Mogre.StringConverter.ToString(this.castShadows);

            for (int i = 0; i < this.subMeshes.Count; ++i)
            {
                string paramName = "SubEntity" + Mogre.StringConverter.ToString(i) + ".";
                retList[paramName + "Visible"] = Mogre.StringConverter.ToString(this.subMeshes[i].Visible);
                retList[paramName + "Material"] = this.subMeshes[i].Material;
            }
        }
开发者ID:andyhebear,项目名称:likeleon,代码行数:14,代码来源:EntityEditor.cs


示例11: SoundPlayer

        private ISound sound; // Current playing song

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes music player and randomizer. After that plays first song
        /// from file and sets event receiver.
        /// </summary>
        /// <param name="mWindow">The RenderWindow instance for making overlays</param>
        public SoundPlayer( Mogre.RenderWindow mWindow)
        {
            engine = new ISoundEngine();
            songs = Directory.GetFiles(songPath);
            r = new Random();
            this.mWindow = mWindow;
            sound = engine.Play2D(songs[0]);
            sound.setSoundStopEventReceiver(this);
            ShowCurrentPlaying(songs[current]);

            effects = new Dictionary<string, string>();
            var tempEff = Directory.GetFiles(effectPath);
            foreach (var effName in tempEff) {
                var splited = effName.Split('\\');
                effects.Add(splited[splited.Length - 1], effName);
            }
        }
开发者ID:vavrekmichal,项目名称:Strategy,代码行数:28,代码来源:SoundPlayer.cs


示例12:

        void MogitorsRoot.IDragDropHandler.OnDragDrop(DragData dragData, Mogre.Viewport vp, Mogre.Vector2 position)
        {
            if (dragData.Object != null)
            {
                Mogre.NameValuePairList parameters = new Mogre.NameValuePairList();
                dragData.Object.GetObjectProperties(parameters);
                dragData.Object.Destroy(false);
                dragData.Object = null;

                dragData.Parameters["Position"] = parameters["Position"];

                MogitorsRoot.Instance.CreateEditorObject(null, dragData.ObjectType, dragData.Parameters, true, true);
            }

            dragData.Parameters.Clear();
            dragData.ObjectType = "";
            dragData.Object = null;
        }
开发者ID:andyhebear,项目名称:likeleon,代码行数:18,代码来源:EntityView.cs


示例13: SetPhysics

        public void SetPhysics(Mogre.Entity entity, Mogre.SceneNode node, float mass)
        {
            MogreNewt.ConvexCollision collision = new MogreNewt.CollisionPrimitives.Cylinder(
                Core.Singleton.NewtonWorld,

                Core.Singleton.PhysicsManager.getCollisionCylinderRadius(entity, node),
                Core.Singleton.PhysicsManager.getCollisionCylinderHeight(entity, node),
                new Mogre.Quaternion(new Mogre.Radian(1.57f), new Mogre.Vector3(0f, 0f, 1f)),
                Core.Singleton.GetUniqueBodyId()
                );

            Mogre.Vector3 inertia, offset;
            collision.CalculateInertialMatrix(out inertia, out offset);
            inertia *= mass;

            m_Body = new MogreNewt.Body(Core.Singleton.NewtonWorld, collision, true);
            m_Body.AttachNode(node);
            m_Body.SetMassMatrix(mass, inertia);
            m_Body.SetPositionOrientation(node.Position + new Vector3(0, 1, 0), node.Orientation);
            m_Body.MaterialGroupID = Core.Singleton.PhysicsManager.getMaterialID("Metal");
        }
开发者ID:secred,项目名称:Tachycardia,代码行数:21,代码来源:Barrel.cs


示例14: PriorityQHeap

        /* really __gl_pqHeapNewPriorityQ */
        public PriorityQHeap(Mogre.Utils.GluTesselator.PriorityQ.Leq leq)
        {
            size = 0;
            max = Mogre.Utils.GluTesselator.PriorityQ.INIT_SIZE;
            nodes = new Mogre.Utils.GluTesselator.PriorityQ.PQnode[Mogre.Utils.GluTesselator.PriorityQ.INIT_SIZE + 1];
            for (int i = 0; i < nodes.Length; i++)
            {
                nodes[i] = new PQnode();
            }
            handles = new Mogre.Utils.GluTesselator.PriorityQ.PQhandleElem[Mogre.Utils.GluTesselator.PriorityQ.INIT_SIZE + 1];
            for (int i = 0; i < handles.Length; i++)
            {
                handles[i] = new PQhandleElem();
            }
            initialized = false;
            freeList = 0;
            this.leq = leq;

            nodes[1].handle = 1; /* so that Minimum() returns NULL */
            handles[1].key = null;
        }
开发者ID:agustinsantos,项目名称:mogregis3d,代码行数:22,代码来源:PriorityQHeap.cs


示例15: MatrixTransform

 //: this(towgs84, false)
 public MatrixTransform(Mogre.Matrix4 reference_frame)
 {
     //copiar reference a la matrix v
     v = new double[16];
     v[0] = reference_frame.m00;
     v[1] = reference_frame.m01;
     v[2] = reference_frame.m02;
     v[3] = reference_frame.m03;
     v[4] = reference_frame.m10;
     v[5] = reference_frame.m11;
     v[6] = reference_frame.m12;
     v[7] = reference_frame.m13;
     v[8] = reference_frame.m20;
     v[9] = reference_frame.m21;
     v[10] = reference_frame.m22;
     v[11] = reference_frame.m23;
     v[12] = reference_frame.m30;
     v[13] = reference_frame.m31;
     v[14] = reference_frame.m32;
     v[15] = reference_frame.m33;
 }
开发者ID:agustinsantos,项目名称:mogregis3d,代码行数:22,代码来源:MatrixTransform.cs


示例16: CreateObject

        public override BaseEditor CreateObject(ref BaseEditor parent, Mogre.NameValuePairList parameters)
        {
            EntityEditor editor = new EntityEditor();

            if (parameters.Find("MeshFile") == parameters.End())
                parameters["MeshFile"] = "scbCamera.mesh";

            if (parameters.Find("Init") != parameters.End())
            {
                string entName = Path.GetFileNameWithoutExtension(parameters["MeshFile"]);
                parameters["Name"] = entName + MogitorsRoot.Instance.CreateUniqueID(entName, "", -1);
            }

            editor.ProcessParameters(parameters);
            editor.Parent = parent;

            InstanceCount++;
            return editor;
        }
开发者ID:andyhebear,项目名称:likeleon,代码行数:19,代码来源:EntityEditor.cs


示例17: ProcessParameters

        public override void ProcessParameters(Mogre.NameValuePairList parameters)
        {
            base.ProcessParameters(parameters);

            Mogre.NameValuePairList.Iterator ni;

            if ((ni = parameters.Find("MeshFile")) != parameters.End())
                this.meshFile = ni.Value;

            if ((ni = parameters.Find("CastShadows")) != parameters.End())
                this.castShadows = Mogre.StringConverter.ParseBool(ni.Value);

            foreach (KeyValuePair<string, string> param in parameters)
            {
                if (!param.Key.StartsWith("SubEntity"))
                    continue;

                string valStr = param.Key;
                valStr = valStr.Remove(0, 9);

                if (valStr.EndsWith("Visible"))
                {
                    valStr = valStr.Remove(valStr.Length - 8, 8);
                    int ID = Mogre.StringConverter.ParseInt(valStr);
                    GetSubMesh(ID).Visible = Mogre.StringConverter.ParseBool(param.Value);
                }
                else if (valStr.EndsWith("Material"))
                {
                    valStr = valStr.Remove(valStr.Length - 9, 9);
                    int ID = Mogre.StringConverter.ParseInt(valStr);
                    GetSubMesh(ID).Material = param.Value;
                }
            }
        }
开发者ID:andyhebear,项目名称:likeleon,代码行数:34,代码来源:EntityEditor.cs


示例18: SceneUpdatedEventArgs

 public SceneUpdatedEventArgs(Mogre.SceneManager sceneMngr, Mogre.Camera camera, Mogre.RenderTarget renderTarget)
 {
     this.sceneMngr = sceneMngr;
     this.camera = camera;
     this.renderTarget = renderTarget;
 }
开发者ID:andyhebear,项目名称:likeleon,代码行数:6,代码来源:SceneUpdatedEventArgs.cs


示例19: PreparePositions

        /// <summary>
        /// Creates the List of positions around the given point.
        /// </summary>
        /// <param Name="count">The number of positions</param>
        /// <param Name="position">The center position</param>
        /// <returns>The List with positions around given position</returns>
        private List<Mogre.Vector3> PreparePositions(int count, Mogre.Vector3 position)
        {
            List<Mogre.Vector3> positionList = new List<Mogre.Vector3>();
            List<Mogre.Vector3> collision = new List<Mogre.Vector3>();
            Mogre.Vector3 positionToGo = position;

            for (int i = 0; i < count; i++) {
                if (collision.Contains(positionToGo)) {
                    bool isTaken = true;
                    positionToGo = position;

                    while (isTaken) {
                        if (!collision.Contains(positionToGo)) {
                            collision.Add(positionToGo);
                            isTaken = false;
                        } else {
                            positionToGo = RandomizeVector(positionToGo);
                        }
                    }
                    positionList.Add(positionToGo);
                } else {
                    collision.Add(position);
                    positionList.Add(position);
                }
            }
            return positionList;
        }
开发者ID:vavrekmichal,项目名称:StrategyGame,代码行数:33,代码来源:MoveManager.cs


示例20:

        bool MogitorsRoot.IDragDropHandler.OnDragOver(DragData dragData, Mogre.Viewport vp, Mogre.Vector2 position)
        {
            if (dragData.ObjectType == "")
                return false;

            if (dragData.Object == null)
                return true;

            Mogre.Ray mouseRay;
            mouseRay = vp.Camera.GetCameraToViewportRay(position.x, position.y);

            Mogre.Vector3 vPos = Mogre.Vector3.ZERO;
            PropertyInfo prop = dragData.Object.GetType().GetProperty("Position");
            if (prop != null)
                vPos = (Mogre.Vector3)prop.GetValue(dragData.Object, null);

            if (vPos.x == 999999 && vPos.y == 999999 && vPos.z == 999999)
                vPos = mouseRay.Origin + (mouseRay.Direction * 40.0f);
            else
                vPos = MogitorsRoot.Instance.GetGizmoIntersectCameraPlane(dragData.Object, mouseRay);

            if (prop != null)
                prop.SetValue(dragData.Object, vPos, null);

            return true;
        }
开发者ID:andyhebear,项目名称:likeleon,代码行数:26,代码来源:ObjectsView.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Money类代码示例发布时间:2022-05-24
下一篇:
C# OVAL.Definitions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap