Ver Fonte

Merge branch 'next' of https://github.com/seanpaultaylor/GamePlay into next

Conflicts:
	gameplay/res/shaders/colored.frag
	gameplay/res/shaders/lighting.frag
	gameplay/res/shaders/textured.frag
	samples/browser/res/common/box.material
	samples/browser/res/common/duck.material
	samples/browser/res/common/sample.material
	samples/browser/src/PostProcessSample.cpp
	samples/character/src/CharacterGame.cpp
	samples/lua/res/box.material
	samples/lua/res/game.lua
	samples/mesh/res/duck.material
	samples/mesh/src/MeshGame.cpp
	samples/spaceship/src/SpaceshipGame.cpp
seanpaultaylor há 12 anos atrás
pai
commit
ece4aa0541

+ 6 - 6
samples/browser/src/Audio3DSample.cpp

@@ -37,8 +37,8 @@ void Audio3DSample::initialize()
     Model* boxModel = boxNode->getModel();
     Material* boxMaterial = boxModel->setMaterial("res/common/box.material");
 
-    //boxMaterial->getParameter("u_directionalLightColor[0]")->setValue(light->getColor());
-    //boxMaterial->getParameter("u_directionalLightDirection[0]")->setValue(lightNode->getForwardVectorView());
+    boxMaterial->getParameter("u_directionalLightColor[0]")->setValue(light->getColor());
+    boxMaterial->getParameter("u_directionalLightDirection[0]")->setValue(lightNode->getForwardVectorView());
 
     // Remove the cube from the scene but keep a reference to it.
     _cubeNode = boxNode;
@@ -316,13 +316,13 @@ void Audio3DSample::drawDebugText(int x, int y)
     static const int V_SPACE = 16;
     AudioListener* audioListener = AudioListener::getInstance();
     drawVector3("Position", audioListener->getPosition(), x, y);
-    drawVector3("Forward", audioListener->getOrientationForward(), x, y+=V_SPACE);
-    drawVector3("Orientation", audioListener->getOrientationUp(), x, y+=V_SPACE);
-    drawVector3("Velocity", audioListener->getVelocity(), x, y+=V_SPACE);
+    drawVector3("Forward", audioListener->getOrientationForward(), x, y+=_font->getSize());
+    drawVector3("Orientation", audioListener->getOrientationUp(), x, y+=_font->getSize());
+    drawVector3("Velocity", audioListener->getVelocity(), x, y+=_font->getSize());
     _font->finish();
 }
 
-void Audio3DSample::drawVector3(const char* str, const Vector3 vector, int x, int y)
+void Audio3DSample::drawVector3(const char* str, const Vector3& vector, int x, int y)
 {
     char buffer[255];
     sprintf(buffer, "%s: (%f, %f, %f)", str, vector.x, vector.y, vector.z);

+ 1 - 1
samples/browser/src/Audio3DSample.h

@@ -41,7 +41,7 @@ private:
 
     void drawDebugText(int x = 0, int y = 0);
 
-    void drawVector3(const char* str, const Vector3 vector, int x, int y);
+    void drawVector3(const char* str, const Vector3& vector, int x, int y);
 
     void loadGrid(Scene* scene);
 

+ 2 - 4
samples/browser/src/PhysicsCollisionObjectSample.cpp

@@ -134,11 +134,10 @@ bool PhysicsCollisionObjectSample::bindLights(Node* node)
                 ambientColorParam->setValue(_scene->getAmbientColor());
             }
 
-            /* TODO
             if (_lightNode && _lightNode->getLight())
             {
-                MaterialParameter* lightDirectionParam = material->getParameter("u_directionalLightDirection");
-                MaterialParameter* lightColorParam = material->getParameter("u_directionalLightColor");
+                MaterialParameter* lightDirectionParam = material->getParameter("u_directionalLightDirection[0]");
+                MaterialParameter* lightColorParam = material->getParameter("u_directionalLightColor[0]");
                 if (lightDirectionParam)
                 {
                     lightDirectionParam->bindValue(_lightNode, &Node::getForwardVectorView);
@@ -148,7 +147,6 @@ bool PhysicsCollisionObjectSample::bindLights(Node* node)
                     lightColorParam->setValue(_lightNode->getLight()->getColor());
                 }
             }
-            */
         }
     }
     return true;