Skip to content

Commit

Permalink
Floating point precision for physics related projects should be preci…
Browse files Browse the repository at this point in the history
…se on Windows x64 (close #383)

There's no ability to change the precision in runtime on Windows x64, so the physics calculations always were in low precision. This caused some dynamic objects were falling through terrain on spawn.
  • Loading branch information
Xottab-DUTY committed Oct 26, 2019
1 parent 4e5bece commit 443b674
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Externals/ODE.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpp14</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdcpp14</LanguageStandard>
<FloatingPointModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Precise</FloatingPointModel>
</ClCompile>
<Link>
<ModuleDefinitionFile>ode/config/msvcdefs.def</ModuleDefinitionFile>
Expand All @@ -97,13 +98,15 @@
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdcpp14</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdcpp14</LanguageStandard>
<FloatingPointModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Mixed'">
<ClCompile>
<PreprocessorDefinitions>dNODEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">stdcpp14</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'">stdcpp14</LanguageStandard>
<FloatingPointModel Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'">Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions Externals/OPCODE/OPCODE.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<PrecompiledHeaderFile>pch.hpp</PrecompiledHeaderFile>
<PreprocessorDefinitions>OPCODE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -109,6 +110,7 @@
<PrecompiledHeaderFile>pch.hpp</PrecompiledHeaderFile>
<PreprocessorDefinitions>OPCODE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">
Expand All @@ -131,6 +133,7 @@
<PrecompiledHeaderFile>pch.hpp</PrecompiledHeaderFile>
<PreprocessorDefinitions>OPCODE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/xrCDB/xrCDB.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@
<ClCompile>
<PreprocessorDefinitions>_USRDLL;XRCDB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>_USRDLL;XRCDB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -128,6 +130,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'">
<ClCompile>
<PreprocessorDefinitions>_USRDLL;XRCDB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/xrPhysics/xrPhysics.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
<ClCompile>
<PreprocessorDefinitions>_USRDLL;XRPHYSICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(xrExternals)ode/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -121,6 +122,7 @@
<ClCompile>
<PreprocessorDefinitions>_USRDLL;XRPHYSICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(xrExternals)ode/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">
Expand All @@ -135,6 +137,7 @@
<PreprocessorDefinitions>_USRDLL;XRPHYSICS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(xrExternals)ode/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<FloatingPointModel>Precise</FloatingPointModel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down

0 comments on commit 443b674

Please sign in to comment.