spookyboo wrote:I was also looking into Bullets' math library. It it smaller than Eigen but seems fast enough (at least enough for the Playstation). Maybe also worth considering.
I like the Bullet math better than most. I haven't seen the latest version, latest I've seen is 2.80. But the code is nice and simple, easy to read. It gets the interface mostly right.
It has a few things I don't like:
- Exposes the data members. As an array called m_float. At least the naming is likely to discourage direct access. Also accessor functions are provided.
- btVector4 is derived from btVector3. That seems like trouble. For example, it looks like the dot product of btVector4 is using btVector3::dot.
Bullet also comes with another math lib, its in the Extras/vectormathlibrary folder (no, not the Extras/simdmathlibrary folder, that's something different!). This one is from Sony and supports SSE and AltiVec. It's a bit Altivec-centric since it was made for their PS3 hardware. License reads:
Code: Select all
Vector Math library for 3-D linear algebra (vector, matrix, quaternion)
SIMD support for SSE, PowerPC (PPU) and the SPU.
Also includes generic multi-platform scalar version.
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Actually I think the the fact it was designed for Altivec is a plus since the Xbox360 and PS3 platforms aren't open and aren't as accessible. Also the Altivec platforms are the ones that benefit the most from use of SIMD, since they lack the fancy out-of-order instruction scheduling that we have on x86 platforms.