本文整理汇总了C#中Box2D.Common.Vec2类的典型用法代码示例。如果您正苦于以下问题:C# Vec2类的具体用法?C# Vec2怎么用?C# Vec2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Vec2类属于Box2D.Common命名空间,在下文中一共展示了Vec2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WeldJointDef
public WeldJointDef()
{
type = JointType.WELD;
localAnchorA = new Vec2();
localAnchorB = new Vec2();
referenceAngle = 0.0f;
}
示例2: initialize
/// <summary>
/// Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.
/// </summary>
public virtual void initialize(Body bA, Body bB, Vec2 anchor)
{
bodyA = bA;
bodyB = bB;
bA.getLocalPointToOut(anchor, localAnchorA);
bB.getLocalPointToOut(anchor, localAnchorB);
}
示例3: ContactPositionConstraint
public ContactPositionConstraint()
{
for (int i = 0; i < LocalPoints.Length; i++)
{
LocalPoints[i] = new Vec2();
}
}
示例4: Initialize
/// <summary>
/// Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.
/// </summary>
public void Initialize(Body bA, Body bB, Vec2 anchor)
{
BodyA = bA;
BodyB = bB;
bA.GetLocalPointToOut(anchor, LocalAnchorA);
bB.GetLocalPointToOut(anchor, LocalAnchorB);
}
示例5: WeldJointDef
public WeldJointDef()
{
Type = JointType.Weld;
LocalAnchorA = new Vec2();
LocalAnchorB = new Vec2();
ReferenceAngle = 0.0f;
}
示例6: FrictionJointDef
public FrictionJointDef()
{
Type = JointType.Friction;
LocalAnchorA = new Vec2();
LocalAnchorB = new Vec2();
MaxForce = 0f;
MaxTorque = 0f;
}
示例7: FrictionJointDef
public FrictionJointDef()
{
type = JointType.FRICTION;
localAnchorA = new Vec2();
localAnchorB = new Vec2();
maxForce = 0f;
maxTorque = 0f;
}
示例8: GetInitializedArray
protected internal Vec2[] GetInitializedArray(int argLength)
{
var ray = new Vec2[argLength];
for (int i = 0; i < ray.Length; i++)
{
ray[i] = new Vec2();
}
return ray;
}
示例9: WorldManifold
public WorldManifold()
{
normal = new Vec2();
points = new Vec2[Settings.maxManifoldPoints];
for (int i = 0; i < Settings.maxManifoldPoints; i++)
{
points[i] = new Vec2();
}
}
示例10: WorldManifold
public WorldManifold()
{
Normal = new Vec2();
Points = new Vec2[Settings.MAX_MANIFOLD_POINTS];
for (int i = 0; i < Settings.MAX_MANIFOLD_POINTS; i++)
{
Points[i] = new Vec2();
}
}
示例11: Manifold
/// <summary> creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.</summary>
public Manifold()
{
points = new ManifoldPoint[Settings.maxManifoldPoints];
for (int i = 0; i < Settings.maxManifoldPoints; i++)
{
points[i] = new ManifoldPoint();
}
localNormal = new Vec2();
localPoint = new Vec2();
pointCount = 0;
}
示例12: PulleyJointDef
public PulleyJointDef()
{
Type = JointType.Pulley;
GroundAnchorA = new Vec2(-1.0f, 1.0f);
GroundAnchorB = new Vec2(1.0f, 1.0f);
LocalAnchorA = new Vec2(-1.0f, 0.0f);
LocalAnchorB = new Vec2(1.0f, 0.0f);
LengthA = 0.0f;
LengthB = 0.0f;
Ratio = 1.0f;
CollideConnected = true;
}
示例13: FrictionJoint
/// <param name="argWorldPool"></param>
/// <param name="def"></param>
public FrictionJoint(IWorldPool argWorldPool, FrictionJointDef def)
: base(argWorldPool, def)
{
m_localAnchorA = new Vec2(def.localAnchorA);
m_localAnchorB = new Vec2(def.localAnchorB);
m_linearImpulse = new Vec2();
m_angularImpulse = 0.0f;
m_maxForce = def.maxForce;
m_maxTorque = def.maxTorque;
}
示例14: PulleyJointDef
public PulleyJointDef()
{
type = JointType.PULLEY;
groundAnchorA = new Vec2(-1.0f, 1.0f);
groundAnchorB = new Vec2(1.0f, 1.0f);
localAnchorA = new Vec2(-1.0f, 0.0f);
localAnchorB = new Vec2(1.0f, 0.0f);
lengthA = 0.0f;
lengthB = 0.0f;
ratio = 1.0f;
collideConnected = true;
}
示例15: PolygonShape
public PolygonShape()
: base(ShapeType.Polygon)
{
VertexCount = 0;
Vertices = new Vec2[Settings.MAX_POLYGON_VERTICES];
for (int i = 0; i < Vertices.Length; i++)
{
Vertices[i] = new Vec2();
}
Normals = new Vec2[Settings.MAX_POLYGON_VERTICES];
for (int i = 0; i < Normals.Length; i++)
{
Normals[i] = new Vec2();
}
Radius = Settings.POLYGON_RADIUS;
Centroid.SetZero();
}