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

C# Vec2类代码示例

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

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



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

示例1: Bullet

 public Bullet(Vec2 pos, Vec2 p2)
 {
     Health = new Health(0.5);
     Position = pos;
     this.p2 = p2;
     Velocity = Direction * Speed;
 }
开发者ID:kuviman,项目名称:SMA2,代码行数:7,代码来源:Bullet.cs


示例2: Vertex

 public Vertex(Vec3 position, Vec3 normal, Vec2 texCoord, Vec3 tangent)
 {
     this.position = position;
     this.normal = normal;
     this.texCoord = texCoord;
     this.tangent = tangent;
 }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:7,代码来源:Decal.cs


示例3: MouseMove

 public override void MouseMove(Vec2 pos)
 {
     base.MouseMove(pos);
     pos = new Camera(10).FromWH(pos, App.Width, App.Height);
     foreach (var b in buttons)
         b.Selected = b.Inside(pos);
 }
开发者ID:kuviman,项目名称:SMA2,代码行数:7,代码来源:MainMenu.cs


示例4: ProxyTile

 public ProxyTile(ITileServer server, Vec2 point)
 {
     this.loaded = false;
     this.point = point;
     this.server = server;
     this.tile = new Tile (point, 0);
 }
开发者ID:stalexwang,项目名称:tilemap,代码行数:7,代码来源:ProxyTile.cs


示例5: initialize

 /**
    * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world
    * axis.
    */
 public void initialize(Body bA, Body bB, Vec2 anchor)
 {
     bodyA = bA;
     bodyB = bB;
     bA.getLocalPointToOut(anchor, ref localAnchorA);
     bB.getLocalPointToOut(anchor, ref localAnchorB);
 }
开发者ID:Nomad1,项目名称:sharpbox2d,代码行数:11,代码来源:FrictionJointDef.cs


示例6: MouseDown

 public override void MouseDown(MouseButton button, Vec2 pos)
 {
     base.MouseDown(button, pos);
     foreach (var b in buttons)
         if (b.Selected)
             b.Action.Apply();
 }
开发者ID:kuviman,项目名称:SMA2,代码行数:7,代码来源:MainMenu.cs


示例7: initTest

        public override void initTest(bool argDeserialized)
        {
            input.transformA = new Transform();
            input.transformB = new Transform();
            {
                m_transformA = new Transform();
                m_transformA.setIdentity();
                m_transformA.p.set(0.0f, -0.2f);
                m_polygonA = new PolygonShape();
                m_polygonA.setAsBox(10.0f, 0.2f);
            }

            {
                m_positionB = new Vec2();
                m_positionB.set(12.017401f, 0.13678508f);
                m_angleB = -0.0109265f;

                m_transformB = new Transform();
                m_transformB.set(m_positionB, m_angleB);

                m_polygonB = new PolygonShape();
                m_polygonB.setAsBox(2.0f, 0.1f);
            }
            for (int i = 0; i < v.Length; i++)
            {
                v[i] = new Vec2();
            }
        }
开发者ID:Nomad1,项目名称:sharpbox2d,代码行数:28,代码来源:DistanceTest.cs


示例8: Shoot

 public void Shoot(Vec2 pos)
 {
     if (RemainingReloadTime > 0)
         return;
     RemainingReloadTime = ReloadTime;
     DoShoot(pos);
 }
开发者ID:kuviman,项目名称:SMA2,代码行数:7,代码来源:Weapon.cs


示例9: OnRenderUI

        protected override void OnRenderUI( GuiRenderer renderer )
        {
            base.OnRenderUI( renderer );

            Vec2 size = new Vec2( 232, 335 );
            //size *= 1.0f + Time * .015f;
            size /= new Vec2( 768.0f * renderer.AspectRatio, 768.0f );

            Rect rectangle = new Rect( -size / 2, size / 2 ) + new Vec2( .3f, .5f );

            float alpha = 0;

            if( Time > 1 && Time <= 2 )
                alpha = Time - 1;
            else if( Time > 2 && Time <= lifeTime - 2 - 2 )
                alpha = 1;
            else if( Time >= lifeTime - 2 - 2 && Time < lifeTime - 1 )
                alpha = 1 - ( Time - ( lifeTime - 2 - 2 ) ) / 3;

            if( alpha != 0 )
            {
                renderer.AddQuad( rectangle, new Rect( 0, 0, 1, 1 ), productTexture,
                    new ColorValue( 1, 1, 1, alpha ) );
            }
        }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:25,代码来源:ProductLogoWindow.cs


示例10: Deserialize

 protected override void Deserialize(BinaryReader reader)
 {
     base.Deserialize(reader);
     _beginModelPoint = Vec2.Deserialize(reader);
     _endModelPoint = Vec2.Deserialize(reader);
     _z = Vec2.Deserialize(reader);
 }
开发者ID:HyroVitalyProtago,项目名称:KingdomsRebellion,代码行数:7,代码来源:DragAction.cs


示例11: FastDistance

 public static int FastDistance(Vec2 v1, Vec2 v2)
 {
     r = Mathf.Abs(v1.R - v2.R);
     c = Mathf.Abs(v1.C - v2.C);
     if (r > c) return r;
     return c;
 }
开发者ID:rocketreal,项目名称:Pikachu,代码行数:7,代码来源:Vec2.cs


示例12: LPath

 public LPath(Vec2 v0,Vec2 v1)
 {
     N = 2;
     PATH = new Vec2[2];
     PATH[0] = v0;
     PATH[1] = v1;
 }
开发者ID:hothanhhung,项目名称:Android,代码行数:7,代码来源:LPath.cs


示例13: Lazer

 public Lazer(Vec2 pos, Vec2 p2)
 {
     Health = new Health(0.2);
     Position = pos;
     this.p2 = p2;
     Velocity = Direction * Speed;
 }
开发者ID:kuviman,项目名称:SMA2,代码行数:7,代码来源:Lazer.cs


示例14: addGenerator

 public void addGenerator(Vec2 center, int tag)
 {
     Generator g = m_generatorBuffer[m_generatorCount++];
     g.center.x = center.x;
     g.center.y = center.y;
     g.tag = tag;
 }
开发者ID:Nomad1,项目名称:sharpbox2d,代码行数:7,代码来源:VoronoiDiagram.cs


示例15: WeldJointDef

 public WeldJointDef()
     : base(JointType.WELD)
 {
     localAnchorA = new Vec2();
     localAnchorB = new Vec2();
     referenceAngle = 0.0f;
 }
开发者ID:Nomad1,项目名称:sharpbox2d,代码行数:7,代码来源:WeldJointDef.cs


示例16: Move

        public Vec2 Move(Human LeMe, IEnumerable<Human> NearestNeighbours)
        {
            if ((LeMe.Node - LeMe.Position).Length() > 100.0f)
            {
                LeMe.Node = this.GetNewTarget(LeMe);

                if (LeMe.HumanType == HumanType.Agent)
                {
                    LeMe.MovementBehaviour = new AgentMovementBehaviour();
                }
                else
                {
                    LeMe.MovementBehaviour = new UsualMovementBehaviour();
                }
            }

            this.velocity = LeMe.Node - LeMe.Position;
            this.velocity.Mul(-1.0f);

            this.velocity.Mul(1.0f / this.velocity.Length());

            this.velocity.Mul(this.speed);

            foreach (var human in NearestNeighbours.Where(Human => Human.Position != LeMe.Position && !(Human.HumanType != HumanType.Agent && LeMe.HumanType == HumanType.Victim)))
            {
                this.distance = human.Position - LeMe.Position;

                var num = this.distance.Length();

                distance.Mul(1.0f / distance.Length());

                distance.Mul(1.7f);

                if (!(num <= 15.0f))
                {
                    continue;
                }

                num = 15.0f - num;

                num /= 15.0f;

                this.distance.Mul(num * -1f);

                this.distance.Mul(3.5f);

                this.velocity += this.distance;

                this.distance = human.Position - LeMe.Position;
            }

            this.velocity.Mul(1.0f / this.velocity.Length());

            this.velocity.Mul(this.speed);

            LeMe.Position = LeMe.Position + this.velocity;

            return LeMe.Position;
        }
开发者ID:dd8kb,项目名称:CrowdSimulator,代码行数:59,代码来源:EvadeMovementBehaviour.cs


示例17: UsualMovementBehaviour

        public UsualMovementBehaviour()
        {
            velocity = new Vec2(0, 0);

            distance = new Vec2(0, 0);

            speed = 2.0f;
        }
开发者ID:dd8kb,项目名称:CrowdSimulator,代码行数:8,代码来源:UsualMovementBehaviour.cs


示例18: TeamMetaInfo

		public TeamMetaInfo(Vec2 spawnTile, Vec2 baseTile, Vec2 baseTowerTile, Vec2 botTowerTile, Vec2 topTowerTile)
		{
			SpawnTileIds = spawnTile;
			BaseTileIds = baseTile;
			BaseTowerTileIds = baseTowerTile;
			BottomTowerTileIds = botTowerTile;
			TopTowerTileIds = topTowerTile;
		}
开发者ID:DrPandemic,项目名称:EraParadox,代码行数:8,代码来源:MapLoader.cs


示例19: AgentMovementBehaviour

        public AgentMovementBehaviour()
        {
            velocity = new Vec2(0, 0);

            distance = new Vec2(0, 0);

            speed = 2.4f;
        }
开发者ID:PascalMinder,项目名称:CrowdSimulator,代码行数:8,代码来源:AgentMovementBehaviour.cs


示例20: FrictionJointDef

 public FrictionJointDef()
     : base(JointType.FRICTION)
 {
     localAnchorA = new Vec2();
     localAnchorB = new Vec2();
     maxForce = 0f;
     maxTorque = 0f;
 }
开发者ID:Nomad1,项目名称:sharpbox2d,代码行数:8,代码来源:FrictionJointDef.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Vec3类代码示例发布时间:2022-05-24
下一篇:
C# Vdbe类代码示例发布时间: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