TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: C++ maths library for graphics and games

4 点作者 polymonster超过 5 年前

1 comment

polymonster超过 5 年前
I wanted to share my c++ maths library have been adding to for quite a long time now, There are lot of other available maths libraries but I have enjoyed developing and maintaining this over the years since.<p>As a graphics programmer it has been a good learning experience to implement my own maths library from scratch because linear algebra is such an integral part of my job, I also learned a lot about template programming to implement the types and also the vector swizzles.<p>A lot of other available maths libraries provide matrix, quaternion and vectors.. but not as many provide a vast collection of geometric intersection and overlap tests as my library does.<p>Additionally other maths libraries may be SIMD implementations, this library is all scalar and that is my intention all along. I favour the portability and simplicity of the scalar implementation.. I do like SIMD for sure but find that code can be optimised to much greater effect by writing entire algorithms in SIMD and not relying on the underlying vector &#x2F; matrix SIMD implementation.. this is due to often a large number of horizontal operations may be necessary in certain algorithms.<p>This may be a bit dated now, but my experience with SIMD vector implementations on PowerPC were very inefficient because of general use games &#x2F; graphics code often wants to access and set single vector elements and get them into floats and it would cause load hit stores and massive performance penalties, so then you require the scalar float in vec type and add all that additional complexity.<p>Anyway.. I hope people might find this useful if you are looking for a simple c++ maths library packed with great features for graphics and games :)