public float4 ReadFloat4(string _block) { Parser P = new Parser(_block); float4 Result = new float4(); int coordinateIndex = 0; while (P.OK) { float value = P.ReadFloat(); P.ReadString(); // Skip separator switch (coordinateIndex) { case 0: Result.x = value; break; case 1: Result.y = value; break; case 2: Result.z = value; break; case 3: Result.w = value; break; default: Error("Unexpected coordinate!"); break; } coordinateIndex++; } return(Result); }
public float4 ReadFloat4( string _block ) { Parser P = new Parser( _block ); float4 Result = new float4(); int coordinateIndex = 0; while ( P.OK ) { float value = P.ReadFloat(); P.ReadString(); // Skip separator switch ( coordinateIndex ) { case 0: Result.x = value; break; case 1: Result.y = value; break; case 2: Result.z = value; break; case 3: Result.w = value; break; default: Error( "Unexpected coordinate!" ); break; } coordinateIndex++; } return Result; }