示例#1
0
文件: Sky.cpp 项目: vienis/noggit
void Skies::initSky(Vec3D pos, int t)
{
    if (numSkies == 0) return;

    findSkyWeights(pos);

    for (int i = 0; i<18; ++i) colorSet[i] = Vec3D(1, 1, 1);

    // interpolation
    for (size_t j = 0; j<skies.size(); j++) {
        if (skies[j].weight>0) {
            // now calculate the color rows
            for (int i = 0; i<18; ++i) {
                if ((skies[j].colorFor(i, t).x>1.0f) || (skies[j].colorFor(i, t).y>1.0f) || (skies[j].colorFor(i, t).z>1.0f))
                {
                    LogDebug << "Sky " << j << " " << i << " is out of bounds!" << std::endl;
                    continue;
                }
                colorSet[i] += skies[j].colorFor(i, t) * skies[j].weight;
            }
        }
    }
    for (int i = 0; i<18; ++i)
    {
        colorSet[i] -= Vec3D(1, 1, 1);
    }
}
示例#2
0
void Skies::initSky(Vec3D pos, int t)
{
	if (numSkies==0) 
		return;

	findSkyWeights(pos);

	for (int i=0; i<18; i++) colorSet[i] = Vec3D(1,1,1);

	// interpolation
	for (size_t j=0; j<skies.size(); j++) {
		if (skies[j].weight>0) {
			// now calculate the color rows
			for (int i=0; i<18; i++) {
				if((skies[j].colorFor(i,t).x>1.0f)||(skies[j].colorFor(i,t).y>1.0f)||(skies[j].colorFor(i,t).z>1.0f))
				{
					gLog("Sky %d %d is out of bounds!\n",j,i);
					continue;
				}
				colorSet[i] += skies[j].colorFor(i,t) * skies[j].weight;
			}
		}
	}
	for (int i=0; i<18; i++) 
	{
		colorSet[i] -= Vec3D( 1, 1, 1 );
	}
}
示例#3
0
文件: sky.cpp 项目: MgCore/mcapps
void Skies::initSky(Vec3D pos, int t)
{
	if (numSkies==0) return;

	findSkyWeights(pos);

	for (int i=0; i<18; i++) colorSet[i] = Vec3D(0,0,0);

	// interpolation
	for (size_t j=0; j<skies.size(); j++) {
		if (skies[j].weight>0) {
			// now calculate the color rows
			for (int i=0; i<18; i++) {
				colorSet[i] += skies[j].colorFor(i,t) * skies[j].weight;
			}
		}
	}
}