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); }
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; } }
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); }
public ObbPropertyWrapper(ObbShape obb) : base(obb) { WrappedObb = obb; }