Exemple #1
0
BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld	&world, const F64 &time)
{
	static LLFastTimer::DeclareTimer ftm("Text Bubble");
	LLFastTimer t(ftm);

	F32 dt = mUpdateTimer.getElapsedTimeF32();
	// Die after a few seconds.
	if (dt > 1.5f)
	{
		return FALSE;
	}

	LLViewerObject::idleUpdate(agent, world, time);

	setScale(0.5f * (1.f+dt) * LLVector3(1.5f, 1.5f, 0.5f));

	F32 alpha = 0.35f*dt;

	LLColor4 color = mColor;
	color.mV[VALPHA] -= alpha;
	if (color.mV[VALPHA] <= 0.05f)
	{
		return FALSE;
	}
	S32 i;
	for (i = 0; i < getNumTEs(); i++)
	{
		setTEColor(i, color);
		setTEFullbright(i, TRUE);
	}

	gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
	return TRUE;
}
Exemple #2
0
LLVOTextBubble::LLVOTextBubble(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
:	LLAlphaObject(id, pcode, regionp)
{
	setScale(LLVector3(1.5f, 1.5f, 0.25f));
	mbCanSelect = FALSE;
	mLOD = MIN_LOD;
	mVolumeChanged = TRUE;
	setVelocity(LLVector3(0.f, 0.f, 0.75f));
	LLVolumeParams volume_params;
	volume_params.setType(LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE);
	volume_params.setBeginAndEndS(0.f, 1.f);
	volume_params.setBeginAndEndT(0.f, 1.f);
	volume_params.setRatio(0.25f, 0.25f);
	volume_params.setShear(0.f, 0.f);
	setVolume(volume_params, 0);
	mColor = LLColor4(1.0f, 0.0f, 0.0f, 1.f);
	S32 i;
	for (i = 0; i < getNumTEs(); i++)
	{
		setTEColor(i, mColor);
		setTETexture(i, LLUUID(IMG_DEFAULT));
	}
}
void LLPrimitive::copyTEs(const LLPrimitive *primitivep)
{
	U32 i;
	if (primitivep->getNumTEs() != getNumTEs())
	{
		llwarns << "Primitives don't have same number of TE's" << llendl;
	}
	U32 num_tes = llmin(primitivep->getNumTEs(), getNumTEs());
	for (i = 0; i < num_tes; i++)
	{
		const LLTextureEntry *tep = primitivep->getTE(i);
		F32 s, t;
		setTETexture(i, tep->getID());
		setTEColor(i, tep->getColor());
		tep->getScale(&s, &t);
		setTEScale(i, s, t);
		tep->getOffset(&s, &t);
		setTEOffset(i, s, t);
		setTERotation(i, tep->getRotation());
		setTEBumpShinyFullbright(i, tep->getBumpShinyFullbright());
		setTEMediaTexGen(i, tep->getMediaTexGen());
		setTEGlow(i, tep->getGlow());
	}
}