Example #1
0
        public ObbShapePacket ExportToPacket()
        {
            ObbShapePacket packet = new ObbShapePacket();

            ExportToPacket(packet);

            return(packet);
        }
Example #2
0
        public void ImportFromPacket(ObbShapePacket packetObbShape)
        {
            if (packetObbShape != null)
            {
                base.ImportFromPacket(packetObbShape.Base);

                HalfExtents.X = packetObbShape.HalfExtents.X;
                HalfExtents.Y = packetObbShape.HalfExtents.Y;
                HalfExtents.Z = packetObbShape.HalfExtents.Z;
            }
        }
Example #3
0
        public void ExportToPacket(ObbShapePacket packet)
        {
            if (packet != null)
            {
                packet.Base = base.ExportToPacket();

                packet.HalfExtents   = new Vector3Packet();
                packet.HalfExtents.X = HalfExtents.X;
                packet.HalfExtents.Y = HalfExtents.Y;
                packet.HalfExtents.Z = HalfExtents.Z;
            }
        }
Example #4
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;
            }
        }