예제 #1
0
파일: llsky.cpp 프로젝트: Boy/netbook
void LLSky::init(const LLVector3 &sun_direction)
{
	mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, gAgent.getRegion());
	mVOSkyp->initSunDirection(sun_direction, LLVector3());
	gPipeline.addObject((LLViewerObject *)mVOSkyp);

	mVOStarsp = (LLVOStars *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_STARS, gAgent.getRegion());
	gPipeline.addObject((LLViewerObject *)mVOStarsp);
	
	mVOGroundp = (LLVOGround*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_GROUND, gAgent.getRegion());
	LLVOGround *groundp = mVOGroundp;
	gPipeline.addObject((LLViewerObject *)groundp);

	gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio"));
	
	////////////////////////////
	//
	// Legacy code, ignore
	//
	//

	// Get the parameters.
	mSunDefaultPosition = gSavedSettings.getVector3("SkySunDefaultPosition");


	if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition") || mOverrideSimSunPosition)
	{
		setSunDirection(mSunDefaultPosition, LLVector3(0.f, 0.f, 0.f));
	}
	else
	{
		setSunDirection(sun_direction, LLVector3(0.f, 0.f, 0.f));
	}
	
	mUpdatedThisFrame = TRUE;
}
예제 #2
0
void LLSky::init(const LLVector3 &sun_direction)
{
	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	mVOWLSkyp = static_cast<LLVOWLSky*>(gObjectList.createObjectViewer(LLViewerObject::LL_VO_WL_SKY, NULL));
	mVOWLSkyp->initSunDirection(sun_direction, LLVector3::zero);
	gPipeline.createObject(mVOWLSkyp.get());

	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, NULL);

	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	mVOSkyp->initSunDirection(sun_direction, LLVector3());

	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	gPipeline.createObject((LLViewerObject *)mVOSkyp);

	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	mVOGroundp = (LLVOGround*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_GROUND, NULL);
	LLVOGround *groundp = mVOGroundp;
	gPipeline.createObject((LLViewerObject *)groundp);

	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio"));	

	////////////////////////////
	//
	// Legacy code, ignore
	//
	//

	// Get the parameters.
	mSunDefaultPosition = gSavedSettings.getVector3("SkySunDefaultPosition");

	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition") || mOverrideSimSunPosition)
	{
		setSunDirection(mSunDefaultPosition, LLVector3(0.f, 0.f, 0.f));
	}
	else
	{
		setSunDirection(sun_direction, LLVector3(0.f, 0.f, 0.f));
	}

	LLGLState::checkStates();
	LLGLState::checkTextureChannels();

	mUpdatedThisFrame = TRUE;
}