Vector3D.ToVector3 C# (CSharp) Method

ToVector3() public method

public ToVector3 ( ) : Vector3
return Vector3
    public Vector3 ToVector3()
    {
        return new Vector3((float)x,(float)y,(float)z);
    }

Usage Example

        protected void UpdatePosOnlySnapOn(object sender)
        {
            // update positions
            var endTransf   = this.endHandles.Select(x => (x.Transform as MatrixTransform3D)).ToArray();
            var endMatrices = endTransf.Select(x => x.Value).ToArray();
            var pos_NEW     = endMatrices.Select(x => x.ToMatrix().TranslationVector).ToArray();

            int n = pos_NEW.Count();
            int i;

            for (i = 0; i < n; i++)
            {
                Vector3  diff  = pos_NEW[i] - this.pos_current[i];
                Vector3D diffA = AdjustForSnap(diff.ToVector3D());
                this.pos[i] = this.pos_current[i] + diffA.ToVector3();
            }

            // update sender
            // ENDPOINT handles
            for (i = 0; i < n; i++)
            {
                if (sender == this.endHandles[i])
                {
                    var T = Matrix3DExtensions.Translate3D(pos[i].ToVector3D());

                    this.endHandles[i].Transform = new MatrixTransform3D(T);
                    var child = (HelixToolkit.SharpDX.Wpf.GeometryModel3D) this.Children[this.endH_indInChildren[i]];
                    if (child != null)
                    {
                        child.Transform = new MatrixTransform3D(T);
                    }
                }
            }
        }
All Usage Examples Of Vector3D::ToVector3