protected void WriteHalfVector4(WritableSection section, Vector4 v) { section.Writer.Write(HalfHelpers.SingleToHalf(v.X)); section.Writer.Write(HalfHelpers.SingleToHalf(v.Y)); section.Writer.Write(HalfHelpers.SingleToHalf(v.Z)); section.Writer.Write(HalfHelpers.SingleToHalf(v.W)); }
protected void WriteHalfVector3As4(WritableSection section, Vector3 v) { section.Writer.Write(HalfHelpers.SingleToHalf(v.X)); section.Writer.Write(HalfHelpers.SingleToHalf(v.Y)); section.Writer.Write(HalfHelpers.SingleToHalf(v.Z)); section.Writer.Write((ushort)0); }
protected Vector2 ReadHalfVector2(GR2Reader reader) { Vector2 v; v.X = HalfHelpers.HalfToSingle(reader.Reader.ReadUInt16()); v.Y = HalfHelpers.HalfToSingle(reader.Reader.ReadUInt16()); return(v); }
public static Vector3 ReadHalfVector3(GR2Reader reader) { Vector3 v; v.X = HalfHelpers.HalfToSingle(reader.Reader.ReadUInt16()); v.Y = HalfHelpers.HalfToSingle(reader.Reader.ReadUInt16()); v.Z = HalfHelpers.HalfToSingle(reader.Reader.ReadUInt16()); return(v); }
public static void WriteHalfVector3(WritableSection section, Vector3 v) { section.Writer.Write(HalfHelpers.SingleToHalf(v.X)); section.Writer.Write(HalfHelpers.SingleToHalf(v.Y)); section.Writer.Write(HalfHelpers.SingleToHalf(v.Z)); }