Пример #1
0
 /// <summary>
 /// Set the force exerted by this load by specifying a direction vector and
 /// a value.  The direction and axis system will be derived from this information.
 /// </summary>
 /// <param name="direction"></param>
 /// <param name="value"></param>
 public void SetForce(Vector direction, double value)
 {
     direction = direction.Unitize();
     if (direction.IsXOnly())
     {
         Direction = Direction.X;
         Value     = value / direction.X;
         Axes      = CoordinateSystemReference.Global;
     }
     else if (direction.IsYOnly())
     {
         Direction = Direction.Y;
         Value     = value / direction.Y;
         Axes      = CoordinateSystemReference.Global;
     }
     else if (direction.IsZOnly())
     {
         Direction = Direction.Z;
         Value     = value / direction.Z;
         Axes      = CoordinateSystemReference.Global;
     }
     else
     {
         //Need to generate axes:
         Axes      = new UserCoordinateSystemReference("[Locally Defined]", new CartesianCoordinateSystem(new Vector(), direction));
         Direction = Direction.Z;
         Value     = value;
     }
 }
Пример #2
0
 /// <summary>
 /// Convert a Nucleus CoordinateSystemReference to a BFE CoordinationSystem
 /// </summary>
 /// <param name="cSystem"></param>
 /// <returns></returns>
 public static BFE.CoordinationSystem Convert(CoordinateSystemReference cSystem)
 {
     if (cSystem.IsLocal)
     {
         return(BFE.CoordinationSystem.Local);
     }
     else
     {
         return(BFE.CoordinationSystem.Global); // TODO: Throw error?
     }
 }