Пример #1
0
        static Offset <FTriple> Serialise(FlatBufferBuilder b, IHasTriple numeral)
        {
            FTriple.StartFTriple(b);
            var vec3 = numeral.ObservationValue;

            FTriple.AddVec3(b,
                            FVector3.CreateFVector3(b,
                                                    vec3.x,
                                                    vec3.y,
                                                    vec3.z));
            var granularity = numeral.TripleSpace.DecimalGranularity;
            var xs          = numeral.TripleSpace.Xspace;
            var ys          = numeral.TripleSpace.Yspace;
            var zs          = numeral.TripleSpace.Zspace;

            FTriple.AddXRange(b,
                              FRange.CreateFRange(b,
                                                  granularity,
                                                  xs.Max,
                                                  xs.Min,
                                                  xs.NormalisedBool));
            FTriple.AddYRange(b,
                              FRange.CreateFRange(b,
                                                  granularity,
                                                  ys.Max,
                                                  ys.Min,
                                                  ys.NormalisedBool));
            FTriple.AddZRange(b,
                              FRange.CreateFRange(b,
                                                  granularity,
                                                  zs.Max,
                                                  zs.Min,
                                                  zs.NormalisedBool));
            return(FTriple.EndFTriple(b));
        }
Пример #2
0
        static Offset <FTriple> build_position(FlatBufferBuilder b, PositionConfigurable observer)
        {
            var pos = observer.ObservationValue;

            FTriple.StartFTriple(b);
            FTriple.AddVec3(b, FVector3.CreateFVector3(b, pos.x, pos.y, pos.z));
            return(FTriple.EndFTriple(b));
        }
Пример #3
0
        static Offset <FTriple> build_triple(FlatBufferBuilder b, IHasTriple numeral)
        {
            FTriple.StartFTriple(b);
            var vec3 = numeral.ObservationValue;

            FTriple.AddVec3(b, FVector3.CreateFVector3(b, vec3.x, vec3.y, vec3.z));
            //FSingle.AddRange(b, numeral.ObservationValue);
            return(FTriple.EndFTriple(b));
        }