示例#1
0
 /// <summary>
 /// Constructs a Entity using some default values.
 /// </summary>
 /// <param name="position">The initial entity position.</param>
 /// <param name="orientation">The initial orientation of the entity.</param>
 /// <param name="mass">The mass of the entity.</param>
 /// <param name="boundingRadius">The bounding radius of the entity.</param>
 /// <param name="hull">The hull used for collision detection.</param>
 /// <param name="collisionHandler">The collision handler to use for collision responce.</param>
 public Entity(Vector3 position, Vector3 orientation, float mass, float boundingRadius, Hull hull, CollisionHandler collisionHandler)
 {
     this._position           = position;
     this.previousPosition    = position;
     this._orientation        = orientation;
     this.previousOrientation = orientation;
     this._mass            = mass;
     this._boundingRadius  = boundingRadius;
     this._hull            = hull;
     this.collisionHandler = collisionHandler;
     this.elapsedTime      = 0.05f;
 }
示例#2
0
 /// <summary>
 /// Construct a DefaultEntity.
 /// </summary>
 /// <param name="position">The initial position of the entity.</param>
 /// <param name="orientation">The initial orientation of the entity.</param>
 /// <param name="mass">The mass of the entity.</param>
 /// <param name="boundingRadius">The minimal radius of the sphere which entirly encloses the entity.</param>
 /// <param name="hull">The collision detection hull of the entity.</param>
 /// <param name="collisionHandler">The entity collision handler.</param>
 /// <param name="environment">The enviroment in which the entity resides, used to calculate gravity strength, etc.
 /// </param>
 /// <param name="coefficientOfAirResistance">The strength of air resistance, high values mean increased air resistance.
 /// </param>
 public DefaultEntity
 (
     Vector3 position,
     Vector3 orientation,
     float mass,
     float boundingRadius,
     Hull hull,
     CollisionHandler collisionHandler,
     PhysicsParameters physicsParameters,
     float coefficientOfAirResistance
 )
     : base(position, orientation, mass, boundingRadius, hull, collisionHandler)
 {
     this._parameters = physicsParameters;
     this._coefficientOfAirResistance = coefficientOfAirResistance;
 }
 /// <summary>
 /// Create a non-force entity.
 /// </summary>
 /// <param name="position">The initial position of the entity.</param>
 /// <param name="orientation">The initial orientation of the entity.</param>
 /// <param name="mass">The mass of the entity.</param>
 /// <param name="boundingRadius">The bounding radius of the entity.</param>
 /// <param name="hull">The entities collision detection hull.</param>
 /// <param name="collisionHandler">The entities collision handler.</param>
 public NonForceEntity(Vector3 position, Vector3 orientation, float mass, float boundingRadius, Hull hull, CollisionHandler collisionHandler)
     : base(position, orientation, mass, boundingRadius, hull, collisionHandler)
 {
 }