Esempio n. 1
0
 /// <summary>Creates a circle with the specified parameters.</summary>
 /// <param name="manager">The manager to create the object in.</param>
 /// <param name="radius">The radius of the circle.</param>
 /// <param name="worldAngle">The initial world angle of the body.</param>
 /// <param name="type">The type of the body.</param>
 /// <param name="fixedRotation">
 ///     if set to <c>true</c> the rotation of the body is fixed to its initial value.
 /// </param>
 /// <param name="isBullet">
 ///     if set to <c>true</c> enables continuous collision with other dynamic bodies.
 /// </param>
 /// <param name="allowSleep">
 ///     if set to <c>true</c> allows the object to sleep when it is not moving (for improved performance).
 /// </param>
 /// <param name="density">The density of the fixture.</param>
 /// <param name="friction">The friction of the fixture.</param>
 /// <param name="restitution">The restitution of the fixture.</param>
 /// <param name="isSensor">
 ///     if set to <c>true</c> the created fixture is marked as a sensor (i.e. it will fire collision events but the
 ///     collision will not be handled by the solver).
 /// </param>
 /// <param name="collisionCategory">The collision groups for the fixture.</param>
 /// <param name="collisionMask">The collision groups to collide with.</param>
 /// <returns>The created body.</returns>
 public static CircleFixture AddCircle(
     this IManager manager,
     float radius,
     float worldAngle       = 0,
     Body.BodyType type     = Body.BodyType.Static,
     bool fixedRotation     = false,
     bool isBullet          = false,
     bool allowSleep        = true,
     float density          = 0,
     float friction         = 0.2f,
     float restitution      = 0,
     bool isSensor          = false,
     uint collisionCategory = 1,
     uint collisionMask     = 0xFFFFFFFF)
 {
     return(manager.AddCircle(
                LocalPoint.Zero,
                radius,
                WorldPoint.Zero,
                worldAngle,
                type,
                fixedRotation,
                isBullet,
                allowSleep,
                density,
                friction,
                restitution,
                isSensor,
                collisionCategory,
                collisionMask));
 }