/// <summary>
 /// Modify value to account for some rounding error
 /// </summary>
 private static float FixRoundingShort(float value)
 {
     value = VertexElementStream.Clamp(value);
     if (value > 0 && value < 1)
     {
         value += 1.0f / 32767.0f;
         value  = VertexElementStream.Clamp(value);
     }
     return(value);
 }
Esempio n. 2
0
 public VertexStreamXbox(Stream stream)
 {
     Stream = new VertexElementStream(stream, EndianFormat.BigEndian);
 }
 /// <summary>
 /// Change basis [-1,1] to [0,1] uniformly
 /// </summary>
 private static float ConvertToNormalBasis(float value)
 {
     value = VertexElementStream.Clamp(value);
     return((value / 2.0f) + 0.5f);
 }
 /// <summary>
 /// Change basis [0,1] to [-1,1] uniformly
 /// </summary>
 private static float ConvertFromNormalBasis(float value)
 {
     value = VertexElementStream.Clamp(value, 0.0f, 1.0f);
     return(2.0f * (value - 0.5f));
 }
Esempio n. 5
0
 public VertexStreamMS23(Stream stream)
 {
     _stream = new VertexElementStream(stream);
 }
Esempio n. 6
0
 public VertexStreamInterop(Stream stream)
 {
     _stream = new VertexElementStream(stream);
 }