Skip to content
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

Made math constants constexpr instead of const #128

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

adriengivry
Copy link
Contributor

Describe the issue (if no issue has been made)

Math constants are declared using the const keyword, but it doesn't guarantee that no memory will be allocated for them. To speed up operations, defining these constants as constexpr ensures the fastest possible access to them during runtime.

I also updated (float)HUGE_VAL to use std::numeric_limits<float>::infinity(), which provides better cross-platform guarantee of its value.

@jmorton06 jmorton06 merged commit 0589c28 into jmorton06:main Dec 11, 2023
11 checks passed
jmorton06 added a commit that referenced this pull request Jan 18, 2024
commit b5a0f9f
Merge: 80f1e57 2d97104
Author: jmorton06 <[email protected]>
Date:   Sun Dec 31 18:53:46 2023 +0000

    Merge pull request #132 from adriengivry/fix/readme-apple-targets

    Fixed Runtime.xcodeproj path for apple targets

commit 2d97104
Author: Adrien GIVRY <[email protected]>
Date:   Sun Dec 31 11:26:34 2023 -0500

    Fixed Runtime.xcodeproj path for apple targets

commit 80f1e57
Merge: 648688c 4284ddf
Author: jmorton06 <[email protected]>
Date:   Fri Dec 29 20:42:44 2023 +0000

    Merge pull request #131 from jmorton06/dev

    Dev

commit 648688c
Merge: 0589c28 c8affd4
Author: jmorton06 <[email protected]>
Date:   Mon Dec 11 20:08:35 2023 +0000

    Merge pull request #129 from adriengivry/reduced-definition-enum-footprint

    Reduced memory footprint of graphics RHI definitions enums

commit 0589c28
Merge: 5eaf2da c528a26
Author: jmorton06 <[email protected]>
Date:   Mon Dec 11 20:08:07 2023 +0000

    Merge pull request #128 from adriengivry/constexpr-constants

    Made math constants constexpr instead of const

commit 5eaf2da
Merge: e6f3f97 73b902b
Author: jmorton06 <[email protected]>
Date:   Mon Dec 11 20:05:10 2023 +0000

    Merge pull request #127 from adriengivry/smoother-camera-focus

    Camera focus transition is now smoother

commit e6f3f97
Merge: 525a491 d71cf77
Author: jmorton06 <[email protected]>
Date:   Mon Dec 11 20:04:30 2023 +0000

    Merge pull request #126 from adriengivry/refactor/audio-data-raii-compliant

     Refactor: `AudioData` Memory Management for Improved RAII Compliance

commit c8affd4
Author: Adrien GIVRY <[email protected]>
Date:   Mon Dec 11 13:46:09 2023 -0500

    Reduced memory footprint of graphics RHI definitions enums

commit c528a26
Author: Adrien GIVRY <[email protected]>
Date:   Mon Dec 11 13:33:30 2023 -0500

    Made math constants constexpr instead of const (ensure no memory is allocated for them at runtime)

commit 73b902b
Author: Adrien GIVRY <[email protected]>
Date:   Mon Dec 11 13:25:41 2023 -0500

    Updated camera speed for more consistency

commit ad7d20e
Author: Adrien GIVRY <[email protected]>
Date:   Mon Dec 11 12:51:09 2023 -0500

    Camera focus transition is now smoother

commit d71cf77
Author: Adrien GIVRY <[email protected]>
Date:   Mon Dec 11 12:03:03 2023 -0500

    Updated `AudioData` to be RAII compliant

commit 525a491
Merge: 0b2a6d0 b22fd06
Author: jmorton06 <[email protected]>
Date:   Mon Dec 11 16:40:35 2023 +0000

    Merge pull request #125 from adriengivry/better-windows-build-scripts

    Improved Windows Generation & Build Scripts

commit b22fd06
Author: Adrien GIVRY <[email protected]>
Date:   Mon Dec 11 11:14:54 2023 -0500

    Improved Windows Generation & Build Scripts

    * Added vswhere.exe to locate MSBuild executable
    * Added common script to generate a vs project
    * Added common script to build a vs project (using vswhere.exe)
    * Updated GenerateVSX.bat scripts to use Common/GenerateVSProject.bat
    * Updated BuildWindow*.bat to use Common/BuildWindowsTarget.bat
    * Renamed GenerateVS.bat to GenerateVS17.bat for consistency

commit 0b2a6d0
Merge: 57fe40d 479f759
Author: jmorton06 <[email protected]>
Date:   Thu Dec 7 10:33:24 2023 +0000

    Merge pull request #124 from jmorton06/dev

    Dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants