private void CreatePortalHotspots(RoomData room)
    {
        foreach (RoomPortal portalEntry in room.RoomPortals)
        {
            AABB2d boundingBox = new AABB2d();
            Point2d screenP0 = ClientGameConstants.ConvertRoomPositionToScreenPosition(portalEntry.boundingBox.Min);
            Point2d screenP1 = ClientGameConstants.ConvertRoomPositionToScreenPosition(portalEntry.boundingBox.Max);

            boundingBox.EnclosePoint(screenP0);
            boundingBox.EnclosePoint(screenP1);

            m_hotspotWidgets.Add(
                new HotspotWidget(m_rootWidgetGroup,
                    "Portal" + portalEntry.portal_id.ToString(),
                    boundingBox.Extents.i,
                    boundingBox.Extents.j,
                    boundingBox.Min.x,
                    boundingBox.Min.y,
                    new HotspotInfo {hotspotType=eHotspotType.portal, hotspotEntity=portalEntry}));
        }
    }
示例#2
0
 public AABB2d EncloseAABB(AABB2d other)
 {
     return(new AABB2d(Point2d.Min(m_pMin, other.m_pMin), Point2d.Max(m_pMax, other.m_pMax)));
 }
    private void CreateEnergyTankHotspots(RoomData room)
    {
        foreach (EnergyTankData energyTankData in room.EnergyTankMap.Values)
        {
            AABB2d boundingBox = new AABB2d();
            Point2d screenP0 = ClientGameConstants.ConvertRoomPositionToScreenPosition(energyTankData.boundingBox.Min);
            Point2d screenP1 = ClientGameConstants.ConvertRoomPositionToScreenPosition(energyTankData.boundingBox.Max);

            boundingBox.EnclosePoint(screenP0);
            boundingBox.EnclosePoint(screenP1);

            m_hotspotWidgets.Add(
                new HotspotWidget(m_rootWidgetGroup,
                    "EnergyTank" + energyTankData.energy_tank_id.ToString(),
                    boundingBox.Extents.i,
                    boundingBox.Extents.j,
                    boundingBox.Min.x,
                    boundingBox.Min.y,
                    new HotspotInfo {hotspotType=eHotspotType.energy_tank, hotspotEntity=energyTankData}));
        }
    }
示例#4
0
 public bool Equals(AABB2d other)
 {
     return(m_pMin.Equals(other.m_pMin) && m_pMax.Equals(other.m_pMax));
 }
示例#5
0
 public AABB2d(AABB2d other)
 {
     this.m_pMin = new Point2d(other.m_pMin);
     this.m_pMax = new Point2d(other.m_pMax);
 }
示例#6
0
 public AABB2d(AABB2d other)
 {
     this.m_pMin = new Point2d(other.m_pMin);
     this.m_pMax = new Point2d(other.m_pMax);
 }
示例#7
0
 public bool Equals(AABB2d other)
 {
     return m_pMin.Equals(other.m_pMin) && m_pMax.Equals(other.m_pMax);
 }
示例#8
0
 public AABB2d EncloseAABB(AABB2d other)
 {
     return new AABB2d(Point2d.Min(m_pMin, other.m_pMin), Point2d.Max(m_pMax, other.m_pMax));
 }