diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..616612c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.pdf linguist-detectable=false +*.tm linguist-detectable=false diff --git a/LightRays.xcodeproj/project.pbxproj b/LightRays.xcodeproj/project.pbxproj index cfd0d6e..114762c 100644 --- a/LightRays.xcodeproj/project.pbxproj +++ b/LightRays.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 022C25F6239ADF4400E2D35D /* Source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 022C25F4239ADF4400E2D35D /* Source.cpp */; }; 026842D323D727A70023E614 /* ObjetDiffusant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 026842D123D727A70023E614 /* ObjetDiffusant.cpp */; }; 02862264240ED9750000A6ED /* Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F319B423DA713B0059D3AF /* Scene.cpp */; }; + 02A50045242ADE2000252D54 /* main_diffus_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02B2BEE523FEAF75009FDF7F /* main_diffus_test.cpp */; }; 02AEC71D23F2CB8900816C72 /* ObjetsOptiques.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02AEC71B23F2CB8900816C72 /* ObjetsOptiques.cpp */; }; 02B2BEE923FF44B8009FDF7F /* SceneTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02B2BEE723FF44B8009FDF7F /* SceneTest.cpp */; }; 02C0BBF923F99485006F99C7 /* Brouillard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02C0BBF723F99485006F99C7 /* Brouillard.cpp */; }; @@ -220,6 +221,7 @@ 02C0BBF923F99485006F99C7 /* Brouillard.cpp in Sources */, 02D1B5972376EC0E00B7FC13 /* Rayon.cpp in Sources */, 02B2BEE923FF44B8009FDF7F /* SceneTest.cpp in Sources */, + 02A50045242ADE2000252D54 /* main_diffus_test.cpp in Sources */, 02D1B59A2377242B00B7FC13 /* Util.cpp in Sources */, 02AEC71D23F2CB8900816C72 /* ObjetsOptiques.cpp in Sources */, ); diff --git a/LightRays/sfml_c01.hpp b/LightRays/sfml_c01.hpp index 69f67ea..18f3d5e 100644 --- a/LightRays/sfml_c01.hpp +++ b/LightRays/sfml_c01.hpp @@ -1,15 +1,18 @@ #include #include +#ifndef SFMLC01_WINDOW_HEIGHT +#define SFMLC01_WINDOW_HEIGHT SFMLC01_WINDOW_UNIT +#endif namespace sf { namespace c01 { inline sf::Vector2f toWin (pt2_t p) { - return sf::Vector2f( p.x*SFMLC01_WINDOW_UNIT, (1.f-p.y)*SFMLC01_WINDOW_UNIT ); + return sf::Vector2f( p.x*SFMLC01_WINDOW_UNIT, SFMLC01_WINDOW_HEIGHT-p.y*SFMLC01_WINDOW_UNIT ); } inline void setCircleCR (sf::CircleShape& circle, pt2_t c, float r) { circle.setRadius(r*SFMLC01_WINDOW_UNIT); - circle.setPosition( (c.x-r)*SFMLC01_WINDOW_UNIT, (1.f-c.y-r)*SFMLC01_WINDOW_UNIT ); + circle.setPosition( (c.x-r)*SFMLC01_WINDOW_UNIT, SFMLC01_WINDOW_HEIGHT-(c.y+r)*SFMLC01_WINDOW_UNIT ); } inline sf::CircleShape buildCircleShapeCR (pt2_t c, float r) { sf::CircleShape circle; sf::c01::setCircleCR(circle, c, r); return circle;