Пример #1
0
 /// <summary>
 /// Transform the vectors in the given array and put the result in another array.
 /// </summary>
 /// <param name="vectors">An array of vectors to transform.</param>
 /// <param name="transformation">The transformation.</param>
 /// <param name="result">An array of vectors to put the transformation results in (should be empty).</param>
 public static void TransformArray(Vector3FArrayList vectors, Matrix4F transformation, Vector3FArrayList result)
 {
     for (int i = 0; i < vectors.Count; i++)
     {
         result.Add(Matrix4F.Transform(transformation, vectors[i]));
     }
 }
Пример #2
0
 /// <summary>
 /// Transform the vectors in the given array.
 /// </summary>
 /// <param name="vectors">An array of vectors to transform.</param>
 /// <param name="transformation">The transformation.</param>
 /// <remarks>
 /// This method changes the vector values in the <paramref name="vectors"/> array.
 /// </remarks>
 public static void TransformArray(Vector3FArrayList vectors, Matrix4F transformation)
 {
     for (int i = 0; i < vectors.Count; i++)
     {
         vectors[i] = Matrix4F.Transform(transformation, vectors[i]);
     }
 }
Пример #3
0
        public static Vector3FArrayList CreateRandomVector3FArray(int count, IFloatRandomNumberGenerator r)
        {
            Vector3FArrayList result = new Vector3FArrayList(count);

            for (int i = 0; i < count; i++)
            {
                result.Add(new Vector3F(r.NextFloat(), r.NextFloat(), r.NextFloat()));
            }
            return(result);
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Polygon"/> class with serialized data.
 /// </summary>
 /// <param name="info">The object that holds the serialized object data.</param>
 /// <param name="context">The contextual information about the source or destination.</param>
 private Polygon(SerializationInfo info, StreamingContext context)
 {
     _points = (Vector3FArrayList)info.GetValue("Points", typeof(Vector3FArrayList));
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Polygon"/> class using coordinates from another instance.
 /// </summary>
 /// <param name="polygon">A <see cref="Polygon"/> instance.</param>
 public Polygon(Polygon polygon)
 {
     _points = (Vector3FArrayList)polygon._points.Clone();
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Polygon"/> class using an array of coordinates.
 /// </summary>
 /// <param name="points">An <see cref="Vector3FArrayList"/> instance.</param>
 public Polygon(Vector3FArrayList points)
 {
     _points.AddRange(points);
 }