소스 검색

Only showing the strange spinning barrel after pressing Y.

David Piuva 5 년 전
부모
커밋
15de5c0077
1개의 변경된 파일13개의 추가작업 그리고 15개의 파일을 삭제
  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
 static SpriteWorld world;
 bool ambientLight = true;
+bool showTestModel = false;
 
 void sandbox_main() {
 	// Create the world
@@ -202,6 +203,8 @@ void sandbox_main() {
 				ambientLight = !ambientLight;
 			} else if (key == DsrKey_T) {
 				tileAlign = !tileAlign;
+			} else if (key == DsrKey_Y) {
+				showTestModel = !showTestModel;
 			} else if (key == DsrKey_F) {
 				showOverlays = !showOverlays;
 			} else if (key == DsrKey_K) {
@@ -383,21 +386,16 @@ void sandbox_main() {
 		spriteWorld_addTemporarySprite(world, brush);
 
 		// 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
 		spriteWorld_draw(world, colorBuffer);