Beispiel #1
0
void CaelumEnvironment::setWaterEnabled(bool enabled)
{
	if (enabled) {
		if (!mWater) {
			setupWater();
		}
	} else {
		if (mWater) {
			delete mWater;
			mWater = 0;
		}
	}
}
KDvoid Sample_Fresnel::setupContent ( KDvoid )
{
    m_pCamera->setPosition ( -50, 125, 760 );
    m_pCameraMan->setTopSpeed ( 280 );
    
    m_pSceneMgr->setAmbientLight ( ColourValue ( 0.5, 0.5, 0.5 ) );  // set ambient light
    
    m_pSceneMgr->setSkyBox ( true, "Examples/CloudyNoonSkyBox" );  // set a skybox
    
    // make the scene's main light come from above
    Light*  pLight = m_pSceneMgr->createLight ( );
    pLight->setType ( Light::LT_DIRECTIONAL );
    pLight->setDirection ( Vector3::NEGATIVE_UNIT_Y );
    
    setupWater ( );
    setupProps ( );
    setupFish  ( );
}
Beispiel #3
0
Scene * newScene(GLboolean vsync)
{
    Scene * scene = (Scene *) malloc(sizeof(Scene));

    scene->context = (ContextSize *) malloc(sizeof(ContextSize));
    scene->context->w = CONTEXT_WIDTH_INITIAL;
    scene->context->h = CONTEXT_HEIGHT_INITIAL;

    setupOpenGLContext(scene->context);
    checkOpenGLVersion();
    setupOpenGLState(scene->context, vsync);

    scene->camera = newCamera(scene->context->w, scene->context->h);

    scene->world = getWorld("world.txt");
    scene->water = getWater();
    setupWater(scene->water->drawSP, scene->world);
    setupWorldUniforms(scene->world->sp, scene->water);

    return scene;
}