diff --git a/ImpulseEngine/ImpulseEngine.vcxproj b/ImpulseEngine/ImpulseEngine.vcxproj deleted file mode 100644 index c1cffb9..0000000 --- a/ImpulseEngine/ImpulseEngine.vcxproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {1846AD4F-7BDE-4101-A8DD-FA19E06D9580} - Win32Proj - ImpulseEngine - - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - true - $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(SolutionDir); - - - false - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - Precompiled.h - - - Console - true - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - Precompiled.h - - - Console - true - true - true - - - - - - - - - - - - - - - - - - - - - - Create - Create - - - - - - - - - - - \ No newline at end of file diff --git a/ImpulseEngine/ImpulseEngine.vcxproj.filters b/ImpulseEngine/ImpulseEngine.vcxproj.filters deleted file mode 100644 index 22c89b0..0000000 --- a/ImpulseEngine/ImpulseEngine.vcxproj.filters +++ /dev/null @@ -1,87 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {846af401-dc85-41fe-b401-0c1f360d31fa} - - - {a62145fb-bef6-4ddc-83a3-2205c11b4115} - - - {257a4c03-c263-48e7-8bcc-50e2158dbca4} - - - {d2f138c9-4767-45da-aded-166aceaa7ba8} - - - {eed70418-9e80-4c11-95e0-65007d42d87e} - - - - - Source Files\ImpulseEngine - - - Source Files\ImpulseEngine - - - Source Files\ImpulseEngine - - - Source Files\ImpulseEngine - - - Source Files\Driver - - - Source Files\ImpulseEngine - - - Source Files\ImpulseEngine - - - Source Files\ImpulseEngine\Precompiled - - - Source Files\Render - - - Source Files\ImpulseEngine\Clock - - - - - Source Files\ImpulseEngine - - - Source Files\ImpulseEngine - - - Source Files\Driver - - - Source Files\ImpulseEngine - - - Source Files\ImpulseEngine\Precompiled - - - Source Files\ImpulseEngine - - - Source Files\Render - - - Source Files\ImpulseEngine\Clock - - - - - Source Files\Driver - - - \ No newline at end of file diff --git a/Makefile b/Makefile index d04873f..ff3f5e0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,16 @@ -CXXFLAGS=-O3 -std=c++0x -Wall +UNAME_S := $(shell uname -s) + +#OpenGL behaves a bit differently on MacOS +OSFLAG = +ifeq ($(OS),Windows_NT) + OSFLAG += -D WIN32 +else +ifeq ($(UNAME_S),Darwin) + OSFLAG += -D OSX +endif +endif + +CXXFLAGS=-O3 -std=c++0x -Wall $(OSFLAG) SOURCES= $(wildcard *.cpp) @@ -6,7 +18,12 @@ OBJECTS=$(patsubst %.cpp, %.o, $(SOURCES)) TARGET=$(lastword $(subst /, ,$(realpath .))) -LINKS= -lglut -lGL -lGLU +LINKS = +ifeq ($(UNAME_S),Darwin) + LINKS= -framework OpenGL -framework GLUT +else + LINKS= -lglut -lGL -lGLU +endif CXX=g++ @@ -14,7 +31,10 @@ all: $(TARGET) @echo ImpulseEngine built $(TARGET): $(OBJECTS) - @$(CXX) $(CXXFLAGS) -o impulseengine $(OBJECTS) $(LINKS) + $(info OSFLAG is $(OSFLAG)) + $(info OBJECTS is $(OBJECTS)) + $(CXX) $(CXXFLAGS) $(OSFLAG) -o impulseengine $(OBJECTS) $(LINKS) clean: + echo $(CCFLAGS) rm -rf $(OBJECTS) $(TARGET) diff --git a/Manifold.cpp b/Manifold.cpp index 9846189..63af9fb 100644 --- a/Manifold.cpp +++ b/Manifold.cpp @@ -30,8 +30,8 @@ void Manifold::Initialize( void ) e = std::min( A->restitution, B->restitution ); // Calculate static and dynamic friction - sf = std::sqrt( A->staticFriction * A->staticFriction ); - df = std::sqrt( A->dynamicFriction * A->dynamicFriction ); + sf = std::sqrt( A->staticFriction * B->staticFriction ); + df = std::sqrt( A->dynamicFriction * B->dynamicFriction ); for(uint32 i = 0; i < contact_count; ++i) { diff --git a/README.txt b/README.txt index 7fffa9f..b256136 100644 --- a/README.txt +++ b/README.txt @@ -5,6 +5,6 @@ Impulse Engine is a small 2D physics engine written in C++. The engine is intend Should build in Windows with Visual Studio 2008-2012. Should build on Linux and OSX platforms with the use of C++11 std::chrono. Thanks to whackashoe for the cross-platform port. -If you have any questions feel free to contact Randy at: r dot gaul at digipen dot edu. +If you have any questions feel free to contact Randy at: author's last name followed by 1748 at gmail. -http://randygaul.net \ No newline at end of file +http://randygaul.net diff --git a/glut.h b/glut.h index 06c20fa..0c87ba7 100644 --- a/glut.h +++ b/glut.h @@ -134,8 +134,13 @@ typedef unsigned short wchar_t; #endif /* _WIN32 */ +#ifdef OSX +#include +#include +#else #include #include +#endif #ifdef __cplusplus extern "C" {