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

C# Framework.GameSettings类代码示例

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

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



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

示例1: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            if (StepCount == 12)
            {
                StepCount += 0;
            }

            base.Update(settings, gameTime);

            if (Distance.GJKCalls > 0)
            {
                DebugView.DrawString(50, TextLine, "GJK calls = {0}, Ave GJK iters = {1}, Max GJK iters = {2}",
                                     Distance.GJKCalls, Distance.GJKIters / (float)Distance.GJKCalls,
                                     Distance.GJKMaxIters);
                TextLine += 15;
            }

            if (TimeOfImpact.TOICalls > 0)
            {
                DebugView.DrawString(50, TextLine, "TOI calls = {0}, Ave TOI iters = {1}, Max TOI iters = {2}",
                                     TimeOfImpact.TOICalls, TimeOfImpact.TOIIters / (float)TimeOfImpact.TOICalls,
                                     TimeOfImpact.TOIMaxRootIters);
                TextLine += 15;

                DebugView.DrawString(50, TextLine, "Ave TOI root iters = {0}, Max TOI root iters = {1}",
                                     TimeOfImpact.TOIRootIters / (float)TimeOfImpact.TOICalls,
                                     TimeOfImpact.TOIMaxRootIters);
                TextLine += 15;
            }

            if (StepCount % 60 == 0)
            {
                //Launch();
            }
        }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:35,代码来源:ContinuousTest.cs


示例2: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            PolygonShape shape = new PolygonShape(new Vertices(_points), 0f);

            DebugView.DrawString(5, TextLine, "Press g to generate a new random convex hull");
            TextLine += 15;

            DebugView.BeginCustomDraw(ref GameInstance.Projection, ref GameInstance.View);
            DebugView.DrawPolygon(shape.Vertices.ToArray(), shape.Vertices.Count, new Color(0.9f, 0.9f, 0.9f));

            for (int i = 0; i < _count; ++i)
            {
                DebugView.DrawPoint(_points[i], 0.1f, new Color(0.9f, 0.5f, 0.5f));
                Vector2 position = GameInstance.ConvertWorldToScreen(_points[i]);
                DebugView.DrawString((int)position.X, (int)position.Y, i.ToString());
            }

            DebugView.EndCustomDraw();

            if (shape.Vertices.IsConvex() == false)
            {
                TextLine += 0;
            }

            if (_auto)
            {
                Generate();
            }
        }
开发者ID:boris2,项目名称:mmogameproject2,代码行数:31,代码来源:ConvexHullTest.cs


示例3: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            Manifold manifold = new Manifold();
            Collision.Collision.CollidePolygons(ref manifold, _polygonA, ref _transformA, _polygonB, ref _transformB);

            Vector2 normal;
            FixedArray2<Vector2> points;
            Collision.Collision.GetWorldManifold(ref manifold, ref _transformA, _polygonA.Radius,
                                                 ref _transformB, _polygonB.Radius, out normal, out points);

            DebugView.DrawString(50, TextLine, "Point count = {0:n0}", manifold.PointCount);
            TextLine += 15;
            DebugView.BeginCustomDraw();
            {
                Color color = new Color(0.9f, 0.9f, 0.9f);
                Vector2[] v = new Vector2[Settings.MaxPolygonVertices];
                for (int i = 0; i < _polygonA.Vertices.Count; ++i)
                {
                    v[i] = MathUtils.Multiply(ref _transformA, _polygonA.Vertices[i]);
                }
                DebugView.DrawPolygon(v, _polygonA.Vertices.Count, color);

                for (int i = 0; i < _polygonB.Vertices.Count; ++i)
                {
                    v[i] = MathUtils.Multiply(ref _transformB, _polygonB.Vertices[i]);
                }
                DebugView.DrawPolygon(v, _polygonB.Vertices.Count, color);
            }

            for (int i = 0; i < manifold.PointCount; ++i)
            {
                DebugView.DrawPoint(points[i], 0.1f, new Color(0.9f, 0.3f, 0.3f));
            }
            DebugView.EndCustomDraw();
        }
开发者ID:Karunp,项目名称:cocos2d-xna,代码行数:35,代码来源:PolyCollisionTest.cs


示例4: Update

 public override void Update(GameSettings settings, GameTime gameTime)
 {
     base.Update(settings, gameTime);
     DebugView.DrawString(50, TextLine,
                          "Segments: " + _segments +
                          "\nPress: 'A' to increase segments, 'S' decrease segments\n'D' to create rectangle. 'F' to create capsule.");
     TextLine += 15;
 }
开发者ID:danielselnick,项目名称:Geometric-Replication,代码行数:8,代码来源:RoundedRectangle.cs


示例5: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            Body body = BodyFactory.CreateCircle(World, 0.4f, 1);
            body.Position = new Vector2(Rand.RandomFloat(-35, 35), 10);
            body.BodyType = BodyType.Dynamic;
            body.Restitution = 1f;

            base.Update(settings, gameTime);
        }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:9,代码来源:DeletionTest.cs


示例6: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            float ratio = _joint1.Ratio;
            float l = _joint1.LengthA + ratio * _joint1.LengthB;
            DebugView.DrawString(50, TextLine, "L1 + {0:n} * L2 = {1:n}", ratio, l);
            TextLine += 15;
        }
开发者ID:hilts-vaughan,项目名称:Farseer-Physics,代码行数:9,代码来源:PulleysTest.cs


示例7: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            _time += 0.01f;
            if (_time > 1f)
                _time = 0;

            PathManager.MoveBodyOnPath(_path, _movingBody, _time, 1f, 1f / 60f);

            base.Update(settings, gameTime);
        }
开发者ID:danzel,项目名称:FarseerPhysics,代码行数:10,代码来源:PathTest.cs


示例8: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            if (_count < Count)
            {
                Body box = BodyFactory.CreateRectangle(World, 0.125f * 2, 0.125f * 2, 1, new Vector2(0, 10));
                box.BodyType = BodyType.Dynamic;
                ++_count;
            }
        }
开发者ID:boris2,项目名称:mmogameproject2,代码行数:11,代码来源:TumblerTest.cs


示例9: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            DebugView.DrawString(50, TextLine,
                                 "SimpleWindForce | Mouse: Direction | Left-Click: Position | W/S: Variation");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Wind Strength:" + _simpleWind.Strength);
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Variation:" + _simpleWind.Variation);

            DebugView.BeginCustomDraw();
            //DebugView.DrawSegment(SimpleWind.Position, SimpleWind.Direction-SimpleWind.Position, Color.Red);
            DrawPointForce();
            DebugView.EndCustomDraw();
            base.Update(settings, gameTime);
        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:15,代码来源:SimpleWindForceTest.cs


示例10: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            DistanceInput input = new DistanceInput();
            input.ProxyA.Set(_polygonA, 0);
            input.ProxyB.Set(_polygonB, 0);
            input.TransformA = _transformA;
            input.TransformB = _transformB;
            input.UseRadii = true;
            SimplexCache cache;
            cache.Count = 0;
            DistanceOutput output;
            Distance.ComputeDistance(out output, out cache, input);

            DebugView.DrawString(50, TextLine, "Distance = {0:n7}", output.Distance);
            TextLine += 15;

            DebugView.DrawString(50, TextLine, "Iterations = {0:n0}", output.Iterations);
            TextLine += 15;

            DebugView.BeginCustomDraw();
            {
                Color color = new Color(0.9f, 0.9f, 0.9f);
                CCVector2[] v = new CCVector2[Settings.MaxPolygonVertices];
                for (int i = 0; i < _polygonA.Vertices.Count; ++i)
                {
                    v[i] = (CCVector2)MathUtils.Multiply(ref _transformA, _polygonA.Vertices[i]);
                }
				DebugView.DrawPolygon(v, _polygonA.Vertices.Count, color);

                for (int i = 0; i < _polygonB.Vertices.Count; ++i)
                {
                    v[i] = (CCVector2)MathUtils.Multiply(ref _transformB, _polygonB.Vertices[i]);
                }
				DebugView.DrawPolygon(v, _polygonB.Vertices.Count, color);
            }

            Vector2 x1 = output.PointA;
            Vector2 x2 = output.PointB;


            DebugView.DrawPoint(x1, 0.5f, new Color(1.0f, 0.0f, 0.0f));
            DebugView.DrawPoint(x2, 0.5f, new Color(1.0f, 0.0f, 0.0f));

            DebugView.DrawSegment(x1, x2, new Color(1.0f, 1.0f, 0.0f));
            DebugView.EndCustomDraw();
        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:48,代码来源:DistanceTest.cs


示例11: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            DebugView.DrawString(50, TextLine, "Press A,S,W,D move endpoint");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Press Enter to cut");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Press TAB to change endpoint");
            TextLine += 15;

            DebugView.BeginCustomDraw();
            DebugView.DrawSegment(_start, _end, Color.Red);
            DebugView.EndCustomDraw();

            List<Fixture> fixtures = new List<Fixture>();
            List<Vector2> entryPoints = new List<Vector2>();
            List<Vector2> exitPoints = new List<Vector2>();

            //Get the entry points
            World.RayCast((f, p, n, fr) =>
                              {
                                  fixtures.Add(f);
                                  entryPoints.Add(p);
                                  return 1;
                              }, _start, _end);

            //Reverse the ray to get the exitpoints
            World.RayCast((f, p, n, fr) =>
                              {
                                  exitPoints.Add(p);
                                  return 1;
                              }, _end, _start);

            DebugView.DrawString(50, TextLine, "Fixtures: " + fixtures.Count);

            DebugView.BeginCustomDraw();
            foreach (Vector2 entryPoint in entryPoints)
            {
                DebugView.DrawPoint(entryPoint, 0.5f, Color.Yellow);
            }

            foreach (Vector2 exitPoint in exitPoints)
            {
                DebugView.DrawPoint(exitPoint, 0.5f, Color.PowderBlue);
            }
            DebugView.EndCustomDraw();

            base.Update(settings, gameTime);
        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:48,代码来源:CuttingTest.cs


示例12: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            if (m_Count < Count)
            {
                var body = BodyFactory.CreateBody(World, new Vector2(0.0f, 10.0f));
                body.BodyType = BodyType.Dynamic;
                
                PolygonShape shape = new PolygonShape(5);
                shape.SetAsBox(0.125f, 0.125f);

                body.CreateFixture(shape);

                m_Count++;
            }
        }
开发者ID:Karunp,项目名称:cocos2d-xna,代码行数:17,代码来源:Tumbler.cs


示例13: Update

		public override void Update(GameSettings settings, GameTime gameTime)
		{
			base.Update(settings, gameTime);
			
			
			if (!settings.Pause && settings.Hz > 0.0f)
				_time += 1.0f / settings.Hz;
			
			Vector2 linearOffset = new Vector2();
			linearOffset.X = 6.0f * (float)Math.Sin(2.0f * _time);
			linearOffset.Y = 8.0f + 4.0f * (float)Math.Sin(1.0f * _time);
			
			float angularOffset = 4.0f * _time;
			
			_joint.LinearOffset = linearOffset;
			_joint.AngularOffset = angularOffset;
		}
开发者ID:netonjm,项目名称:Rube.Net,代码行数:17,代码来源:TestDemos.cs


示例14: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            time += gameTime.ElapsedGameTime.Milliseconds;

            if (time > 100)
            {
                time = 0;
                if (save)
                {
                    WorldSerializer.Serialize(World, "out.xml");
                }
                else
                {
                    WorldSerializer.Deserialize(World, "out.xml");
                }

                save = !save;
            }
            base.Update(settings, gameTime);
        }
开发者ID:danzel,项目名称:FarseerPhysics,代码行数:20,代码来源:SerializationTest.cs


示例15: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            _count++;

            if (_count < 50)
            {
                const float x = 0;
                const float y = 15;

                Body body = BodyFactory.CreateBody(World);

                body.Position = new Vector2(x, y);
                body.BodyType = BodyType.Dynamic;

                Fixture fixture = body.CreateFixture(_polyShape);
                fixture.Friction = 0.3f;
            }

            base.Update(settings, gameTime);
        }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:20,代码来源:EdgeShapeBenchmark.cs


示例16: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            DebugView.DrawString(50, TextLine, "Press: left mouse button to remove at mouse position.");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Press: (A) to decrease the removal radius, (S) to increase it.");
            TextLine += 15;
            // Fighting against float decimals
            float radiusnumber = (float)((int)(Radius * 10)) / 10;
            DebugView.DrawString(50, TextLine, "Radius: " + radiusnumber);

            Color color = new Color(0.4f, 0.7f, 0.8f);

            //Transform shape to mouseposition and then draw
            Vertices tempshape = new Vertices(_clipCircle);
            tempshape.Translate(ref _mousePos);
            DebugView.BeginCustomDraw();
            DebugView.DrawPolygon(tempshape.ToArray(), _clipCircle.Count, color);
            DebugView.EndCustomDraw();
        }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:21,代码来源:DestructibleTerrainYuPengTest.cs


示例17: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            Vector2 min = -new Vector2(10);
            Vector2 max = new Vector2(10);

            AABB affected = new AABB(ref min, ref max);
            Fixture fix = null;
            World.QueryAABB(fixture =>
                                {
                                    fix = fixture;
                                    return true;
                                }, ref affected);

            //DebugView.BeginCustomDraw(ref GameInstance.Projection, ref GameInstance.View);
            //if (fix != null)
            //    DebugView.DrawPoint(fix.Body.Position, 1, Color.Red);

            //DebugView.DrawAABB(ref affected, Color.AliceBlue);
            //DebugView.EndCustomDraw();

            base.Update(settings, gameTime);
        }
开发者ID:boris2,项目名称:mmogameproject2,代码行数:22,代码来源:SensorTest.cs


示例18: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            DebugView.DrawString(50, TextLine, "Melkman: Red");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Giftwrap: Green");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "ChainHull: Blue");
            TextLine += 15;

            DebugView.BeginCustomDraw();
            for (int i = 0; i < 32; i++)
            {
                DebugView.DrawPoint(_pointCloud1[i], 0.1f, Color.Yellow);
                DebugView.DrawPoint(_pointCloud2[i], 0.1f, Color.Yellow);
                DebugView.DrawPoint(_pointCloud3[i], 0.1f, Color.Yellow);
            }

            var vector2List = new List<CCVector2>();
            foreach (var v in _melkman)
                vector2List.Add((CCVector2)v);

			DebugView.DrawPolygon(vector2List.ToArray(), _melkman.Count, Color.Red);

            vector2List.Clear();
            foreach (var v in _giftWrap)
                vector2List.Add((CCVector2)v);
            DebugView.DrawPolygon(vector2List.ToArray(), _giftWrap.Count, Color.Green);

            vector2List.Clear();
            foreach (var v in _chainHull)
                vector2List.Add((CCVector2)v);

            DebugView.DrawPolygon(vector2List.ToArray(), _chainHull.Count, Color.Blue);
            DebugView.EndCustomDraw();

            base.Update(settings, gameTime);
        }
开发者ID:KerwinMa,项目名称:CocosSharp,代码行数:37,代码来源:ConvexHullTest.cs


示例19: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            DebugView.DrawString(50, TextLine, "Melkman: Red");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Giftwrap: Green");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "ChainHull: Blue");
            TextLine += 15;

            DebugView.BeginCustomDraw(ref GameInstance.Projection, ref GameInstance.View);
            for (int i = 0; i < 32; i++)
            {
                DebugView.DrawPoint(_pointCloud1[i], 0.1f, Color.Yellow);
                DebugView.DrawPoint(_pointCloud2[i], 0.1f, Color.Yellow);
                DebugView.DrawPoint(_pointCloud3[i], 0.1f, Color.Yellow);
            }

            DebugView.DrawPolygon(_melkman.ToArray(), _melkman.Count, Color.Red);
            DebugView.DrawPolygon(_giftWrap.ToArray(), _giftWrap.Count, Color.Green);
            DebugView.DrawPolygon(_chainHull.ToArray(), _chainHull.Count, Color.Blue);
            DebugView.EndCustomDraw();

            base.Update(settings, gameTime);
        }
开发者ID:boris2,项目名称:mmogameproject2,代码行数:24,代码来源:ConvexHullTest2.cs


示例20: Update

        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            float ratio = _joint4.Ratio;
            float value = _joint1.JointAngle + ratio * _joint2.JointAngle;
            DebugView.DrawString(50, TextLine, "theta1 + {0} * theta2 = {1}", ratio, value);
            TextLine += 15;

            ratio = _joint5.Ratio;
            value = _joint2.JointAngle + ratio * _joint3.JointTranslation;
            DebugView.DrawString(50, TextLine, "theta2 + {0} * delta = {1}", ratio, value);
            TextLine += 15;
        }
开发者ID:danzel,项目名称:FarseerPhysics,代码行数:14,代码来源:GearsTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# FastQuant.Order类代码示例发布时间:2022-05-26
下一篇:
C# Joints.RevoluteJoint类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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