本文整理汇总了C#中FarseerPhysics.Dynamics.World.RemoveJoint方法的典型用法代码示例。如果您正苦于以下问题:C# World.RemoveJoint方法的具体用法?C# World.RemoveJoint怎么用?C# World.RemoveJoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FarseerPhysics.Dynamics.World
的用法示例。
在下文中一共展示了World.RemoveJoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KillMouseJoints
private static void KillMouseJoints(World w, KinectRagdollGame g)
{
List<FixedMouseJoint> mjs = new List<FixedMouseJoint>();
foreach (Joint j in w.JointList)
{
if (j is FixedMouseJoint) w.RemoveJoint(j);
}
w.ProcessChanges();
}
示例2: Update
public void Update(GameTime gameTime, CameraOperator cameraOperator, World world)
{
_sprite.Body.Center = Input.Mouse.Position;
if (_mouseJoint != null)
{
if (Input.Mouse.IsButtonDown(Input.Mouse.MouseButton.Left))
{
_mouseJoint.WorldAnchorB = cameraOperator.Camera.PositionOnWorld(Input.Mouse.Position);
}
else
{
world.RemoveJoint(_mouseJoint);
_mouseJoint = null;
}
}
else
{
Vector2 cursorWorldPosition = cameraOperator.Camera.PositionOnWorld(Input.Mouse.Position);
if (Input.Mouse.IsButtonClicked(Input.Mouse.MouseButton.Left))
{
Fixture fixture;
float radiusMeters = _sprite.Body.Projection.BoundingBox.Dimensions.X.ToMeters();
if ((fixture =
world.TestPoint(cursorWorldPosition - new Vector2(radiusMeters))) != null ||
(fixture =
world.TestPoint(cursorWorldPosition + new Vector2(radiusMeters))) != null ||
(fixture =
world.TestPoint(cursorWorldPosition + new Vector2(radiusMeters, -radiusMeters))) != null ||
(fixture =
world.TestPoint(cursorWorldPosition - new Vector2(radiusMeters, -radiusMeters))) != null)
{
if (fixture.UserData is Coin)
{
_mouseJoint = new FixedMouseJoint(fixture.Body, cursorWorldPosition)
{
MaxForce = 200*fixture.Body.Mass
};
world.AddJoint(_mouseJoint);
}
}
}
}
}
示例3: DisposePhysics
public void DisposePhysics(World world)
{
world.RemoveJoint(m_Joint);
}