Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (FrameId != 0)
            {
                hash ^= FrameId.GetHashCode();
            }
            if (ShapeType != global::Physics.Telemetry.Serialised.ShapeTypePacket.Obb)
            {
                hash ^= ShapeType.GetHashCode();
            }
            if (obbShape_ != null)
            {
                hash ^= ObbShape.GetHashCode();
            }
            if (tetrahedronShape_ != null)
            {
                hash ^= TetrahedronShape.GetHashCode();
            }
            if (convexHullShape_ != null)
            {
                hash ^= ConvexHullShape.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
        private void ProcessShapeAdded(BasePacketHeader packet)
        {
            ShapeCreatedMessage shapeCreatedPacket = ShapeCreatedMessage.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData, packet.messageHeader.DataSize);

            switch (shapeCreatedPacket.ShapeType)
            {
            case ShapeTypePacket.Obb:
            {
                ObbShapePacket createdObbPacket = ObbShapePacket.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData + shapeCreatedPacket.CalculateSize(), shapeCreatedPacket.ShapeSize);

                ObbShape createdObb = new ObbShape();
                createdObb.ImportFromPacket(createdObbPacket);

                RegisterNewlyReceivedShape(packet, createdObb);
            }
            break;

            case ShapeTypePacket.Sphere:
                break;

            case ShapeTypePacket.Cone:
                break;

            case ShapeTypePacket.ConvexHull:
            {
                ConvexHullShapePacket createdConvexHullPacket = ConvexHullShapePacket.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData + shapeCreatedPacket.CalculateSize(), shapeCreatedPacket.ShapeSize);

                ConvexHullShape createdConvexHull = new ConvexHullShape();
                createdConvexHull.ImportFromPacket(createdConvexHullPacket);

                RegisterNewlyReceivedShape(packet, createdConvexHull);
            }
            break;

            case ShapeTypePacket.Tetrahedron:
            {
                TetrahedronShapePacket createdTetrahedronPacket = TetrahedronShapePacket.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData + shapeCreatedPacket.CalculateSize(), shapeCreatedPacket.ShapeSize);

                TetrahedronShape createdTetrahedron = new TetrahedronShape();
                createdTetrahedron.ImportFromPacket(createdTetrahedronPacket);

                RegisterNewlyReceivedShape(packet, createdTetrahedron);
            }
            break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
 public void MergeFrom(ShapeFrameIterationPacket other)
 {
     if (other == null)
     {
         return;
     }
     if (other.FrameId != 0)
     {
         FrameId = other.FrameId;
     }
     if (other.ShapeType != global::Physics.Telemetry.Serialised.ShapeTypePacket.Obb)
     {
         ShapeType = other.ShapeType;
     }
     if (other.obbShape_ != null)
     {
         if (obbShape_ == null)
         {
             ObbShape = new global::Physics.Telemetry.Serialised.ObbShapePacket();
         }
         ObbShape.MergeFrom(other.ObbShape);
     }
     if (other.tetrahedronShape_ != null)
     {
         if (tetrahedronShape_ == null)
         {
             TetrahedronShape = new global::Physics.Telemetry.Serialised.TetrahedronShapePacket();
         }
         TetrahedronShape.MergeFrom(other.TetrahedronShape);
     }
     if (other.convexHullShape_ != null)
     {
         if (convexHullShape_ == null)
         {
             ConvexHullShape = new global::Physics.Telemetry.Serialised.ConvexHullShapePacket();
         }
         ConvexHullShape.MergeFrom(other.ConvexHullShape);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemplo n.º 4
0
 public TetrahedronPropertyWrapper(TetrahedronShape tetrahedron)
     : base(tetrahedron)
 {
     WrappedTetrahedron = tetrahedron;
 }