Skip to content

Commit

Permalink
Cleaning up the sequence of loading skybox images
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanmunawar committed Jan 19, 2022
1 parent e698f9f commit 697dafd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions adf_loader/version_1_0/adf_loader_1_0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2809,10 +2809,10 @@ bool ADFLoader_1_0::loadWorldAttribs(YAML::Node *a_node, afWorldAttributes *attr
)
{

attribs->m_skyBoxAttribs.m_leftImageFilepath = localPath / skyBoxNode["left"].as<string>();
attribs->m_skyBoxAttribs.m_rightImageFilepath = localPath / skyBoxNode["right"].as<string>();
attribs->m_skyBoxAttribs.m_topImageFilepath = localPath / skyBoxNode["top"].as<string>();
attribs->m_skyBoxAttribs.m_leftImageFilepath = localPath / skyBoxNode["left"].as<string>();
attribs->m_skyBoxAttribs.m_bottomImageFilepath = localPath / skyBoxNode["bottom"].as<string>();
attribs->m_skyBoxAttribs.m_topImageFilepath = localPath / skyBoxNode["top"].as<string>();
attribs->m_skyBoxAttribs.m_frontImageFilepath = localPath / skyBoxNode["front"].as<string>();
attribs->m_skyBoxAttribs.m_backImageFilepath = localPath / skyBoxNode["back"].as<string>();

Expand Down
6 changes: 3 additions & 3 deletions ambf_framework/afFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6428,8 +6428,8 @@ void afWorld::loadSkyBox(){

res[0] = newTexture->m_images[0]->loadFromFile(m_skyBoxAttribs.m_rightImageFilepath.c_str());
res[1] = newTexture->m_images[1]->loadFromFile(m_skyBoxAttribs.m_leftImageFilepath.c_str());
res[2] = newTexture->m_images[3]->loadFromFile(m_skyBoxAttribs.m_topImageFilepath.c_str());
res[3] = newTexture->m_images[2]->loadFromFile(m_skyBoxAttribs.m_bottomImageFilepath.c_str());
res[2] = newTexture->m_images[2]->loadFromFile(m_skyBoxAttribs.m_bottomImageFilepath.c_str());
res[3] = newTexture->m_images[3]->loadFromFile(m_skyBoxAttribs.m_topImageFilepath.c_str());
res[4] = newTexture->m_images[4]->loadFromFile(m_skyBoxAttribs.m_frontImageFilepath.c_str());
res[5] = newTexture->m_images[5]->loadFromFile(m_skyBoxAttribs.m_backImageFilepath.c_str());

Expand Down Expand Up @@ -7471,7 +7471,7 @@ void afCamera::renderSkyBox(){
cGenericObject* go;
cRenderOptions ro;
m_afWorld->m_skyBoxMesh->getShaderProgram()->use(go, ro);
cMatrix3d rotOffsetPre(0, 0, 90, C_EULER_ORDER_ZYX, false, true);
cMatrix3d rotOffsetPre(90, -90, 0, C_EULER_ORDER_XYZ, false, true);
cMatrix3d rotOffsetPost(90, 90, 0, C_EULER_ORDER_ZYX, false, true);
cTransform viewMat = rotOffsetPre * getLocalTransform() * rotOffsetPost;
m_afWorld->m_skyBoxMesh->getShaderProgram()->setUniform("viewMat", viewMat, 1);
Expand Down
2 changes: 1 addition & 1 deletion external/chai3d/src/materials/CTextureCubeMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class cTextureCubeMap : public cTexture1d
cImagePtr m_images[6];
// RIGHT
// LEFT
// TOP
// BOTTOM
// TOP
// FRONT
// BACK

Expand Down

0 comments on commit 697dafd

Please sign in to comment.