コード例 #1
0
        /// <summary>
        /// An array getter, optimized by reusing mappings.
        /// </summary>
        /// <param name="lineIndex">The  line index offset.</param>
        /// <param name="positionComponent">The position component.</param>
        /// <param name="storage">Where to store result.</param>
        public void Get(string positionComponent, uint lineIndex, LineSegment3f[] storage)
        {
            if (lineIndex + storage.Length >= shapeCount)
            {
                throw new ArgumentException("Index out of range, not that many triangles.");
            }

            if (indexBuffer != null)
            {
                uint[]     indices = indexBuffer.Getui(lineIndex * 2, (uint)storage.Length * 2);
                Vector3f[] data    = query.Get3f(positionComponent, indices);

                for (int i = 0; i < storage.Length; i++)
                {
                    storage[i] = new LineSegment3f(data[i * 2], data[i * 2 + 1]);
                }
            }
            else
            {
                Vector3f[] data = query.Get3f(positionComponent, lineIndex * 2, (uint)storage.Length * 2);

                for (int i = 0; i < storage.Length; i++)
                {
                    storage[i] = new LineSegment3f(data[i * 2], data[i * 2 + 1]);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Gets line.
        /// </summary>
        /// <param name="index">The line index.</param>
        /// <param name="positionComponent">The component where we look for position, must be
        /// correct format.</param>
        /// <remarks>This is not performance wise getter.</remarks>
        public LineSegment3f Get3f(string positionComponent, uint index)
        {
            LineSegment3f t = new LineSegment3f();

            Get(positionComponent, index, t);
            return(t);
        }
コード例 #3
0
        //#endfor instanced to 'Float2'

        //#foreach instanced to 'Float3'


        /// <summary>
        /// Gets line.
        /// </summary>
        /// <param name="index">The line index.</param>
        /// <remarks>This is not performance wise getter.</remarks>
        /// <returns></returns>
        public LineSegment3f Get3f(uint index)
        {
            LineSegment3f t = new LineSegment3f();

            Get(CommonComponents.Position, index, t);
            return(t);
        }
コード例 #4
0
        /// <summary>
        /// Gets triangle.
        /// </summary>
        /// <param name="index">The line index.</param>
        /// <remarks>This accessor is not to be used in performance critical parts of applications.</remarks>
        /// <returns></returns>
        public void Get(string positionComponent, uint index, LineSegment3f storage)
        {
            if (index >= shapeCount)
            {
                throw new ArgumentException("Index out of range, not that many triangles.");
            }

            if (indexBuffer != null)
            {
                uint[] indices = indexBuffer.Getui(index * 2, 2);

                storage.A = query.Get3f(positionComponent, indices[0]);
                storage.B = query.Get3f(positionComponent, indices[1]);
            }
            else
            {
                storage.A = query.Get3f(positionComponent, index * 2);
                storage.B = query.Get3f(positionComponent, index * 2 + 1);
            }
        }
コード例 #5
0
 /// <summary>
 /// An array getter, optimized by reusing mappings.
 /// </summary>
 /// <param name="lineIndex">The line index offset.</param>
 /// <param name="positionComponent">The position component.</param>
 /// <param name="count">Number of triangles.</param>
 public LineSegment3f[] Get3f(string positionComponent, uint lineIndex, uint count)
 {
     LineSegment3f[] data = new LineSegment3f[count];
     Get(positionComponent, lineIndex, data);
     return(data);
 }
コード例 #6
0
 /// <summary>
 /// Gets line.
 /// </summary>
 /// <param name="index">The line index.</param>
 /// <param name="positionComponent">The component where we look for position, must be
 /// Vector2f format.</param>
 /// <remarks>This is not performance wise getter.</remarks>
 public void Get(uint index, LineSegment3f storage)
 {
     Get(CommonComponents.Position, index, storage);
 }
コード例 #7
0
ファイル: LineStrip3f.cs プロジェクト: zigaosolin/SharpMedia
 /// <summary>
 /// Fills a line at index.
 /// </summary>
 /// <param name="index">The index.</param>
 /// <param name="line">The triangle to be filled.</param>
 public void Get(uint index, [NotNull] LineSegment3f line)
 {
     throw new NotImplementedException();
 }