本文整理汇总了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;
}
示例2: Vertex
public Vertex(Vec3 position, Vec3 normal, Vec2 texCoord, Vec3 tangent)
{
this.position = position;
this.normal = normal;
this.texCoord = texCoord;
this.tangent = tangent;
}
示例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);
}
示例4: ProxyTile
public ProxyTile(ITileServer server, Vec2 point)
{
this.loaded = false;
this.point = point;
this.server = server;
this.tile = new Tile (point, 0);
}
示例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);
}
示例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();
}
示例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();
}
}
示例8: Shoot
public void Shoot(Vec2 pos)
{
if (RemainingReloadTime > 0)
return;
RemainingReloadTime = ReloadTime;
DoShoot(pos);
}
示例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 ) );
}
}
示例10: Deserialize
protected override void Deserialize(BinaryReader reader)
{
base.Deserialize(reader);
_beginModelPoint = Vec2.Deserialize(reader);
_endModelPoint = Vec2.Deserialize(reader);
_z = Vec2.Deserialize(reader);
}
示例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;
}
示例12: LPath
public LPath(Vec2 v0,Vec2 v1)
{
N = 2;
PATH = new Vec2[2];
PATH[0] = v0;
PATH[1] = v1;
}
示例13: Lazer
public Lazer(Vec2 pos, Vec2 p2)
{
Health = new Health(0.2);
Position = pos;
this.p2 = p2;
Velocity = Direction * Speed;
}
示例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;
}
示例15: WeldJointDef
public WeldJointDef()
: base(JointType.WELD)
{
localAnchorA = new Vec2();
localAnchorB = new Vec2();
referenceAngle = 0.0f;
}