本文整理汇总了C#中Box2DX.Dynamics.Body.GetLocalPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Body.GetLocalPoint方法的具体用法?C# Body.GetLocalPoint怎么用?C# Body.GetLocalPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box2DX.Dynamics.Body
的用法示例。
在下文中一共展示了Body.GetLocalPoint方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public void Initialize(Body body1, Body body2, Vec2 anchor)
{
this.Body1 = body1;
this.Body2 = body2;
this.LocalAnchor1 = body1.GetLocalPoint(anchor);
this.LocalAnchor2 = body2.GetLocalPoint(anchor);
this.ReferenceAngle = body2.GetAngle() - body1.GetAngle();
}
示例2: Initialize
public void Initialize(Body body1, Body body2, Vec2 anchor, Vec2 axis)
{
this.Body1 = body1;
this.Body2 = body2;
this.localAnchor1 = body1.GetLocalPoint(anchor);
this.localAnchor2 = body2.GetLocalPoint(anchor);
this.localAxis1 = body1.GetLocalVector(axis);
}
示例3: Initialize
public void Initialize(Body body1, Body body2, Vec2 anchor1, Vec2 anchor2)
{
this.Body1 = body1;
this.Body2 = body2;
this.LocalAnchor1 = body1.GetLocalPoint(anchor1);
this.LocalAnchor2 = body2.GetLocalPoint(anchor2);
this.Length = (anchor2 - anchor1).Length();
}
示例4: Initialize
/// <summary>
/// Initialize the bodies, anchors, and length using the world anchors.
/// </summary>
public void Initialize(Body body1, Body body2, Vec2 anchor1, Vec2 anchor2)
{
Body1 = body1;
Body2 = body2;
LocalAnchor1 = body1.GetLocalPoint(anchor1);
LocalAnchor2 = body2.GetLocalPoint(anchor2);
Vec2 d = anchor2 - anchor1;
Length = d.Length();
}
示例5: Initialize
public void Initialize(Body body1, Body body2, Vec2 groundAnchor1, Vec2 groundAnchor2, Vec2 anchor1, Vec2 anchor2, float ratio)
{
this.Body1 = body1;
this.Body2 = body2;
this.GroundAnchor1 = groundAnchor1;
this.GroundAnchor2 = groundAnchor2;
this.LocalAnchor1 = body1.GetLocalPoint(anchor1);
this.LocalAnchor2 = body2.GetLocalPoint(anchor2);
this.Length1 = (anchor1 - groundAnchor1).Length();
this.Length2 = (anchor2 - groundAnchor2).Length();
this.Ratio = ratio;
Box2DXDebug.Assert(ratio > Settings.FLT_EPSILON);
float num = this.Length1 + ratio * this.Length2;
this.MaxLength1 = num - ratio * PulleyJoint.MinPulleyLength;
this.MaxLength2 = (num - PulleyJoint.MinPulleyLength) / ratio;
}
示例6: Initialize
/// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.
public void Initialize(Body body1, Body body2,
Vec2 groundAnchor1, Vec2 groundAnchor2,
Vec2 anchor1, Vec2 anchor2,
float ratio)
{
Body1 = body1;
Body2 = body2;
GroundAnchor1 = groundAnchor1;
GroundAnchor2 = groundAnchor2;
LocalAnchor1 = body1.GetLocalPoint(anchor1);
LocalAnchor2 = body2.GetLocalPoint(anchor2);
Vec2 d1 = anchor1 - groundAnchor1;
Length1 = d1.Length();
Vec2 d2 = anchor2 - groundAnchor2;
Length2 = d2.Length();
Ratio = ratio;
Box2DXDebug.Assert(ratio > Settings.FLT_EPSILON);
float C = Length1 + ratio * Length2;
MaxLength1 = C - ratio * PulleyJoint.MinPulleyLength;
MaxLength2 = (C - PulleyJoint.MinPulleyLength) / ratio;
}
示例7: Initialize
/// <summary>
/// Initialize the bodies, anchors, axis, and reference angle using the world
/// anchor and world axis.
/// </summary>
public void Initialize(Body body1, Body body2, Vector2 anchor, Vector2 axis)
{
Body1 = body1;
Body2 = body2;
LocalAnchor1 = body1.GetLocalPoint(anchor);
LocalAnchor2 = body2.GetLocalPoint(anchor);
LocalAxis1 = body1.GetLocalVector(axis);
ReferenceAngle = body2.GetAngle() - body1.GetAngle();
}