本文整理汇总了C#中Body.GetLocalVector方法的典型用法代码示例。如果您正苦于以下问题:C# Body.GetLocalVector方法的具体用法?C# Body.GetLocalVector怎么用?C# Body.GetLocalVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Body
的用法示例。
在下文中一共展示了Body.GetLocalVector方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LineJoint
public LineJoint(Body bA, Body bB, Vector2 anchor, Vector2 axis)
: base(bA, bB)
{
JointType = JointType.Line;
LocalAnchorA = bA.GetLocalPoint(anchor);
LocalAnchorB = bB.GetLocalPoint(anchor);
LocalXAxis = bA.GetLocalVector(axis);
}
示例2: WheelJoint
public WheelJoint(Body bA, Body bB, FVector2 anchor, FVector2 axis)
: base(bA, bB)
{
JointType = JointType.Wheel;
LocalAnchorA = bA.GetLocalPoint(anchor);
LocalAnchorB = bB.GetLocalPoint(anchor);
m_localXAxisA = bA.GetLocalVector(axis);
m_localYAxisA = MathUtils.Cross(1.0f, m_localXAxisA);
}
示例3: FixedLineJoint
public FixedLineJoint(Body body, Vector2 bodyAnchor, Vector2 worldAnchor, Vector2 axis)
: base(body)
{
JointType = JointType.FixedLine;
//David: Start here
LocalAnchorA = body.GetLocalPoint(bodyAnchor);
LocalAnchorB = body.GetLocalPoint(bodyAnchor);
LocalXAxis = body.GetLocalVector(axis);
}
示例4: FixedLineJoint
/// <summary>
/// Initialize the bodies, anchors, axis, and reference angle using the local
/// anchor and world axis.
/// This requires defining a line of
/// motion using an axis and an anchor point. Uses local
/// anchor points and a local axis so that the initial configuration
/// can violate the constraint slightly. The joint translation is zero
/// when the local anchor points coincide in world space. Using local
/// anchors and a local axis helps when saving and loading a game.
/// </summary>
/// <param name="bodyA">The first body.</param>
/// <param name="worldAnchor">The anchor.</param>
/// <param name="axis">The axis.</param>
public FixedLineJoint(Body bodyA, Vector2 worldAnchor, Vector2 axis)
: base(bodyA)
{
JointType = JointType.FixedLine;
BodyB = bodyA;
LocalAnchorA = worldAnchor;
LocalAnchorB = BodyB.GetLocalPoint(worldAnchor);
_localXAxis1 = bodyA.GetLocalVector(axis);
_localYAxis1 = MathUtils.Cross(1.0f, _localXAxis1);
_localYAxis1 = MathUtils.Cross(1.0f, _localXAxis1);
_limitState = LimitState.Inactive;
}
示例5: LineJoint
/// <summary>
/// Initialize the bodies, anchors, axis, and reference angle using the local
/// anchor and world axis.
/// This requires defining a line of
/// motion using an axis and an anchor point. Uses local
/// anchor points and a local axis so that the initial configuration
/// can violate the constraint slightly. The joint translation is zero
/// when the local anchor points coincide in world space. Using local
/// anchors and a local axis helps when saving and loading a game.
/// </summary>
/// <param name="bodyA">The first body.</param>
/// <param name="bodyB">The second body.</param>
/// <param name="localAnchorA">The first body anchor.</param>
/// <param name="localAnchorB">The second body anchor.</param>
/// <param name="axis">The axis.</param>
public LineJoint(Body bodyA, Body bodyB, Vector2 localAnchorA, Vector2 localAnchorB, Vector2 axis)
: base(bodyA, bodyB)
{
JointType = JointType.Line;
BodyA = bodyA;
BodyB = bodyB;
LocalAnchorA = localAnchorA;
LocalAnchorB = localAnchorB;
_localXAxis1 = bodyA.GetLocalVector(axis);
_localYAxis1 = MathUtils.Cross(1.0f, _localXAxis1);
_localYAxis1 = MathUtils.Cross(1.0f, _localXAxis1);
_limitState = LimitState.Inactive;
}