/// <summary>
 /// Creates a gravitational field.
 /// </summary>
 /// <param name="shape">Shape representing the volume of the force field.</param>
 /// <param name="origin">Location that entities will be pushed toward.</param>
 /// <param name="multiplier">Represents the gravitational constant of the field times the effective mass at the center of the field.</param>
 /// <param name="maxForce">Maximum force the field can apply.</param>
 /// <param name="physicWorld">The physic world.</param>
 public GravitationalFieldObject(ForceFieldShape shape, Vector3 origin, float multiplier, float maxForce, BepuPhysicWorld physicWorld)
     : base(shape, physicWorld.Space.BroadPhase.QueryAccelerator)
 {
     this.Multiplier = multiplier;
     this.Origin = origin;
     this.MaxForce = maxForce;
 }
Пример #2
0
 /// <summary>
 /// Creates a gravitational field.
 /// </summary>
 /// <param name="shape">Shape representing the volume of the force field.</param>
 /// <param name="origin">Location that entities will be pushed toward.</param>
 /// <param name="multiplier">Represents the gravitational constant of the field times the effective mass at the center of the field.</param>
 /// <param name="maxAcceleration">Maximum acceleration the field can apply.</param>
 public GravitationalField(ForceFieldShape shape, Vector3 origin, float multiplier, float maxAcceleration)
     : base(shape)
 {
     this.Multiplier = multiplier;
     this.Origin = origin;
     this.MaxAcceleration = maxAcceleration;
 }
Пример #3
0
 /// <summary>
 /// Creates a simple, constant force field.
 /// </summary>
 /// <param name="shape">Shape representing the tornado-affected volume.</param>
 /// <param name="position">Position of the tornado.</param>
 /// <param name="axis">Axis of rotation of the tornado.</param>
 /// <param name="height">Height of the tornado; objects above or below the tornado will not be affected by its winds.</param>
 /// <param name="spinClockwise">Whether or not the tornado's rotation is clockwise.</param>
 /// <param name="horizontalWindSpeed">Maximum tangential wind speed; objects will not be accelerated by the wind past this speed sideways.</param>
 /// <param name="upwardSuctionSpeed">Maximum upward pushing wind speed; objects will not be accelerated by the wind past this speed upward.</param>
 /// <param name="inwardSuctionSpeed">Maximum inward sucking wind speed; objects will not be accelerated by the wind past this speed inward.</param>
 /// <param name="horizontalForce">Circular force applied within the tornado.  Force magnitude decreases as distance from axis increases past the radius.</param>
 /// <param name="upwardForce">Magnitude of upward-pushing force within the tornado.  Magnitude decreases as distance from the axis increases past the radius.</param>
 /// <param name="inwardForce">Magnitude of the inward-sucking force within the tornado.  Magnitude decreases as distance from the axis increases past the radius.</param>
 /// <param name="topRadius">Radius of the tornado at the top.</param>
 /// <param name="bottomRadius">Radius of the tornado at the bottom.</param>
 public Tornado(ForceFieldShape shape, Vector3 position, Vector3 axis,
                float height, bool spinClockwise, float horizontalWindSpeed,
                float upwardSuctionSpeed, float inwardSuctionSpeed,
                float horizontalForce, float upwardForce, float inwardForce,
                float topRadius, float bottomRadius)
     : base(shape)
 {
     Axis = Vector3.Normalize(axis);
     Position = position;
     Height = height;
     SpinClockwise = spinClockwise;
     HorizontalWindSpeed = horizontalWindSpeed;
     UpwardSuctionSpeed = upwardSuctionSpeed;
     InwardSuctionSpeed = inwardSuctionSpeed;
     HorizontalForce = horizontalForce;
     UpwardForce = upwardForce;
     InwardForce = inwardForce;
     BottomRadius = bottomRadius;
     TopRadius = topRadius;
 }
Пример #4
0
 /// <summary>
 /// Creates a simple, constant force field.
 /// </summary>
 /// <param name="shape">Shape representing the volume of the force field.</param>
 /// <param name="forceToApply">Force to apply to entities within the field.  Magnitude of the vector represents the magnitude of the force.</param>
 /// <param name="maxPushSpeed">Maximum speed that the field will accelerate objects to, regardless of force applied. Set to a non-positive for infinite.</param>
 public PushField(ForceFieldShape shape, Vector3 forceToApply, float maxPushSpeed)
     : base(shape)
 {
     Force = forceToApply;
     MaximumPushSpeed = maxPushSpeed;
 }
Пример #5
0
 /// <summary>
 /// Constructs a force field.
 /// </summary>
 /// <param name="shape">Shape to use for the force field.</param>
 protected ForceField(ForceFieldShape shape)
 {
     Shape = shape;
     subfunction = new Action<int>(CalculateImpulsesSubfunction);
     AllowMultithreading = true;
 }
Пример #6
0
 protected ForceField(ForceFieldShape shape, IQueryAccelerator queryAccelerator, IThreadManager threadManager)
     : this(shape, queryAccelerator)
 {
     ThreadManager       = threadManager;
     AllowMultithreading = true;
 }
Пример #7
0
 /// <summary>
 /// Constructs a force field.
 /// </summary>
 /// <param name="shape">Shape to use for the force field.</param>
 /// <param name="queryAccelerator">Query accelerator used to find entities.</param>
 protected ForceField(ForceFieldShape shape, IQueryAccelerator queryAccelerator)
 {
     Shape            = shape;
     QueryAccelerator = queryAccelerator;
     subfunction      = new Action <int>(CalculateImpulsesSubfunction);
 }
Пример #8
0
 /// <summary>
 /// Constructs a force field.
 /// </summary>
 /// <param name="shape">Shape to use for the force field.</param>
 protected ForceField(ForceFieldShape shape)
 {
     Shape               = shape;
     subfunction         = new Action <int>(CalculateImpulsesSubfunction);
     AllowMultithreading = true;
 }
Пример #9
0
 protected ForceField(ForceFieldShape shape, IQueryAccelerator queryAccelerator, IThreadManager threadManager)
     : this(shape, queryAccelerator)
 {
     ThreadManager = threadManager;
     AllowMultithreading = true;
 }
Пример #10
0
 /// <summary>
 /// Constructs a force field.
 /// </summary>
 /// <param name="shape">Shape to use for the force field.</param>
 /// <param name="queryAccelerator">Query accelerator used to find entities.</param>
 protected ForceField(ForceFieldShape shape, IQueryAccelerator queryAccelerator)
 {
     Shape = shape;
     QueryAccelerator = queryAccelerator;
     subfunction = new Action<int>(CalculateImpulsesSubfunction);
 }