GoSpline.bytesToVector3List C# (CSharp) Method

bytesToVector3List() public static method

helper to get a node list from an asset created with the visual editor
public static bytesToVector3List ( byte bytes ) : List
bytes byte
return List
    public static List<Vector3> bytesToVector3List( byte[] bytes )
    {
        var vecs = new List<Vector3>();
        for( var i = 0; i < bytes.Length; i += 12 )
        {
            var newVec = new Vector3( System.BitConverter.ToSingle( bytes, i ), System.BitConverter.ToSingle( bytes, i + 4 ), System.BitConverter.ToSingle( bytes, i + 8 ) );
            vecs.Add( newVec );
        }

        return vecs;
    }

Usage Example

Exemplo n.º 1
0
 static public int bytesToVector3List_s(IntPtr l)
 {
     try {
         System.Byte[] a1;
         checkType(l, 1, out a1);
         var ret = GoSpline.bytesToVector3List(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of GoSpline::bytesToVector3List