void NavigationBarWidget::propagateSlideClicked()
	{
	if ( isFullyVisible() )
		emit slideToInvisibleClicked();
	else
		emit slideToVisibleClicked();
	}
void NavigationBarWidget::slide()
	{
	// Understand in which position it is at the beginning of the Animation
	iSlidingToInvisible = isFullyVisible();
	iSlidingVPosition = this->y();
	iSlidingTimer->start(ANIMATION_TICK_FREQUENCY); // "Tick" every 10ms
	}
Beispiel #3
0
void AddressBarWidget::setLoadingStarted()
	{
	if ( !isFullyVisible() )
		{
		// Slide down if it's not already visible
		slide();
		}
	ui.BusyLoadingChaseWidget->setAnimated(true);
	ui.BusyLoadingChaseWidget->show();
	ui.LoadingProgressBar->show();
	
	// Set to show the "Stop" Icon
	setStopIcon();
	}
void NavigationBarWidget::slideToInvisible()
	{
	if ( isFullyVisible() )
		slide();
	}
	/* special function that returns true only when portal fully fits inside the frustum. */
	bool PCZFrustum::isFullyVisible(const PortalBase* portal) const
	{
		// if portal isn't enabled, it's not visible
		if (!portal->getEnabled()) return false;

		// if the frustum has no planes, just return true
		if (mActiveCullingPlanes.empty())
		{
			return true;
		}
		// check if this portal is already in the list of active culling planes (avoid
		// infinite recursion case)
		PCPlaneList::const_iterator pit = mActiveCullingPlanes.begin();
		while ( pit != mActiveCullingPlanes.end() )
		{
			PCPlane * plane = *pit;
			if (plane->getPortal() == portal)
			{
				return false;
			}
			pit++;
		}
		// if portal is of type AABB or Sphere, then use simple bound check against planes
		if (portal->getType() == PortalBase::PORTAL_TYPE_AABB)
		{
			AxisAlignedBox aabb;
			aabb.setExtents(portal->getDerivedCorner(0), portal->getDerivedCorner(1));
			return isFullyVisible(aabb);
		}
		else if (portal->getType() == PortalBase::PORTAL_TYPE_SPHERE)
		{
			return isFullyVisible(portal->getDerivedSphere());
		}

		// only do this check if it's a portal. (anti portal doesn't care about facing)
		if (portal->getTypeFlags() == PortalFactory::FACTORY_TYPE_FLAG)
		{
			// check if the portal norm is facing the frustum
			Vector3 frustumToPortal = portal->getDerivedCP() - mOrigin;
			Vector3 portalDirection = portal->getDerivedDirection();
			Real dotProduct = frustumToPortal.dotProduct(portalDirection);
			if ( dotProduct > 0 )
			{
				// portal is faced away from Frustum 
				return false;
			}
		}

		// Check originPlane if told to
		if (mUseOriginPlane)
		{
			// we have to check each corner of the portal
			for (int corner = 0; corner < 4; corner++)
			{
				Plane::Side side = mOriginPlane.getSide(portal->getDerivedCorner(corner));
				if (side == Plane::NEGATIVE_SIDE) return false;
			}
		}

		// For each active culling plane, see if any portal points are on the negative 
		// side. If so, the portal is not fully visible
		pit = mActiveCullingPlanes.begin();
		while ( pit != mActiveCullingPlanes.end() )
		{
			PCPlane * plane = *pit;
			// we have to check each corner of the portal
			for (int corner = 0; corner < 4; corner++)
			{
				Plane::Side side =plane->getSide(portal->getDerivedCorner(corner));
				if (side == Plane::NEGATIVE_SIDE) return false;
			}
			pit++;
		}
		// no plane culled all the portal points and the norm
		// was facing the frustum, so this portal is fully visible
		return true;
	}
Beispiel #6
0
void AddressBarWidget::slideToInvisible()
	{
	if ( isFullyVisible() )
		slide();
	}