1 // MIT License 2 3 // Copyright (c) 2019 Erin Catto 4 5 // Permission is hereby granted, free of charge, to any person obtaining a copy 6 // of this software and associated documentation files (the "Software"), to deal 7 // in the Software without restriction, including without limitation the rights 8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 // copies of the Software, and to permit persons to whom the Software is 10 // furnished to do so, subject to the following conditions: 11 12 // The above copyright notice and this permission notice shall be included in all 13 // copies or substantial portions of the Software. 14 15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 // SOFTWARE. 22 23 #pragma once 24 25 struct Settings 26 { SettingsSettings27 Settings() 28 { 29 Reset(); 30 } 31 ResetSettings32 void Reset() 33 { 34 m_testIndex = 0; 35 m_windowWidth = 1600; 36 m_windowHeight = 900; 37 m_hertz = 60.0f; 38 m_velocityIterations = 8; 39 m_positionIterations = 3; 40 m_drawShapes = true; 41 m_drawJoints = true; 42 m_drawAABBs = false; 43 m_drawContactPoints = false; 44 m_drawContactNormals = false; 45 m_drawContactImpulse = false; 46 m_drawFrictionImpulse = false; 47 m_drawCOMs = false; 48 m_drawStats = false; 49 m_drawProfile = false; 50 m_enableWarmStarting = true; 51 m_enableContinuous = true; 52 m_enableSubStepping = false; 53 m_enableSleep = true; 54 m_pause = false; 55 m_singleStep = false; 56 } 57 58 void Save(); 59 void Load(); 60 61 int m_testIndex; 62 int m_windowWidth; 63 int m_windowHeight; 64 float m_hertz; 65 int m_velocityIterations; 66 int m_positionIterations; 67 bool m_drawShapes; 68 bool m_drawJoints; 69 bool m_drawAABBs; 70 bool m_drawContactPoints; 71 bool m_drawContactNormals; 72 bool m_drawContactImpulse; 73 bool m_drawFrictionImpulse; 74 bool m_drawCOMs; 75 bool m_drawStats; 76 bool m_drawProfile; 77 bool m_enableWarmStarting; 78 bool m_enableContinuous; 79 bool m_enableSubStepping; 80 bool m_enableSleep; 81 bool m_pause; 82 bool m_singleStep; 83 }; 84