891fa25675
Add vector_cast implementation and the unit test for it.
2016-11-02 01:19:48 +01:00
f51c739a48
Add a macro to control if the result of binary operators should be casted.
...
It allows to suppress warnings when combining vectors of a type that
gets promoted to int after the binary operator is applied, for example.
2016-11-02 01:14:23 +01:00
6ab4d586eb
Disable implicit conversions by default and update readme.
...
Implicit conversions are still needed for the old unit test to build.
2016-11-02 01:12:00 +01:00
2725d4f63d
Update copyright to 2016
...
I think vectorops was missing the copyright header /on purpose/ but
I've added it there as well now.
2016-11-01 22:58:23 +01:00
84203ee817
Fix broken build when using the get_at() way wrapper.
2016-10-25 01:07:28 +02:00
41eed2c8ba
Warning fix
2016-09-05 21:30:17 +02:00
7affd7960f
Allow casting to vectors of lower dimensions.
2015-07-25 21:18:45 +02:00
fe03f45f76
Add an example.cpp unit test to demonstrate usage.
...
Shows what it looks like when you mix vectors of different
type vs using vectorwrapper.
2015-07-25 20:55:52 +02:00
958de67849
Make scalar_type and vector_type public in Vec.
...
- Add a dot product implementation.
- Test code to demonstrate dot product.
- Test code to demonstrate wrapping structs with unordered properties.
2015-07-25 19:41:16 +02:00
1567feaa81
Fix casting.
...
Casting conditions got clarified.
User is now able to say he doesn't care if casting a wrapper on a
type larger than just the coordinates will stomp on extra data
from the casted type.
2015-07-25 19:12:21 +02:00
e64db02ac3
Fix cast<> method.
...
Add vector_type to is_vec, because vector_type is private
and it couldn't be used in cast. Besides if not is_vec, you can't
expect to find vector_type. The conditional in the cast return type
works like if V2 is not a Vec, you can just use V as the vector_type,
anyways the first is_vec is false so the whole condition is going to
be false anyways, even if it results that V == V.
2015-07-25 01:52:27 +02:00
30371adba9
Add Vec1Promotion.
2015-07-25 00:55:57 +02:00
d3b63aab8c
Fix some build errors in certain cases.
...
- wrapped vector is not guaranteed to have constructors
- vector_type is not necessary
- has typedef and has enum were not always working
2015-07-25 00:55:03 +02:00
7547450913
Fix build errors and typos in the documentation.
2015-07-23 23:10:55 +02:00
5e6c537a2d
Fix in HasEnum that was always returning true.
2015-07-23 23:09:35 +02:00
08050e42da
First import
2015-07-23 01:37:35 +02:00