Exemple #1
0
BOOL LLTexLayerParamAlpha::getSkip() const
{
	if (!mTexLayer)
	{
		return TRUE;
	}

	const LLVOAvatar *avatar = mTexLayer->getTexLayerSet()->getAvatar();

	if (((LLTexLayerParamAlphaInfo *)getInfo())->mSkipIfZeroWeight)
	{
		F32 effective_weight = (avatar->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
		if (is_approx_zero(effective_weight)) 
		{
			return TRUE;
		}
	}

	LLWearableType::EType type = (LLWearableType::EType)getWearableType();
	if ((type != LLWearableType::WT_INVALID) && !avatar->isWearingWearableType(type))
	{
		return TRUE;
	}

	return FALSE;
}
void LLViewerJoystick::cursorPush(F32 inc)
{
	static F32 prev_inc = 0.f;  // Smooth a little.
	if (!is_approx_zero(inc))
	{
		S32 x, y;
		LLUI::getMousePositionScreen(&x, &y);
		y = llclamp(y + linear_ramp(inc, prev_inc), 0, gViewerWindow->getWindowHeightRaw());
		LLUI::setMousePositionScreen(x, y);
	}
	prev_inc = inc;
}
void LLViewerJoystick::cursorZoom(F32 inc)
{
	if (!is_approx_zero(inc))
	{
		static U8 count = 0;
		++count;
		if (count == 3) // Slow down the zoom in/out.
		{
			gViewerWindow->handleScrollWheel(inc > F_APPROXIMATELY_ZERO ? 1 : -1);
			count = 0;
		}
	}
}