Просмотр исходного кода

Rebased 2D Physics Basic on screenrewrite

Joachim Meyer 12 лет назад
Родитель
Сommit
f7d1f1ee8d
1 измененных файлов с 8 добавлено и 8 удалено
  1. 8 8
      Examples/C++/Contents/2DPhysics_Basic/HelloPolycodeApp.cpp

+ 8 - 8
Examples/C++/Contents/2DPhysics_Basic/HelloPolycodeApp.cpp

@@ -4,18 +4,18 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 
 	core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
 
-	PhysicsScreen *screen = new PhysicsScreen(10, 60);	
+	PhysicsScene2D *scene = new PhysicsScene2D(10, 60);
 	
-	ScreenShape *shape = new ScreenShape(ScreenShape::SHAPE_RECT, 600,30);
-	shape->setColor(0.0,0.0,0.0,1.0);
-	shape->setPosition(640/2, 400);
-	screen->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, true);	
+	ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 600,30);
+	shape->setColor(0.0,0.0,0.1,1.0);
+	shape->setPosition(640/2, 40);
+	scene->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, true);	
 	
 	for(int i=0; i < 200; i++) {
-		shape = new ScreenShape(ScreenShape::SHAPE_RECT, 20,5);
-		shape->setRotation(rand() % 360);
+		shape = new ScenePrimitive(ScenePrimitive::TYPE_PLANE, 20,5);
+		shape->setPitch(rand() % 360);
 		shape->setPosition(rand() % 640, rand() % 300);
-		screen->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);		
+		scene->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);		
 	}
 
 }