コード例 #1
0
void FSLSLBridge::setupBridgePrim(LLViewerObject* object)
{
	lldebugs << "Entering bridge container setup..." << llendl;

	LLProfileParams profParams(LL_PCODE_PROFILE_CIRCLE, F32(0.230), F32(0.250), F32(0.95));
	LLPathParams pathParams(LL_PCODE_PATH_CIRCLE, F32(0.2), F32(0.22), 
		F32(0.0), F32(350.0),	//scale
		F32(0.0), F32(0.0),		//shear
		F32(0), F32(0),			//twist
		F32(0),					//offset
		F32(0), F32(0.0),		//taper
		F32(0.05), F32(0.05));	//revolutions, skew
	pathParams.setRevolutions(F32(1.0));
	object->setVolume(LLVolumeParams(profParams, pathParams), 0);

	object->setScale(LLVector3(10.0f, 10.0f, 10.0f), TRUE);
	for (int i = 0; i < object->getNumTEs(); i++)
	{
		LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE );
		object->setTEImage(i, image); //transparent texture
	}
	object->setChanged(LLXform::MOVED | LLXform::SILHOUETTE | LLXform::TEXTURE);

	//object->setTETexture(0, LLUUID("29de489d-0491-fb00-7dab-f9e686d31e83")); //another test texture
	object->sendShapeUpdate();
	object->markForUpdate(TRUE);

	//object->setFlags(FLAGS_TEMPORARY_ON_REZ, true);
	object->addFlags(FLAGS_TEMPORARY_ON_REZ);
	object->updateFlags();

	lldebugs << "End bridge container setup." << llendl;
}
コード例 #2
0
void FSLSLBridge :: setupBridge(LLViewerObject *object)
{
	llinfos << "enter rock change" << llendl;

	mpBridge->setDescription(mCurrentFullName);

	LLProfileParams profParams(LL_PCODE_PROFILE_CIRCLE, F32(0.230), F32(0.250), F32(0.95));
	LLPathParams pathParams(LL_PCODE_PATH_CIRCLE, F32(0), F32(0.2), F32(0.01), F32(0.01), F32(0.00), F32(0.0), 
		F32(0), F32(0), F32(0), F32(0), F32(0), F32(0.01), 0);
	
	object->setVolume(LLVolumeParams(profParams, pathParams), 0);

	for (int i = 0; i < object->getNumTEs(); i++)
	{
		object->setTETexture(i, LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903")); //transparent texture
	}

	//object->setTETexture(0, LLUUID("29de489d-0491-fb00-7dab-f9e686d31e83")); //another test texture
	object->setScale(LLVector3(F32(0.01), F32(0.01), F32(0.01)));
	object->sendShapeUpdate();
	object->markForUpdate(TRUE);

	//object->setFlags(FLAGS_TEMPORARY_ON_REZ, true);
	object->addFlags(FLAGS_TEMPORARY_ON_REZ);
	object->updateFlags();

	gInventory.updateItem(mpBridge);
    gInventory.notifyObservers();

	llinfos << "end rock change, start script creation" << llendl;

	//add bridge script to object
	if (object)
	{
		create_script_inner(object);
	}
}