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


C# Vec2类代码示例

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


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


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