static Offset <FQuadruple> build_quadruple(FlatBufferBuilder b, IHasQuadruple numeral) { FQuadruple.StartFQuadruple(b); var quad = numeral.ObservationValue; FQuadruple.AddQuat(b, FQuaternion.CreateFQuaternion(b, quad.x, quad.y, quad.z, quad.z)); //FSingle.AddRange(b, numeral.ObservationValue); return(FQuadruple.EndFQuadruple(b)); }
static Offset <FQuadruple> Serialise(FlatBufferBuilder b, IHasQuadruple numeral) { FQuadruple.StartFQuadruple(b); var quad = numeral.ObservationValue; FQuadruple.AddQuat(b, FQuaternion.CreateFQuaternion(b, quad.x, quad.y, quad.z, quad.z)); var granularity = numeral.QuadSpace.DecimalGranularity; var xs = numeral.QuadSpace.Xspace; var ys = numeral.QuadSpace.Yspace; var zs = numeral.QuadSpace.Zspace; var ws = numeral.QuadSpace.Wspace; FQuadruple.AddXRange(b, FRange.CreateFRange(b, granularity, xs.Max, xs.Min, xs.NormalisedBool)); FQuadruple.AddYRange(b, FRange.CreateFRange(b, granularity, ys.Max, ys.Min, ys.NormalisedBool)); FQuadruple.AddZRange(b, FRange.CreateFRange(b, granularity, zs.Max, zs.Min, zs.NormalisedBool)); FQuadruple.AddWRange(b, FRange.CreateFRange(b, granularity, ws.Max, ws.Min, ws.NormalisedBool)); return(FQuadruple.EndFQuadruple(b)); }