diff --git a/examples/ExampleBrowser/OpenGLExampleBrowser.cpp b/examples/ExampleBrowser/OpenGLExampleBrowser.cpp index 542dbbc2f..2d3c93ccb 100644 --- a/examples/ExampleBrowser/OpenGLExampleBrowser.cpp +++ b/examples/ExampleBrowser/OpenGLExampleBrowser.cpp @@ -5,7 +5,7 @@ #include "../OpenGLWindow/SimpleOpenGL3App.h" #include "../CommonInterfaces/CommonRenderInterface.h" #ifdef __APPLE__ -#include "OpenGLWindow/MacOpenGLWindow.h" +#include "../OpenGLWindow/MacOpenGLWindow.h" #else #ifdef _WIN32 #include "../OpenGLWindow/Win32OpenGLWindow.h" @@ -778,4 +778,4 @@ void OpenGLExampleBrowser::update(float deltaTime) gui->forceUpdateScrollBars(); -} \ No newline at end of file +} diff --git a/examples/Importers/ImportObjDemo/ImportObjExample.cpp b/examples/Importers/ImportObjDemo/ImportObjExample.cpp index 05aa90b07..0c2b32ea1 100644 --- a/examples/Importers/ImportObjDemo/ImportObjExample.cpp +++ b/examples/Importers/ImportObjDemo/ImportObjExample.cpp @@ -1,7 +1,7 @@ #include "ImportObjExample.h" #include #include "../OpenGLWindow/GLInstancingRenderer.h" -#include"../Wavefront/tiny_obj_loader.h" +#include"Wavefront/tiny_obj_loader.h" #include "../OpenGLWindow/GLInstanceGraphicsShape.h" #include "btBulletDynamicsCommon.h" #include "../OpenGLWindow/SimpleOpenGL3App.h" diff --git a/examples/Importers/ImportObjDemo/LoadMeshFromObj.cpp b/examples/Importers/ImportObjDemo/LoadMeshFromObj.cpp index 765a11a63..4988fb877 100644 --- a/examples/Importers/ImportObjDemo/LoadMeshFromObj.cpp +++ b/examples/Importers/ImportObjDemo/LoadMeshFromObj.cpp @@ -1,5 +1,5 @@ #include "LoadMeshFromObj.h" -#include"../Wavefront/tiny_obj_loader.h" +#include"Wavefront/tiny_obj_loader.h" #include "../OpenGLWindow/GLInstanceGraphicsShape.h" #include //fopen #include "Bullet3Common/b3AlignedObjectArray.h" @@ -14,4 +14,4 @@ GLInstanceGraphicsShape* LoadMeshFromObj(const char* relativeFileName, const cha GLInstanceGraphicsShape* gfxShape = btgCreateGraphicsShapeFromWavefrontObj(shapes); return gfxShape; -} \ No newline at end of file +} diff --git a/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.h b/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.h index 09f0bf683..c93d1c465 100644 --- a/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.h +++ b/examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.h @@ -1,7 +1,7 @@ #ifndef WAVEFRONT2GRAPHICS_H #define WAVEFRONT2GRAPHICS_H -#include"../Wavefront/tiny_obj_loader.h" +#include"Wavefront/tiny_obj_loader.h" #include struct GLInstanceGraphicsShape* btgCreateGraphicsShapeFromWavefrontObj(std::vector& shapes); diff --git a/examples/OpenGLWindow/MacOpenGLWindow.h b/examples/OpenGLWindow/MacOpenGLWindow.h index d31387574..b267790f4 100644 --- a/examples/OpenGLWindow/MacOpenGLWindow.h +++ b/examples/OpenGLWindow/MacOpenGLWindow.h @@ -1,7 +1,7 @@ #ifndef MAC_OPENGL_WINDOW_H #define MAC_OPENGL_WINDOW_H -#include "b3gWindowInterface.h" +#include "../CommonInterfaces/CommonWindowInterface.h" #define b3gDefaultOpenGLWindow MacOpenGLWindow @@ -39,6 +39,8 @@ public: void getMouseCoordinates(int& x, int& y); void runMainLoop(); + + virtual bool isModifiedKeyPressed(int key); void setMouseButtonCallback(b3MouseButtonCallback mouseCallback) { @@ -51,7 +53,8 @@ public: } void setResizeCallback(b3ResizeCallback resizeCallback); - + + void setKeyboardCallback( b3KeyboardCallback keyboardCallback) { m_keyboardCallback = keyboardCallback; diff --git a/examples/OpenGLWindow/MacOpenGLWindow.mm b/examples/OpenGLWindow/MacOpenGLWindow.mm index 50998b7e7..66d42124e 100644 --- a/examples/OpenGLWindow/MacOpenGLWindow.mm +++ b/examples/OpenGLWindow/MacOpenGLWindow.mm @@ -222,6 +222,35 @@ MacOpenGLWindow::~MacOpenGLWindow() } +bool MacOpenGLWindow::isModifiedKeyPressed(int key) +{ + bool isPressed = false; + + switch (key) + { + case B3G_ALT: + { + isPressed = ((m_modifierFlags && NSAlternateKeyMask)!=0); + break; + }; + case B3G_SHIFT: + { + isPressed = ((m_modifierFlags && NSShiftKeyMask)!=0); + break; + }; + case B3G_CONTROL: + { + isPressed = ((m_modifierFlags && NSControlKeyMask )!=0); + break; + }; + + default: + { + } + }; + return isPressed; +} + float MacOpenGLWindow::getTimeInSeconds() { return 0.f; diff --git a/examples/OpenGLWindow/Win32Window.cpp b/examples/OpenGLWindow/Win32Window.cpp index 0f524dbc7..eef329334 100644 --- a/examples/OpenGLWindow/Win32Window.cpp +++ b/examples/OpenGLWindow/Win32Window.cpp @@ -795,4 +795,4 @@ b3WheelCallback Win32Window::getWheelCallback() return m_data->m_wheelCallback; } - \ No newline at end of file + diff --git a/examples/RenderingExamples/RaytracerSetup.cpp b/examples/RenderingExamples/RaytracerSetup.cpp index a8bbd4123..8f17b9963 100644 --- a/examples/RenderingExamples/RaytracerSetup.cpp +++ b/examples/RenderingExamples/RaytracerSetup.cpp @@ -47,11 +47,11 @@ struct RaytracerPhysicsSetup : public ExampleInterface ///lowlevelRaytest performs a ray versus convex shape, returning true is a hit is found (filling in worldNormal and worldHitPoint) bool lowlevelRaytest(const btVector3& rayFrom,const btVector3& rayTo,btVector3& worldNormal,btVector3& worldHitPoint); - virtual bool RaytracerPhysicsSetup::mouseMoveCallback(float x,float y); + virtual bool mouseMoveCallback(float x,float y); - virtual bool RaytracerPhysicsSetup::mouseButtonCallback(int button, int state, float x, float y); + virtual bool mouseButtonCallback(int button, int state, float x, float y); - virtual bool RaytracerPhysicsSetup::keyboardCallback(int key, int state); + virtual bool keyboardCallback(int key, int state); virtual void renderScene() { @@ -381,4 +381,4 @@ void RaytracerPhysicsSetup::syncPhysicsToGraphics(GraphicsPhysicsBridge& gfxBrid ExampleInterface* RayTracerCreateFunc(struct PhysicsInterface* pint, struct GUIHelperInterface* helper, int option) { return new RaytracerPhysicsSetup(helper->getAppInterface()); - } \ No newline at end of file + } diff --git a/src/Bullet3Common/b3FileUtils.h b/src/Bullet3Common/b3FileUtils.h index 5d2efe0cd..6745126a3 100644 --- a/src/Bullet3Common/b3FileUtils.h +++ b/src/Bullet3Common/b3FileUtils.h @@ -4,6 +4,7 @@ #include #include "b3Scalar.h" #include //ptrdiff_h +#include struct b3FileUtils {