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

Fixed Lua examples (some removed), fixed shadow rendering, fixed all C++ examples, fixed bug with AABB not recalculating somtimes

Ivan Safrin 12 лет назад
Родитель
Сommit
c2e34bec43
100 измененных файлов с 175 добавлено и 361 удалено
  1. BIN
      Assets/Default asset pack/default.pak
  2. 14 0
      Assets/Default asset pack/default/default.mat
  3. 2 0
      Core/Contents/Include/PolySceneLight.h
  4. 9 8
      Core/Contents/Include/PolySceneLine.h
  5. 0 2
      Core/Contents/Source/PolyEntity.cpp
  6. 1 3
      Core/Contents/Source/PolyGLSLShaderModule.cpp
  7. 1 3
      Core/Contents/Source/PolyScene.cpp
  8. 7 0
      Core/Contents/Source/PolySceneLight.cpp
  9. 2 2
      Examples/C++/Contents/2DPhysics_Contacts/HelloPolycodeApp.cpp
  10. 11 3
      Examples/C++/Contents/3DPhysics_Contacts/HelloPolycodeApp.cpp
  11. 4 0
      Examples/C++/Contents/3DPhysics_Contacts/HelloPolycodeApp.h
  12. 28 16
      Examples/C++/Contents/MaterialsAndLights/HelloPolycodeApp.cpp
  13. 5 0
      Examples/C++/Contents/MaterialsAndLights/HelloPolycodeApp.h
  14. 0 8
      Examples/Lua/2D_Graphics/2DParticles/2DParticles.polyproject
  15. BIN
      Examples/Lua/2D_Graphics/2DParticles/Resources/particle.png
  16. 0 37
      Examples/Lua/2D_Graphics/2DParticles/Scripts/2DParticles.lua
  17. 0 22
      Examples/Lua/2D_Graphics/2DTransforms/Scripts/2DTransforms.lua
  18. 0 5
      Examples/Lua/2D_Graphics/BasicImage/Scripts/BasicImage.lua
  19. 0 5
      Examples/Lua/2D_Graphics/BasicText/Scripts/BasicText.lua
  20. 0 34
      Examples/Lua/2D_Graphics/ScreenEntities/Scripts/ScreenEntities.lua
  21. 1 1
      Examples/Lua/2D_Physics/2DPhysics_Basic/2DPhysics_Basic.polyproject
  22. 11 11
      Examples/Lua/2D_Physics/2DPhysics_Basic/Scripts/2DPhysics_Basic.lua
  23. 1 1
      Examples/Lua/2D_Physics/2DPhysics_CollisionOnly/2DPhysics_CollisionOnly.polyproject
  24. 15 13
      Examples/Lua/2D_Physics/2DPhysics_CollisionOnly/Scripts/2DPhysics_CollisionOnly.lua
  25. 1 1
      Examples/Lua/2D_Physics/2DPhysics_Contacts/2DPhysics_Contacts.polyproject
  26. 16 16
      Examples/Lua/2D_Physics/2DPhysics_Contacts/Scripts/2DPhysics_Contacts.lua
  27. 1 1
      Examples/Lua/2D_Physics/2DPhysics_Joints/2DPhysics_Joints.polyproject
  28. 32 30
      Examples/Lua/2D_Physics/2DPhysics_Joints/Scripts/2DPhysics_Joints.lua
  29. 9 6
      Examples/Lua/2D_Physics/2DPhysics_PointCollision/Scripts/2DPhysics_PointCollision.lua
  30. 0 8
      Examples/Lua/3D_Graphics/BasicLighting/BasicLighting.polyproject
  31. 0 39
      Examples/Lua/3D_Graphics/BasicLighting/Resources/example.mat
  32. BIN
      Examples/Lua/3D_Graphics/BasicLighting/Resources/green_texture.png
  33. BIN
      Examples/Lua/3D_Graphics/BasicLighting/Resources/pink_texture.png
  34. 0 27
      Examples/Lua/3D_Graphics/BasicLighting/Scripts/BasicLighting.lua
  35. 0 8
      Examples/Lua/Audio/2DAudio/2DAudio.polyproject
  36. 0 31
      Examples/Lua/Audio/2DAudio/Scripts/2DAudio.lua
  37. BIN
      Examples/Lua/Audio/3DAudio/Resources/test.wav
  38. 0 0
      Examples/Lua/Audio/PositionalAudio/PositionalAudio.polyproject
  39. 0 0
      Examples/Lua/Audio/PositionalAudio/Resources/test.wav
  40. 4 9
      Examples/Lua/Audio/PositionalAudio/Scripts/3DAudio.lua
  41. 0 11
      Examples/Lua/Game_Demos/Platformer/Platformer.polyproject
  42. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/entities/button.entity2d
  43. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/entities/coin.entity2d
  44. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/entities/fly.entity2d
  45. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/entities/spaceman.entity2d
  46. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/fonts/LondrinaSolid-Regular.otf
  47. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/fonts/Sniglet Regular.otf
  48. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/alien_plant.png
  49. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/background.png
  50. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/block.png
  51. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/bonus.png
  52. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/bonus_used.png
  53. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/bridge.png
  54. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/bush.png
  55. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/cloud_1.png
  56. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/cloud_2.png
  57. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/cloud_3.png
  58. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/coin_bronze.png
  59. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/coin_gold.png
  60. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/coin_silver.png
  61. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/crate.png
  62. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/enemies/fly.png
  63. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/enemies/slime_normal.png
  64. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/enemies/slime_walk.png
  65. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/fence.png
  66. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/fence_broken.png
  67. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/grass.png
  68. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/ground.png
  69. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/ground_cave.png
  70. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/ground_dirt.png
  71. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/ground_rock.png
  72. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/ground_sand.png
  73. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/hill_long.png
  74. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/hill_short.png
  75. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/key_blue.png
  76. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/key_green.png
  77. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/key_red.png
  78. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/key_yellow.png
  79. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/lava.png
  80. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/lock_blue.png
  81. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/lock_green.png
  82. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/lock_red.png
  83. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/lock_yellow.png
  84. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/plank.png
  85. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/rock.png
  86. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/shroom.png
  87. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/spaceman.png
  88. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/spikes.png
  89. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_blue_off.png
  90. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_blue_on.png
  91. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_green_off.png
  92. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_green_on.png
  93. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_red_off.png
  94. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_red_on.png
  95. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_yellow_off.png
  96. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/switch_yellow_on.png
  97. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/images/water.png
  98. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/levels/level1.entity2d
  99. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/sounds/button.wav
  100. BIN
      Examples/Lua/Game_Demos/Platformer/Resources/sounds/coin.wav

BIN
Assets/Default asset pack/default.pak


+ 14 - 0
Assets/Default asset pack/default/default.mat

@@ -79,6 +79,14 @@
 			<shader name="UnlitUntextured">
 			</shader>
 		</material>
+		<material name="UnlitUntextured">
+			<shader name="UnlitUntextured">
+			</shader>
+		</material>	
+		<material name="UnlitUntexturedAdditive" blendingMode="2">
+			<shader name="UnlitUntextured">
+			</shader>
+		</material>		
 		<material name="Unlit">
 			<shader name="Unlit">
 				<textures>
@@ -91,6 +99,12 @@
 				</textures>				
 			</shader>
 		</material>		
+		<material name="UnlitAdditive" blendingMode="2">
+			<shader name="Unlit">
+				<textures>
+				</textures>				
+			</shader>
+		</material>		
 		<material name="DefaultWithShadows">
 			<shader name="DefaultShaderShadows">
 				<textures>

+ 2 - 0
Core/Contents/Include/PolySceneLight.h

@@ -191,6 +191,8 @@ namespace Polycode {
             Scene *getParentScene() const;
             void setParentScene(Scene *scene);
         
+            Camera *getSpotlightCamera();
+        
 		protected:
 		
 			Number spotlightExponent;

+ 9 - 8
Core/Contents/Include/PolySceneLine.h

@@ -35,20 +35,21 @@ namespace Polycode {
 	class _PolyExport SceneLine : public SceneMesh {
 		public:
 		
+		
+            /**
+             * Constructs the line with two taraget entities.
+             * @param ent1 Starting entity.
+             * @param ent2 Ending entity.
+             */
+            SceneLine(Entity *ent1, Entity *ent2);
+        
+        
 			/**
 			* Constructs the line with two taraget positions.
 			* @param start Starting position.
 			* @param end Ending position.
 			*/			
 			SceneLine(Vector3 start, Vector3 end);
-		
-			/**
-			* Constructs the line with two taraget entities.
-			* @param ent1 Starting entity.
-			* @param ent2 Ending entity.
-			*/
-			SceneLine(Entity *ent1, Entity *ent2);
-			
 
 			/**
 			* Constructs the line with two taraget positions.

+ 0 - 2
Core/Contents/Source/PolyEntity.cpp

@@ -683,7 +683,6 @@ Matrix4 Entity::getConcatenatedMatrixRelativeTo(Entity *relativeEntity) {
 	
 	if(matrixDirty) {
 		rebuildTransformMatrix();
-        recalculateAABBAllChildren();
     }
 
 	if(parentEntity != NULL && parentEntity != relativeEntity)
@@ -702,7 +701,6 @@ Matrix4 Entity::getAnchorAdjustedMatrix() {
 Matrix4 Entity::getConcatenatedMatrix() {
 	if(matrixDirty) {
 		rebuildTransformMatrix();
-        recalculateAABBAllChildren();
     }
     
 	if(parentEntity != NULL) 

+ 1 - 3
Core/Contents/Source/PolyGLSLShaderModule.cpp

@@ -406,15 +406,13 @@ bool GLSLShaderModule::applyShaderMaterial(Renderer *renderer, Material *materia
 		
 	glEnable(GL_TEXTURE_2D);
 
-/*
-	Matrix4 modelMatrix = renderer->getCurrentModelMatrix();
+	Matrix4 modelMatrix = renderer->getModelviewMatrix() * renderer->getCameraMatrix();
 	int mloc = glGetUniformLocation(glslShader->shader_id, "modelMatrix");				
 	GLfloat mat[16];
 	for(int z=0; z < 16; z++) {
 		mat[z] = modelMatrix.ml[z];
 	}
 	glUniformMatrix4fv(mloc, 1, false, mat);
-*/
 		
 	ShaderBinding *cgBinding = material->getShaderBinding(shaderIndex);
 	

+ 1 - 3
Core/Contents/Source/PolyScene.cpp

@@ -132,6 +132,7 @@ bool Scene::isEnabled() {
 }
 
 void Scene::Update() {
+    rootEntity.updateEntityMatrix();
 	rootEntity.doUpdates();
 }
 
@@ -209,8 +210,6 @@ void Scene::Render(Camera *targetCamera) {
 	if(!targetCamera && !activeCamera)
 		return;
     
-    rootEntity.updateEntityMatrix();
-    
     renderer->setOverrideMaterial(overrideMaterial);
 	
 	if(!targetCamera)
@@ -293,7 +292,6 @@ void Scene::Render(Camera *targetCamera) {
 
 void Scene::RenderDepthOnly(Camera *targetCamera) {
 	
-    rootEntity.updateEntityMatrix();
 	CoreServices::getInstance()->getRenderer()->cullFrontFaces(true);
 
 	targetCamera->rebuildTransformMatrix();	

+ 7 - 0
Core/Contents/Source/PolySceneLight.cpp

@@ -129,6 +129,9 @@ void SceneLight::renderDepthMap(Scene *scene) {
 	renderer->pushMatrix();
 	renderer->loadIdentity();
 
+    Number vpW = renderer->getViewportWidth();
+    Number vpH = renderer->getViewportHeight();
+    
 	renderer->setViewportSize(shadowMapRes, shadowMapRes);
 	Camera* camera = scene->getActiveCamera();
 	renderer->setProjectionFromFoV(shadowMapFOV, camera->getNearClippingPlane(), camera->getFarClippingPlane());
@@ -139,6 +142,7 @@ void SceneLight::renderDepthMap(Scene *scene) {
 	lightViewMatrix = renderer->getModelviewMatrix() *  renderer->getProjectionMatrix();
 	renderer->unbindFramebuffers();
 	renderer->popMatrix();
+	renderer->setViewportSize(vpW , vpH);
 }
 
 Entity *SceneLight::Clone(bool deepClone, bool ignoreEditorOnly) const {
@@ -172,6 +176,9 @@ void SceneLight::setParentScene(Scene *scene) {
     }
 }
 
+Camera *SceneLight::getSpotlightCamera() {
+    return spotCamera;
+}
 
 const Matrix4& SceneLight::getLightViewMatrix() const {
 	return lightViewMatrix;

+ 2 - 2
Examples/C++/Contents/2DPhysics_Contacts/HelloPolycodeApp.cpp

@@ -7,7 +7,7 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);	
 
-	PhysicsScene2D *scene = new PhysicsScene2D(0.1, 60);
+	scene = new PhysicsScene2D(0.1, 60);
 	ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1.0,0.05);
 	shape->setColor(0.0,0.0,0.1,1.0);
 	shape->setPosition(0, -0.3);
@@ -30,7 +30,7 @@ void HelloPolycodeApp::handleEvent(Event *e) {
 		switch(e->getEventCode()) {
 			case PhysicsScene2DEvent::EVENT_SOLVE_SHAPE_COLLISION:
 				PhysicsScene2DEvent *pe = (PhysicsScene2DEvent*)e;
-				if(pe->impactStrength > 5)
+				if(pe->impactStrength > 1.0)
 					collisionSound->Play();
 			break;
 		}

+ 11 - 3
Examples/C++/Contents/3DPhysics_Contacts/HelloPolycodeApp.cpp

@@ -7,7 +7,7 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
-	PhysicsScene *scene = new PhysicsScene();
+	scene = new PhysicsScene();
 
 	ScenePrimitive *ground = new ScenePrimitive(ScenePrimitive::TYPE_PLANE, 10, 10);
 	ground->loadTexture("Resources/green_texture.png");
@@ -24,14 +24,22 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	
 	scene->getDefaultCamera()->setPosition(7,7,7);
 	scene->getDefaultCamera()->lookAt(Vector3(0,0,0));
-	
+    
+    scene->addEventListener(this, PhysicsSceneEvent::COLLISION_EVENT);
+	collisionSound = new Sound("Resources/hit.wav");
 }
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 }
 
 void HelloPolycodeApp::handleEvent(Event *event) {
-
+    if(event->getDispatcher() == scene) {
+        PhysicsSceneEvent *physicsEvent = (PhysicsSceneEvent*) event;
+        if(physicsEvent->appliedImpulse > 2.0) {
+            collisionSound->Play();
+        }
+        
+    }
 }
 
 bool HelloPolycodeApp::Update() {

+ 4 - 0
Examples/C++/Contents/3DPhysics_Contacts/HelloPolycodeApp.h

@@ -11,6 +11,10 @@ public:
     bool Update();
     
 	void handleEvent(Event *event);
+    
 private:
+    
 	Core *core;
+    PhysicsScene *scene;
+    Sound *collisionSound;
 };

+ 28 - 16
Examples/C++/Contents/MaterialsAndLights/HelloPolycodeApp.cpp

@@ -2,22 +2,22 @@
 
 HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 
-	core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
+	core = new POLYCODE_CORE(view, 640,480,false,true,6,16,90, 0, true);
 
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("Resources", false);
 	
-	Scene *scene = new Scene();
+	scene = new Scene();
 	ScenePrimitive *ground = new ScenePrimitive(ScenePrimitive::TYPE_PLANE, 5,5);
 	ground->setMaterialByName("GroundMaterial");
 	scene->addEntity(ground);
 
-	ScenePrimitive *box = new ScenePrimitive(ScenePrimitive::TYPE_TORUS, 0.8,0.3,30,20);
-	box->setMaterialByName("CubeMaterial");
-	box->setPosition(0.0, 0.5, 0.0);
-	scene->addEntity(box);
-	
+	torus = new ScenePrimitive(ScenePrimitive::TYPE_TORUS, 0.8,0.3,30,20);
+	torus->setMaterialByName("CubeMaterial");
+	torus->setPosition(0.0, 0.5, 0.0);
+	scene->addEntity(torus);
+
 	SceneLight *light = new SceneLight(SceneLight::POINT_LIGHT, scene, 5);
 	light->setPosition(3,2,3);
 	light->setLightColor(1,0,0);
@@ -37,31 +37,43 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	light->setPosition(3,2,-3);
 	light->setLightColor(1,0,1);
 	scene->addLight(light);
-
+    
+    lights = new Entity();
+    scene->addChild(lights);
+    
 	light = new SceneLight(SceneLight::SPOT_LIGHT, scene, 4);
-	light->setPosition(0,2,2);
-	light->setSpotlightProperties(30,6);
+	light->setPosition(0,4,1);
 	light->setLightColor(1,1,0);
 	scene->addLight(light);
+	lights->addChild(light);
 	light->lookAt(Vector3(0,0,0));
 	light->enableShadows(true);
-	
+    light->getSpotlightCamera()->frustumCulling = false;
+
 	light = new SceneLight(SceneLight::SPOT_LIGHT, scene, 4);
-	light->setPosition(0,2,-2);
-	light->setSpotlightProperties(30,6);
+	light->setPosition(0,4,-1);
 	light->setLightColor(0,1,1);
 	scene->addLight(light);
+	lights->addChild(light);
 	light->lookAt(Vector3(0,0,0));
 	light->enableShadows(true);
+    light->getSpotlightCamera()->frustumCulling = false;
+    
 
-	scene->getDefaultCamera()->setPosition(7,7,7);
-	scene->getDefaultCamera()->lookAt(Vector3(0,0,0));
-
+    cameraRotation = 0.0;
 }
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 }
 
 bool HelloPolycodeApp::Update() {
+    lights->Yaw(core->getElapsed() * 10.0);
+    torus->Roll(core->getElapsed() * 10.0);
+    
+    cameraRotation += core->getElapsed() * 0.1;
+    
+    scene->getDefaultCamera()->setPosition(sin(cameraRotation) * 7.0, 7.0,cos(cameraRotation) * 7.0);
+	scene->getDefaultCamera()->lookAt(Vector3(0,0,0));
+    
     return core->updateAndRender();
 }

+ 5 - 0
Examples/C++/Contents/MaterialsAndLights/HelloPolycodeApp.h

@@ -10,5 +10,10 @@ public:
     bool Update();
     
 private:
+    
+    Entity *lights;
+    ScenePrimitive *torus;
 	Core *core;
+    Scene *scene;
+    Number cameraRotation;
 };

+ 0 - 8
Examples/Lua/2D_Graphics/2DParticles/2DParticles.polyproject

@@ -1,8 +0,0 @@
-<?xml version="1.0" ?>
-<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DParticles.lua" vSync="false" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
-    <backgroundColor red="0.25" green="0.25" blue="0.25" />
-    <polyarray:packedItems>
-        <item type="folder" path="Resources" />
-        <item type="folder" path="Scripts" />
-    </polyarray:packedItems>
-</PolycodeProject>

BIN
Examples/Lua/2D_Graphics/2DParticles/Resources/particle.png


+ 0 - 37
Examples/Lua/2D_Graphics/2DParticles/Scripts/2DParticles.lua

@@ -1,37 +0,0 @@
--- 2D Particle emitter example
-
-screen = Screen()
-
-emitter = ScreenParticleEmitter("Resources/particle.png", Particle.BILLBOARD_PARTICLE,
-	ParticleEmitter.CONTINUOUS_EMITTER, 4, 200, Vector3(0.0,-50.0,0.0), Vector3(0.0,0.0,0.0),
-	Vector3(20.5, 40.0, 0.0), Vector3(0.0,0.0,0.0))
-
-emitter:getEmitter().useScaleCurves = true
-emitter:getEmitter().scaleCurve:addControlPoint2d(0, 0.3)
-emitter:getEmitter().scaleCurve:addControlPoint2d(0.5, 1)
-emitter:getEmitter().scaleCurve:addControlPoint2d(1, 0)
-
-emitter:getEmitter().useColorCurves = true
-emitter:getEmitter().colorCurveR:addControlPoint2d(0, 0.3)
-emitter:getEmitter().colorCurveR:addControlPoint2d(0.1, 1)
-emitter:getEmitter().colorCurveR:addControlPoint2d(0.4, 1)
-emitter:getEmitter().colorCurveR:addControlPoint2d(0.5, 0)
-emitter:getEmitter().colorCurveR:addControlPoint2d(1, 0)
-
-emitter:getEmitter().colorCurveG:addControlPoint2d(0, 0.3)
-emitter:getEmitter().colorCurveG:addControlPoint2d(0.1, 0.6)
-emitter:getEmitter().colorCurveG:addControlPoint2d(0.4, 0.6)
-emitter:getEmitter().colorCurveG:addControlPoint2d(0.5, 0)
-emitter:getEmitter().colorCurveG:addControlPoint2d(1, 0.0)
-
-emitter:getEmitter().colorCurveB:addControlPoint2d(0, 1)
-emitter:getEmitter().colorCurveB:addControlPoint2d(0.1, 0)
-emitter:getEmitter().colorCurveB:addControlPoint2d(1, 0)
-
-emitter:getEmitter().colorCurveA:addControlPoint2d(0, 0)
-emitter:getEmitter().colorCurveA:addControlPoint2d(0.05, 1)
-emitter:getEmitter().colorCurveA:addControlPoint2d(0.6, 1)
-emitter:getEmitter().colorCurveA:addControlPoint2d(1, 0)
-
-emitter:setPosition(640/2, 400)
-screen:addChild(emitter)

+ 0 - 22
Examples/Lua/2D_Graphics/2DTransforms/Scripts/2DTransforms.lua

@@ -1,22 +0,0 @@
-
--- Simple example showing how to move, scale and rotate 2d entities
-
-screen = Screen()
-for i=0,9 do
-        image = ScreenImage("Resources/polycode_logo.png")
-        screen:addChild(image)
-
-		-- Set position and position mode. Setting position mode to ScreenEntity.POSITION_CENTER, makes
-		-- the entity's anchor point its middle, rather than its top left.
-		-- Try commenting out that line and see how it affects the transfomrations
-        image.position.x = 160+(42*i)
-		image.position.y = 230
-        image:setPositionMode(ScreenEntity.POSITION_CENTER)
-
-		-- Rotate the image. You can alternatively call image:setPosition(45 * i)
-        image.rotation.roll = 45 * i
-
-		-- Set the image scale. You can alternatively call image:setScale(1.0-(0.1*i), 1.0-(0.1*i))
-        image.scale.x = 1.0-(0.1*i)
-		image.scale.y = 1.0-(0.1*i)
-end

+ 0 - 5
Examples/Lua/2D_Graphics/BasicImage/Scripts/BasicImage.lua

@@ -1,5 +0,0 @@
--- Simple example of displaying an image
-
-screen = Screen()
-image = ScreenImage("Resources/polycode_logo.png")
-screen:addChild(image)

+ 0 - 5
Examples/Lua/2D_Graphics/BasicText/Scripts/BasicText.lua

@@ -1,5 +0,0 @@
--- Simple text label example.
-
-screen = Screen()
-label = ScreenLabel("Hello, Polycode!", 32)
-screen:addChild(label)

+ 0 - 34
Examples/Lua/2D_Graphics/ScreenEntities/Scripts/ScreenEntities.lua

@@ -1,34 +0,0 @@
---
---	This example demonstrates entity hierarchy by simulating a simple solar system.
---	Since entity transformations are always relative to the entity's parent
---	so the moon's rotation takes places around the planet, which is its parent.
---
-
-screen = Screen()
-
-sun = ScreenShape(ScreenShape.SHAPE_CIRCLE, 100,100, 30)
-sun:setPosition(640/2, 480/2)
-sun:setColor(0.7, 0.5, 0.3, 1)
-sun.colorAffectsChildren = false
-screen:addChild(sun)
-
-planet = ScreenShape(ScreenShape.SHAPE_CIRCLE, 50,50, 30)
-planet:setPosition(150,0)
-planet:setColor(0.2, 0.8, 0, 1)
-planet.colorAffectsChildren = false
-sun:addChild(planet)
-
-moon = ScreenShape(ScreenShape.SHAPE_CIRCLE, 20,20, 30)
-moon:setPosition(50,0)
-moon:setColor(1, 1, 0.6, 1)
-planet:addChild(moon)
-
-planetRotation = 0
-moonRotation = 0
-
-function Update(elapsed)
-        planetRotation = planetRotation + elapsed
-        moonRotation = moonRotation + (elapsed * 6)
-        planet:setPosition(cos(planetRotation)*150, sin(planetRotation)*150)
-        moon:setPosition(cos(moonRotation)*50, sin(moonRotation)*50)
-end

+ 1 - 1
Examples/Lua/2D_Physics/2DPhysics_Basic/2DPhysics_Basic.polyproject

@@ -1,5 +1,5 @@
 <?xml version="1.0" ?>
-<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_Basic.lua" vSync="false" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
+<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_Basic.lua" vSync="true" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
     <backgroundColor red="0.25" green="0.25" blue="0.25" />
     <polyarray:modules />
     <packedItems>

+ 11 - 11
Examples/Lua/2D_Physics/2DPhysics_Basic/Scripts/2DPhysics_Basic.lua

@@ -1,20 +1,20 @@
 
 -- Simple 2D Physics example
 
-screen = PhysicsScreen(10, 60)
+scene = PhysicsScene2D(0.1, 60)
 
 -- add a static floor shape
-shape = ScreenShape(ScreenShape.SHAPE_RECT, 600,30)
-shape:setColor(0.0,0.0,0.0,1.0)
-shape.position.x = 640/2
-shape.position.y = 400
-screen:addPhysicsChild(shape, PhysicsScreenEntity.ENTITY_RECT, true)
+shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 1.0,0.05)
+shape:setColor(0.0,0.0,0.1,1.0)
+shape:setPosition(0, -0.3)
+scene:addPhysicsChild(shape, PhysicsScene2DEntity.ENTITY_RECT, true)
+
 
 -- add 200 falling blocks
 for i=0,200 do
-        shape = ScreenShape(ScreenShape.SHAPE_RECT, 20,5)
-        shape:setRotation(random(360))
-        shape.position.x = random(640)
-		shape.position.y = random(300)
-        screen:addPhysicsChild(shape, PhysicsScreenEntity.ENTITY_RECT, false);
+		shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.08,0.02)
+		shape:setRoll(random(360))
+        shape:setColor(random(), random(), random(), 1.0)
+		shape:setPosition(-0.3 + (random()*0.6), random())
+		scene:addPhysicsChild(shape, PhysicsScene2DEntity.ENTITY_RECT, false)
 end

+ 1 - 1
Examples/Lua/2D_Physics/2DPhysics_CollisionOnly/2DPhysics_CollisionOnly.polyproject

@@ -1,5 +1,5 @@
 <?xml version="1.0" ?>
-<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_CollisionOnly.lua" vSync="false" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
+<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_CollisionOnly.lua" vSync="true" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
     <backgroundColor red="0.25" green="0.25" blue="0.25" />
     <polyarray:modules />
     <packedItems>

+ 15 - 13
Examples/Lua/2D_Physics/2DPhysics_CollisionOnly/Scripts/2DPhysics_CollisionOnly.lua

@@ -1,18 +1,18 @@
 
-screen = PhysicsScreen(10, 60)
+scene = PhysicsScene2D(0.1, 60)
 
-checkShape = ScreenShape(ScreenShape.SHAPE_RECT, 90,10)
-screen:addCollisionChild(checkShape, PhysicsScreenEntity.ENTITY_RECT)
+checkShape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.2,0.03)
+scene:addCollisionChild(checkShape, PhysicsScene2DEntity.ENTITY_RECT)
 
 for i=0,50 do
-        shape = ScreenShape(ScreenShape.SHAPE_RECT, 30,15)
-        shape:setRotation(random(360))
-        shape:setPosition(random(640), random(480))
-        screen:addCollisionChild(shape, PhysicsScreenEntity.ENTITY_RECT)
+	shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.1,0.02)
+	shape:setRoll(random(360))
+	shape:setPosition(-0.5 + random(), -0.5 + random())
+	scene:addCollisionChild(shape, PhysicsScene2DEntity.ENTITY_RECT)
 end
 
 function onNewCollision(t, event)
-	physicsEvent = safe_cast(event, PhysicsScreenEvent)
+	physicsEvent = safe_cast(event, PhysicsScene2DEvent)
 	if physicsEvent.entity1 == checkShape then
 		physicsEvent:getFirstEntity():setColor(1.0, 0.0, 0.0, 1.0)
 		physicsEvent:getSecondEntity():setColor(1.0, 0.0, 0.0, 1.0)
@@ -20,18 +20,20 @@ function onNewCollision(t, event)
 end
 
 function onEndCollision(t, event)
-	physicsEvent = safe_cast(event, PhysicsScreenEvent)
+	physicsEvent = safe_cast(event, PhysicsScene2DEvent)
 	physicsEvent:getFirstEntity():setColor(1.0, 1.0, 1.0, 1.0)
 	physicsEvent:getSecondEntity():setColor(1.0, 1.0, 1.0, 1.0)
 end
 
-screen:addEventListener(nil, onNewCollision, PhysicsScreenEvent.EVENT_NEW_SHAPE_COLLISION)
-screen:addEventListener(nil, onEndCollision, PhysicsScreenEvent.EVENT_END_SHAPE_COLLISION)
+scene:addEventListener(nil, onNewCollision, PhysicsScene2DEvent.EVENT_NEW_SHAPE_COLLISION)
+scene:addEventListener(nil, onEndCollision, PhysicsScene2DEvent.EVENT_END_SHAPE_COLLISION)
 
 function onMouseMove(x,y)
-	checkShape:setPosition(x,y)
+	local ray = scene:projectRayFromCameraAndViewportCoordinate(scene:getActiveCamera(), Vector2(x,y))
+    checkShape:setPosition(ray.origin.x, ray.origin.y)
+
 end
 
 function Update(e)
-	checkShape:setRotation(checkShape:getRotation() + (e*100))
+	checkShape:setRoll(checkShape:getRoll() + (e*100))
 end

+ 1 - 1
Examples/Lua/2D_Physics/2DPhysics_Contacts/2DPhysics_Contacts.polyproject

@@ -1,5 +1,5 @@
 <?xml version="1.0" ?>
-<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_Contacts.lua" vSync="false" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
+<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_Contacts.lua" vSync="true" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
     <backgroundColor red="0.25" green="0.25" blue="0.25" />
     <polyarray:modules />
     <polyarray:packedItems>

+ 16 - 16
Examples/Lua/2D_Physics/2DPhysics_Contacts/Scripts/2DPhysics_Contacts.lua

@@ -1,26 +1,26 @@
 
--- makes a sound when a collision impact stronger than 5 happens
+collisionSound = Sound("Resources/collision.wav")
 
-screen = PhysicsScreen(10, 60)
-shape = 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)
+scene = PhysicsScene2D(0.1, 60)
 
-for i=0,50 do
-        shape = ScreenShape(ScreenShape.SHAPE_RECT, 20,5)
-        shape:setRotation(random(360))
-        shape:setPosition(random(640), random(300))
-        screen:addPhysicsChild(shape, PhysicsScreenEntity.ENTITY_RECT, false)
-end
+shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 1.0,0.05)
+shape:setColor(0.0,0.0,0.1,1.0)
+shape:setPosition(0, -0.3)
+scene:addPhysicsChild(shape, PhysicsScene2DEntity.ENTITY_RECT, true)
 
-collisionSound = Sound("Resources/collision.wav")
+for i=0,200 do
+		shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.08,0.02)
+		shape:setRoll(random(360))
+        shape:setColor(random(), random(), random(), 1.0)
+		shape:setPosition(-0.3 + (random()*0.6), random())
+		scene:addPhysicsChild(shape, PhysicsScene2DEntity.ENTITY_RECT, false)
+end
 
 function onSolveCollision(t, event)
-	physicsEvent = safe_cast(event, PhysicsScreenEvent)
-	if physicsEvent.impactStrength > 5 then
+	physicsEvent = safe_cast(event, PhysicsScene2DEvent)
+	if physicsEvent.impactStrength > 1.0 then
 			collisionSound:Play()
 		end
 end
 
-screen:addEventListener(test, onSolveCollision, PhysicsScreenEvent.EVENT_SOLVE_SHAPE_COLLISION)
+scene:addEventListener(test, onSolveCollision, PhysicsScene2DEvent.EVENT_SOLVE_SHAPE_COLLISION)

+ 1 - 1
Examples/Lua/2D_Physics/2DPhysics_Joints/2DPhysics_Joints.polyproject

@@ -1,5 +1,5 @@
 <?xml version="1.0" ?>
-<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_Joints.lua" vSync="false" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
+<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DPhysics_Joints.lua" vSync="true" anisotropyLevel="0" frameRate="60" textureFiltering="linear">
     <backgroundColor red="0.25" green="0.25" blue="0.25" />
     <polyarray:modules />
     <packedItems>

+ 32 - 30
Examples/Lua/2D_Physics/2DPhysics_Joints/Scripts/2DPhysics_Joints.lua

@@ -1,36 +1,38 @@
-screen = PhysicsScreen(10, 50)
 
-ceiling = ScreenShape(ScreenShape.SHAPE_RECT, 640, 20)
-ceiling:setColor(0.0, 0.0, 0.0, 1.0)
-ceiling:setPosition(640/2, 10)
-screen:addPhysicsChild(ceiling, PhysicsScreenEntity.ENTITY_RECT, true)
-
--- Revolute Joint
-shape = ScreenShape(ScreenShape.SHAPE_RECT, 10, 30)
-shape:setPosition(150, 20+15)
-screen:addPhysicsChild(shape, PhysicsScreenEntity.ENTITY_RECT, false)
-screen:createRevoluteJoint(shape, ceiling, 0, -15)
-screen:applyImpulse(shape, 10, 0)
+scene = PhysicsScene2D(0.1, 50)
 
--- Distance Joint
-shape = ScreenShape(ScreenShape.SHAPE_RECT, 10, 30)
-shape:setPosition(250, 20+25)
-screen:addPhysicsChild(shape, PhysicsScreenEntity.ENTITY_RECT, false)
-screen:createDistanceJoint(shape, ceiling, false)
-screen:applyImpulse(shape, 200, 0)
-
-line = ScreenLine.ScreenLineBetweenEntities(shape, ceiling)
+ceiling = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 2.0, 0.1)
+ceiling:setColor(0.0, 0.0, 0.0, 1.0)
+ceiling:setPosition(0, 0.5)
+scene:addPhysicsChild(ceiling, PhysicsScene2DEntity.ENTITY_RECT, true)
+	
+--Revolute Joint	
+shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.03, 0.2)
+shape:setAnchorPoint(Vector3(0.0, 1.0, 0.0))
+shape:setPosition(-0.3, 0.48)
+scene:addPhysicsChild(shape, PhysicsScene2DEntity.ENTITY_RECT, false)
+scene:createRevoluteJoint(shape, ceiling, 0.0, 0.01)
+scene:applyImpulse(shape, 10, 0)
+	
+--Distance Joint	
+shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.1, 0.02)
+shape:setPosition(0.0, 0.2)
+scene:addPhysicsChild(shape, PhysicsScene2DEntity.ENTITY_RECT, false)
+scene:createDistanceJoint(shape, ceiling, false)
+scene:applyImpulse(shape, 2, 0)
+	
+line = SceneLine(shape, ceiling)
 line:setColor(1.0, 0.0, 0.0, 1.0)
-screen:addChild(line)
+scene:addChild(line)
 
--- Prismatic Joint
-shape = ScreenShape(ScreenShape.SHAPE_RECT, 10, 30)
-shape:setPosition(450, 20+25)
-screen:addPhysicsChild(shape, PhysicsScreenEntity.ENTITY_RECT, false)
-screen:createPrismaticJoint(ceiling, shape, Vector2(0,1), 0,0, false, 100, 0, true)
+--Prismatic Joint	
+shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.05, 0.1)
+shape:setPosition(0.3, 0.3)
+scene:addPhysicsChild(shape, PhysicsScene2DEntity.ENTITY_RECT, false)
+scene:createPrismaticJoint(ceiling, shape, Vector2(0,1), 0,0, false, -0.3, 0, true)
 
-lineAnchor = ScreenEntity()
-lineAnchor:setPosition(450,10)
-line = ScreenLine.ScreenLineBetweenEntities(shape, lineAnchor)
+lineAnchor = Entity()
+lineAnchor:setPosition(0.3,0.5)
+line = SceneLine(shape, lineAnchor)
 line:setColor(0.0, 1.0, 0.0, 1.0)
-screen:addChild(line)
+scene:addChild(line)

+ 9 - 6
Examples/Lua/2D_Physics/2DPhysics_PointCollision/Scripts/2DPhysics_PointCollision.lua

@@ -1,16 +1,19 @@
-screen = PhysicsScreen(0.5, 60)
+scene = PhysicsScene2D(0.01, 50)
 lastEntity = nil
 
 for i=0,50 do
-	shape = ScreenShape(ScreenShape.SHAPE_RECT, 30,15)
-	shape:setRotation(random(360))
-	shape:setPosition(random(640), random(480))
-	screen:addCollisionChild(shape, PhysicsScreenEntity.ENTITY_RECT)
+	shape = ScenePrimitive(ScenePrimitive.TYPE_VPLANE, 0.1,0.02)
+	shape:setRoll(random(360))
+	shape:setPosition(-0.5 + random(), -0.5 + random())
+	scene:addCollisionChild(shape, PhysicsScene2DEntity.ENTITY_RECT)
 end
 
 function onMouseMove(x,y)
 	if lastEntity ~= nil then lastEntity:setColor(1.0,1.0,1.0,1.0) end
-	local entity = screen:getEntityAtPosition(x,y)
+
+	ray = scene:projectRayFromCameraAndViewportCoordinate(scene:getActiveCamera(), Vector2(x,y))
+
+	local entity = scene:getEntityAtPosition(ray.origin.x, ray.origin.y)
 	if entity ~= nil then
 		entity:setColor(1.0, 0.0, 0.0, 1.0)
 		lastEntity = entity

+ 0 - 8
Examples/Lua/3D_Graphics/BasicLighting/BasicLighting.polyproject

@@ -1,8 +0,0 @@
-<?xml version="1.0" ?>
-<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/BasicLighting.lua" vSync="false" anisotropyLevel="0" frameRate="60">
-    <backgroundColor red="0.25" green="0.25" blue="0.25" />
-    <polyarray:packedItems>
-        <item type="folder" path="Resources" />
-        <item type="folder" path="Scripts" />
-    </polyarray:packedItems>
-</PolycodeProject>

+ 0 - 39
Examples/Lua/3D_Graphics/BasicLighting/Resources/example.mat

@@ -1,39 +0,0 @@
-<?xml version="1.0" ?>
-<polycode_material_library>
-    <materials>
-        <material name="TestParticle" blendingMode="0">
-            <shader name="DefaultParticleShader">
-                <textures>
-                    <texture name="diffuse">default/default.png</texture>
-                </textures>
-                <params>
-                    <param name="diffuse_color" type="Color" value="1.00 1.00 1.00 1.00" />
-                </params>
-            </shader>
-        </material>
-        <material name="CubeMaterial" blendingMode="0">
-            <shader name="DefaultShader">
-                <textures>
-                    <texture name="diffuse">Resources/pink_texture.png</texture>
-                </textures>
-                <params>
-                    <param name="shininess" type="Number" value="50.00" />
-                    <param name="diffuse_color" type="Color" value="1.00 1.00 1.00 1.00" />
-                    <param name="specular_color" type="Color" value="1.00 1.00 1.00 1.00" />
-                </params>
-            </shader>
-        </material>
-        <material name="GroundMaterial" blendingMode="0">
-            <shader name="DefaultShader">
-                <textures>
-                    <texture name="diffuse">Resources/green_texture.png</texture>
-                </textures>
-                <params>
-                    <param name="shininess" type="Number" value="4.72" />
-                    <param name="diffuse_color" type="Color" value="1.00 1.00 1.00 1.00" />
-                    <param name="specular_color" type="Color" value="0.00 0.00 0.00 1.00" />
-                </params>
-            </shader>
-        </material>
-    </materials>
-</polycode_material_library>

BIN
Examples/Lua/3D_Graphics/BasicLighting/Resources/green_texture.png


BIN
Examples/Lua/3D_Graphics/BasicLighting/Resources/pink_texture.png


+ 0 - 27
Examples/Lua/3D_Graphics/BasicLighting/Scripts/BasicLighting.lua

@@ -1,27 +0,0 @@
--- 3D lighting and materials example
-
-Services.ResourceManager:addDirResource("Resources", false)
-
-scene = Scene()
-ground = ScenePrimitive(ScenePrimitive.TYPE_PLANE, 5,5)
-ground:setMaterialByName("GroundMaterial")
-scene:addEntity(ground)
-scene.ambientColor:setColor(0.2, 0.2, 0.2, 1.0)
-
-box =  ScenePrimitive(ScenePrimitive.TYPE_TORUS, 0.8,0.3,30,20)
-box:setMaterialByName("CubeMaterial")
-box:setPosition(0.0, 0.5, 0.0)
-scene:addEntity(box)
-
-light = SceneLight(SceneLight.AREA_LIGHT, scene, 6)
-scene:addLight(light)
-
-scene:getDefaultCamera():setPosition(5,5,5)
-scene:getDefaultCamera():lookAt(Vector3(0,0,0), Vector3(0,1,0))
-
-lightPositionVal = 0
-
-function Update(elapsed)
-	lightPositionVal = lightPositionVal + elapsed
-	light:setPosition(sin(lightPositionVal), 2.0, sin(lightPositionVal))
-end

+ 0 - 8
Examples/Lua/Audio/2DAudio/2DAudio.polyproject

@@ -1,8 +0,0 @@
-<?xml version="1.0" ?>
-<PolycodeProject defaultWidth="640" defaultHeight="480" antiAliasingLevel="0" entryPoint="Scripts/2DAudio.lua" vSync="false" anisotropyLevel="0" frameRate="60">
-    <backgroundColor red="0.25" green="0.25" blue="0.25" />
-    <polyarray:packedItems>
-        <item type="folder" path="Resources" />
-        <item type="folder" path="Scripts" />
-    </polyarray:packedItems>
-</PolycodeProject>

+ 0 - 31
Examples/Lua/Audio/2DAudio/Scripts/2DAudio.lua

@@ -1,31 +0,0 @@
-
--- Basic 2D positional sound example
-
-screen = Screen()
-
-sourceEntity = ScreenEntity()
-testSound = ScreenSound("Resources/test.wav", 200, 600)
-testSound:getSound():Play(true)
-sourceEntity:addChild(testSound)
-soundShape = ScreenShape(ScreenShape.SHAPE_CIRCLE, 20,20,10)
-sourceEntity:addChild(soundShape)
-screen:addChild(sourceEntity)
-
-listenerEntity = ScreenEntity()
-soundListener = ScreenSoundListener()
-listenerEntity:addChild(soundListener)
-
-soundShape = ScreenShape(ScreenShape.SHAPE_CIRCLE, 20,20,10)
-soundShape:setColor(0.0, 1.0, 0.0, 1.0)
-listenerEntity:addChild(soundShape)
-screen:addChild(listenerEntity)
-
-listenerPositionValue = 0
-positionValue = 0
-
-function Update(elapsed)
-        positionValue = positionValue + elapsed
-        listenerPositionValue = listenerPositionValue + elapsed * 0.3
-        sourceEntity:setPosition(300 + (sin(positionValue) * 300), 250 + cos(positionValue) * 100)
-        listenerEntity:setPosition(300 + (sin(listenerPositionValue) * 300), 250)
-end

BIN
Examples/Lua/Audio/3DAudio/Resources/test.wav


+ 0 - 0
Examples/Lua/Audio/3DAudio/3DAudio.polyproject → Examples/Lua/Audio/PositionalAudio/PositionalAudio.polyproject


+ 0 - 0
Examples/Lua/Audio/2DAudio/Resources/test.wav → Examples/Lua/Audio/PositionalAudio/Resources/test.wav


+ 4 - 9
Examples/Lua/Audio/3DAudio/Scripts/3DAudio.lua → Examples/Lua/Audio/PositionalAudio/Scripts/3DAudio.lua

@@ -1,22 +1,17 @@
 
--- Simple positional 3D Audio example.
+-- Simple positional audio example.
 
-scene = Scene()
+scene = Scene(Scene.SCENE_3D)
 
-sourceEntity = SceneEntity()
+sourceEntity = Entity()
 testSound = SceneSound("Resources/test.wav", 20, 50)
 testSound:getSound():Play(true)
+
 sourceEntity:addChild(testSound)
 soundShape = ScenePrimitive(ScenePrimitive.TYPE_BOX, 1,1,1)
-soundShape:setMaterialByName("Default")
 sourceEntity:addChild(soundShape)
 scene:addEntity(sourceEntity)
 
-light = SceneLight(SceneLight.AREA_LIGHT, scene, 300, 0,0)
-scene:addLight(light)
-soundListener = SceneSoundListener()
-scene:addEntity(soundListener)
-
 positionValue = 0
 
 

+ 0 - 11
Examples/Lua/Game_Demos/Platformer/Platformer.polyproject

@@ -1,11 +0,0 @@
-<?xml version="1.0" ?>
-<PolycodeProject defaultWidth="1280" defaultHeight="720" antiAliasingLevel="0" entryPoint="Scripts/Main.lua" textureFiltering="linear" vSync="true" anisotropyLevel="0" frameRate="60">
-    <backgroundColor red="0.224599" green="0.224599" blue="0.224599" />
-    <polyarray:packedItems>
-        <item type="folder" path="Resources" />
-        <item type="folder" path="Scripts" />
-    </polyarray:packedItems>
-    <polyarray:fonts>
-        <font name="Sniglet" path="Resources/fonts/Sniglet Regular.otf" />
-    </polyarray:fonts>
-</PolycodeProject>

BIN
Examples/Lua/Game_Demos/Platformer/Resources/entities/button.entity2d


BIN
Examples/Lua/Game_Demos/Platformer/Resources/entities/coin.entity2d


BIN
Examples/Lua/Game_Demos/Platformer/Resources/entities/fly.entity2d


BIN
Examples/Lua/Game_Demos/Platformer/Resources/entities/spaceman.entity2d


BIN
Examples/Lua/Game_Demos/Platformer/Resources/fonts/LondrinaSolid-Regular.otf


BIN
Examples/Lua/Game_Demos/Platformer/Resources/fonts/Sniglet Regular.otf


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/alien_plant.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/background.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/block.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/bonus.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/bonus_used.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/bridge.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/bush.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/cloud_1.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/cloud_2.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/cloud_3.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/coin_bronze.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/coin_gold.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/coin_silver.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/crate.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/enemies/fly.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/enemies/slime_normal.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/enemies/slime_walk.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/fence.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/fence_broken.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/grass.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/ground.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/ground_cave.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/ground_dirt.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/ground_rock.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/ground_sand.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/hill_long.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/hill_short.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/key_blue.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/key_green.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/key_red.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/key_yellow.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/lava.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/lock_blue.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/lock_green.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/lock_red.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/lock_yellow.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/plank.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/rock.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/shroom.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/spaceman.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/spikes.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_blue_off.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_blue_on.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_green_off.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_green_on.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_red_off.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_red_on.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_yellow_off.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/switch_yellow_on.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/images/water.png


BIN
Examples/Lua/Game_Demos/Platformer/Resources/levels/level1.entity2d


BIN
Examples/Lua/Game_Demos/Platformer/Resources/sounds/button.wav


BIN
Examples/Lua/Game_Demos/Platformer/Resources/sounds/coin.wav


Некоторые файлы не были показаны из-за большого количества измененных файлов