Skip to content

Commit

Permalink
* relatively decent lighting now
Browse files Browse the repository at this point in the history
* added functionality to pilot
  • Loading branch information
fiezi committed Apr 5, 2012
1 parent f3e0b73 commit d64c47f
Show file tree
Hide file tree
Showing 23 changed files with 473 additions and 119 deletions.
Binary file modified Moviesandbox.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions classes/cameraActor.cpp
Expand Up @@ -79,6 +79,13 @@ void CameraActor::update(double deltaTime){
setLocation(location);
}

//TODO: hack to make Cameras disappear!
if (Control::bRunning)
drawType=DRAW_NULL;
else
drawType=DRAW_VBOMESH;


Actor::update(deltaTime);
}

Expand Down
11 changes: 7 additions & 4 deletions classes/control.cpp
Expand Up @@ -116,10 +116,13 @@ void Control::startMovie(){

bRunning=!bRunning;

if (bRunning)
start();
else
stop();
if (bRunning)
start();
else{
stop();
sceneData->controller->controlledActor=sceneData->controller;
}

}


Expand Down
5 changes: 5 additions & 0 deletions classes/drawTool.cpp
Expand Up @@ -93,6 +93,11 @@ void DrawTool::stop(){
//switch to vboMesh drawing mode
brush->drawing->drawType=DRAW_VBOMESH;

//make sure we are resetting the drawing to be pickable (after importing a .tga file for example)
brush->drawing->bPickable=true;
brush->drawing->bZTest=true;
brush->drawing->bZWrite=true;

//forget our drawing!
brush->drawing=NULL;

Expand Down
14 changes: 7 additions & 7 deletions classes/importBitmapButton.cpp
Expand Up @@ -163,7 +163,7 @@ void ImportBitmapButton::assembleImage(FIBITMAP* myBitmap, int imageWidth, int i
((DrawTool*)sceneData->controller->currentTool)->paint();

///fill holes
/*

float myDepth=(float)myColor->rgbReserved;
float fillStep=1.0;

Expand All @@ -188,11 +188,11 @@ void ImportBitmapButton::assembleImage(FIBITMAP* myBitmap, int imageWidth, int i

if (fillDepth + fillStep/32.0f <myDepth){
int i=1;
while if (!sceneData->brush->drawing){
sceneData->makeWarningPopUp("No drawing! \n please place a drawing first!", this);
return;
}
(fillDepth<myDepth){
if (!sceneData->brush->drawing){
sceneData->makeWarningPopUp("No drawing! \n please place a drawing first!", this);
return;
}
while (fillDepth<myDepth){
sceneData->brush->setLocation(sceneData->brush->location+ Vector3f(0,0,fillStep/32.0f));
input->mouse3D=sceneData->brush->location;
((DrawTool*)sceneData->controller->currentTool)->paint();
Expand All @@ -202,7 +202,7 @@ void ImportBitmapButton::assembleImage(FIBITMAP* myBitmap, int imageWidth, int i
}

///end fill holes
*/

//flip y and z when shift down
//if (input->bShiftDown){
//float interim=xyzNormal.y;
Expand Down
20 changes: 16 additions & 4 deletions classes/layer.cpp
Expand Up @@ -91,10 +91,9 @@ void Layer::updateShaders(){
if (myShader->uniforms.find("camZ") != myShader->uniforms.end()){
glUniform3fARB(myShader->uniforms["camZ"], sceneData->controller->zAxis.x,sceneData->controller->zAxis.y,sceneData->controller->zAxis.z);
}








//needs if statements because the compiler throws out stuff if not used!
if (myShader->uniforms.find("tex") != myShader->uniforms.end())
Expand Down Expand Up @@ -127,9 +126,22 @@ void Layer::updateShaders(){
if (myShader->uniforms.find("cameraMatrix") != myShader->uniforms.end())
glUniformMatrix4fv(myShader->uniforms["cameraMatrix"],1,false,(GLfloat*)renderer->cameraMatrix);



if (myShader->uniforms.find("cameraRotationMatrix") != myShader->uniforms.end())
glUniformMatrix4fv(myShader->uniforms["cameraRotationMatrix"],1,false,(GLfloat*)renderer->cameraRotationMatrix);

if (myShader->uniforms.find("inverseCameraRotationMatrix") != myShader->uniforms.end())
glUniformMatrix4fv(myShader->uniforms["inverseCameraRotationMatrix"],1,false,(GLfloat*)renderer->cameraRotationMatrix);




if (myShader->uniforms.find("cameraInverse") != myShader->uniforms.end())
glUniformMatrix4fvARB(myShader->uniforms["cameraInverse"], 1,false, (GLfloat*)&renderer->inverseCameraMatrix);




if (myShader->uniforms.find("projectionMatrix") != myShader->uniforms.end())
glUniformMatrix4fv(myShader->uniforms["projectionMatrix"],1,false,(GLfloat*)renderer->projectionMatrix);
Expand Down
4 changes: 2 additions & 2 deletions classes/navTool.cpp
Expand Up @@ -151,7 +151,7 @@ void NavTool::processMove(double deltaTime){
sceneData->controller->upPoint=controlledActor->yAxis;

//TODO: why is this necessary?
if (controlledActor==sceneData->controller)
sceneData->controller->upPoint=Vector3f(0,1,0);
//if (controlledActor==sceneData->controller)
// sceneData->controller->upPoint=Vector3f(0,1,0);

}

0 comments on commit d64c47f

Please sign in to comment.