Skip to content

Fixed friction bug #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 0 additions & 108 deletions ImpulseEngine/ImpulseEngine.vcxproj

This file was deleted.

87 changes: 0 additions & 87 deletions ImpulseEngine/ImpulseEngine.vcxproj.filters

This file was deleted.

26 changes: 23 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
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)

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++

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)
4 changes: 2 additions & 2 deletions Manifold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
http://randygaul.net
5 changes: 5 additions & 0 deletions glut.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,13 @@ typedef unsigned short wchar_t;

#endif /* _WIN32 */

#ifdef OSX
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif

#ifdef __cplusplus
extern "C" {
Expand Down