Browse Source

Only showing the strange spinning barrel after pressing Y.

David Piuva 5 years ago
parent
commit
15de5c0077
1 changed files with 13 additions and 15 deletions
  1. 13 15
      Source/SDK/sandbox/sandbox.cpp

+ 13 - 15
Source/SDK/sandbox/sandbox.cpp

@@ -156,6 +156,7 @@ static const float cameraSpeed = 1.0f;
 // World
 // World
 static SpriteWorld world;
 static SpriteWorld world;
 bool ambientLight = true;
 bool ambientLight = true;
+bool showTestModel = false;
 
 
 void sandbox_main() {
 void sandbox_main() {
 	// Create the world
 	// Create the world
@@ -202,6 +203,8 @@ void sandbox_main() {
 				ambientLight = !ambientLight;
 				ambientLight = !ambientLight;
 			} else if (key == DsrKey_T) {
 			} else if (key == DsrKey_T) {
 				tileAlign = !tileAlign;
 				tileAlign = !tileAlign;
+			} else if (key == DsrKey_Y) {
+				showTestModel = !showTestModel;
 			} else if (key == DsrKey_F) {
 			} else if (key == DsrKey_F) {
 				showOverlays = !showOverlays;
 				showOverlays = !showOverlays;
 			} else if (key == DsrKey_K) {
 			} else if (key == DsrKey_K) {
@@ -383,21 +386,16 @@ void sandbox_main() {
 		spriteWorld_addTemporarySprite(world, brush);
 		spriteWorld_addTemporarySprite(world, brush);
 
 
 		// Test freely rotated models
 		// Test freely rotated models
-		/*Transform3D testLocation = Transform3D(
-		  FVector3D(0.0f, sin(timer) * 0.1f, 0.0f),
-		  FMatrix3x3(
-		    FVector3D(1.0f, 0.0f, 0.0f),
-		    FVector3D(0.0f, 1.0f, 0.0f),
-		    FVector3D(0.0f, 0.0f, 1.0f))
-		);*/
-		Transform3D testLocation = Transform3D(
-		  FVector3D(0.0f, sin(timer) * 0.1f, 0.0f),
-		  FMatrix3x3(
-		    FVector3D(cos(timer), 0.0f, sin(timer)),
-		    FVector3D(0.0f, 1.0f, 0.0f),
-		    FVector3D(-sin(timer), 0.0f, cos(timer)))
-		);
-		spriteWorld_addTemporaryModel(world, ModelInstance(barrelVisible, barrelShadow, testLocation));
+		if (showTestModel) {
+			Transform3D testLocation = Transform3D(
+			  FVector3D(0.0f, sin(timer) * 0.1f, 0.0f),
+			  FMatrix3x3(
+				FVector3D(cos(timer), 0.0f, sin(timer)),
+				FVector3D(0.0f, 1.0f, 0.0f),
+				FVector3D(-sin(timer), 0.0f, cos(timer)))
+			);
+			spriteWorld_addTemporaryModel(world, ModelInstance(barrelVisible, barrelShadow, testLocation));
+		}
 
 
 		// Draw the world
 		// Draw the world
 		spriteWorld_draw(world, colorBuffer);
 		spriteWorld_draw(world, colorBuffer);