Latest changes from John.
This commit is contained in:
@@ -957,7 +957,7 @@ bool SkyArchive::IsEmpty() const
|
||||
* @fn SkyArchive::Load(const char* pFileName)
|
||||
* @brief Load the contents of a SkyArchive from file storage.
|
||||
*/
|
||||
bool SkyArchive::Load(const char* pFileName)
|
||||
SKYRESULT SkyArchive::Load(const char* pFileName)
|
||||
{
|
||||
if (!pFileName) {
|
||||
FAIL_RETURN_MSG(SKYRESULT_FAIL, "Error: SkyArchive::Load(): file name is NULL.");
|
||||
@@ -966,14 +966,14 @@ bool SkyArchive::Load(const char* pFileName)
|
||||
if (NULL == (pSrcFile = fopen(pFileName, "rb"))) // file opened successfully
|
||||
{
|
||||
SkyTrace("Error: SkyArchive::Load(): failed to open file for reading.");
|
||||
return false;
|
||||
return SKYRESULT_FAIL;
|
||||
}
|
||||
|
||||
SKYRESULT retVal = _Load(pSrcFile);
|
||||
fclose(pSrcFile);
|
||||
|
||||
FAIL_RETURN(retVal);
|
||||
return true;
|
||||
return SKYRESULT_OK;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
SKYRESULT MakeEmpty();
|
||||
|
||||
// Loads the contents from a file.
|
||||
bool Load(const char* pFileName);
|
||||
SKYRESULT Load(const char* pFileName);
|
||||
|
||||
// Commits the contents of a SkyArchive to file storage.
|
||||
SKYRESULT Save(const char* pFileName) const;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#ifndef __SKYBOUNDINGVOLUME_HPP__
|
||||
#define __SKYBOUNDINGVOLUME_HPP__
|
||||
|
||||
#include <vec3f.hpp>
|
||||
#include <mat44.hpp>
|
||||
#include "vec3f.hpp"
|
||||
#include "mat44.hpp"
|
||||
|
||||
// forward to reduce unnecessary dependencies
|
||||
class Camera;
|
||||
|
||||
@@ -666,7 +666,8 @@ SKYRESULT SkyCloud::Load(const SkyArchive &archive,
|
||||
|
||||
_particles.push_back(pParticle);
|
||||
}
|
||||
// this is just a bad hack to align cloud field from skyworks with local horizon at KSFO
|
||||
// this is just a bad hack to align cloud field from skyworks with local horizon at KSFO
|
||||
// this "almost" works not quite the right solution okay to get some up and running
|
||||
// we need to develop our own scheme for loading and positioning clouds
|
||||
Mat33f rot_mat;
|
||||
Vec3f moveit;
|
||||
@@ -676,9 +677,9 @@ SKYRESULT SkyCloud::Load(const SkyArchive &archive,
|
||||
0, 1, 0);
|
||||
// flip the y and z axis, clouds now sit in the x-y plane
|
||||
Rotate( rot_mat );
|
||||
|
||||
// adjust for lon af KSFO -122.357
|
||||
rot_mat.Set( -0.76604f, 0.64277f, 0.0f,
|
||||
|
||||
// adjust for lon af KSFO plus -122.357
|
||||
rot_mat.Set( -0.84473f, 0.53519f, 0.0f,
|
||||
-0.53519f, -0.84473f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f);
|
||||
|
||||
@@ -690,7 +691,7 @@ SKYRESULT SkyCloud::Load(const SkyArchive &archive,
|
||||
0.0f, 0.6103f, 0.7921f);
|
||||
|
||||
Rotate( rot_mat );
|
||||
|
||||
|
||||
moveit.Set( 1000.0, 0.0, 4050.0 );
|
||||
|
||||
Translate( moveit );
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#define __SKYRENDERABLEINSTANCE_HPP__
|
||||
|
||||
#include <vector>
|
||||
#include <mat33.hpp>
|
||||
#include <mat44.hpp>
|
||||
#include "mat33.hpp"
|
||||
#include "mat44.hpp"
|
||||
#include "SkyUtil.hpp"
|
||||
|
||||
// forward to reduce unnecessary dependencies
|
||||
|
||||
@@ -121,7 +121,7 @@ bool SkySceneLoader::Load(std::string filename)
|
||||
FAIL_RETURN(archive.FindString("CloudFile", &pFilename, i));
|
||||
|
||||
float rScale = 1.0;
|
||||
FAIL_RETURN(archive.FindFloat32("CloudScale", &rScale, i));
|
||||
FAIL_RETURN(archive.FindFloat32("CloudScale", &rScale, i));
|
||||
rScale = 30.0;
|
||||
SkyArchive cloudArchive;
|
||||
FAIL_RETURN(cloudArchive.Load(pFilename));
|
||||
@@ -129,7 +129,7 @@ bool SkySceneLoader::Load(std::string filename)
|
||||
}
|
||||
}
|
||||
|
||||
Vec3f dir(0, 0, 1);
|
||||
Vec3f dir(0, 0, 1);
|
||||
pLight->SetPosition(Vec3f(0, 0, 7000));
|
||||
pLight->SetDirection(dir);
|
||||
pLight->SetAmbient(Vec4f( 0.0f, 0.0f, 0.0f, 0.0f));
|
||||
@@ -146,8 +146,7 @@ bool SkySceneLoader::Load(std::string filename)
|
||||
return true;
|
||||
}
|
||||
|
||||
void SkySceneLoader::Set_Cloud_Orig( Point3D *posit )
|
||||
{ // use this to adjust camera position for a new tile center
|
||||
void SkySceneLoader::Set_Cloud_Orig( Point3D *posit )
|
||||
{
|
||||
// set origin for cloud coordinates to initial tile center
|
||||
origin = *posit;
|
||||
@@ -157,6 +156,12 @@ void SkySceneLoader::Set_Cloud_Orig( Point3D *posit )
|
||||
}
|
||||
|
||||
void SkySceneLoader::Update( double *view_pos )
|
||||
{
|
||||
|
||||
double wind_x, wind_y, wind_z;
|
||||
wind_x = -0.05; wind_z = 0.05;
|
||||
// just a dumb test to see if we can move the clouds en masse via the camera
|
||||
delta[0] += wind_x; delta[2] += wind_z;
|
||||
|
||||
sgdSubVec3( cam_pos, view_pos, delta );
|
||||
//cout << "ORIGIN: " << delta[0] << " " << delta[1] << " " << delta[2] << endl;
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
#include "SkyRenderable.hpp"
|
||||
#include "SkyRenderableInstance.hpp"
|
||||
#include "SkyRenderableInstanceCloud.hpp"
|
||||
//#include "SkyHeavens.hpp"
|
||||
//#include "SkyHeightField.hpp"
|
||||
|
||||
#include "camutils.hpp"
|
||||
#include <algorithm>
|
||||
@@ -518,7 +516,7 @@ SKYRESULT SkySceneManager::LoadClouds(SkyArchive& cloudArchive, float rScale /*
|
||||
cloudArchive.FindUInt32("CldNumClouds", &iNumClouds);
|
||||
|
||||
SkyArchive subArchive;
|
||||
//iNumClouds = 5; //set this value to reduce cloud field for debugging
|
||||
//iNumClouds = 5; //set this value to reduce cloud field for debugging
|
||||
for (int i = 0; i < iNumClouds; ++i)
|
||||
{
|
||||
printf("Loading # %d of %d clouds\n", i+1, iNumClouds);
|
||||
|
||||
@@ -872,12 +872,12 @@ SKYRESULT SkyTextureManager::_Create3DTextureObject(SkyTexture &texture,
|
||||
/**
|
||||
* @fn SkyTextureManager::DestroyTextureObject(SkyTexture &texture)
|
||||
* @brief destroys a SkyTexture object.
|
||||
*
|
||||
* Deletes the data as well as the OpenGL texture ID(s).
|
||||
*
|
||||
* Deletes the data as well as the OpenGL texture ID(s).
|
||||
*/
|
||||
void SkyTextureManager::DestroyTextureObject(SkyTexture &texture)
|
||||
{ /*
|
||||
if (texture.GetID)
|
||||
glDeleteTextures(1, &(texture.iTextureID));
|
||||
if (texture.bSliced3D && texture.pSliceIDs)
|
||||
if (texture.bSliced3D && texture.pSliceIDs)
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ SKYRESULT SkyTextureState::Activate()
|
||||
if (pCurrent->GetTextureParameter(i, GL_TEXTURE_WRAP_R) != paramValue)
|
||||
{
|
||||
FAIL_RETURN(pCurrent->SetTextureParameter(i, GL_TEXTURE_WRAP_R, paramValue));
|
||||
//glTexParameteri(eTarget, GL_TEXTURE_WRAP_R, paramValue);
|
||||
glTexParameteri(eTarget, GL_TEXTURE_WRAP_R, paramValue);
|
||||
}
|
||||
//GLVU::CheckForGLError("SkyTextureState::Activate(2)");
|
||||
paramValue = GetTextureParameter(i, GL_TEXTURE_MIN_FILTER);
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#define CAMERA
|
||||
|
||||
#include <stdio.h>
|
||||
#include <vec3f.hpp>
|
||||
#include <mat16fv.hpp>
|
||||
#include "vec3f.hpp"
|
||||
#include "mat16fv.hpp"
|
||||
|
||||
class Camera
|
||||
{
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// $Id$
|
||||
//----------------------------------------------------------------------------
|
||||
#include <iostream.h>
|
||||
#include <vec3f.hpp>
|
||||
#include <mat44.hpp>
|
||||
#include "vec3f.hpp"
|
||||
#include "mat44.hpp"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user