Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix to allow ubyte vectors #26

Merged
merged 1 commit into from

2 participants

@SerialVelocity

The basis vectors, that are automatically generated, passed int values into the
constructor. This caused errors since an int cannot be converted into a ubyte
implicitly. Now we just pass in parameters of the vector type.

Ben Grabham Fix to allow ubyte vectors
The basis vectors, that are automatically generated, passed int values into the
constructor. This caused errors since an int cannot be converted into a ubyte
implicitly. Now we just pass in parameters of the vector type.
2504003
@Dav1dde Dav1dde merged commit ad3bba9 into Dav1dde:master
@Dav1dde
Owner

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 7, 2014
  1. Fix to allow ubyte vectors

    Ben Grabham authored
    The basis vectors, that are automatically generated, passed int values into the
    constructor. This caused errors since an int cannot be converted into a ubyte
    implicitly. Now we just pass in parameters of the vector type.
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 9 deletions.
  1. +9 −9 gl3n/linalg.d
View
18 gl3n/linalg.d
@@ -87,17 +87,17 @@ struct Vector(type, int dimension_) {
}
static if(dimension == 2) {
- enum Vector e1 = Vector(1, 0); /// canonical basis for Euclidian space
- enum Vector e2 = Vector(0, 1); /// ditto
+ enum Vector e1 = Vector(1.to!vt, 0.to!vt); /// canonical basis for Euclidian space
+ enum Vector e2 = Vector(0.to!vt, 1.to!vt); /// ditto
} else static if(dimension == 3) {
- enum Vector e1 = Vector(1, 0, 0); /// canonical basis for Euclidian space
- enum Vector e2 = Vector(0, 1, 0); /// ditto
- enum Vector e3 = Vector(0, 0, 1); /// ditto
+ enum Vector e1 = Vector(1.to!vt, 0.to!vt, 0.to!vt); /// canonical basis for Euclidian space
+ enum Vector e2 = Vector(0.to!vt, 1.to!vt, 0.to!vt); /// ditto
+ enum Vector e3 = Vector(0.to!vt, 0.to!vt, 1.to!vt); /// ditto
} else static if(dimension == 4) {
- enum Vector e1 = Vector(1, 0, 0, 0); /// canonical basis for Euclidian space
- enum Vector e2 = Vector(0, 1, 0, 0); /// ditto
- enum Vector e3 = Vector(0, 0, 1, 0); /// ditto
- enum Vector e4 = Vector(0, 0, 0, 1); /// ditto
+ enum Vector e1 = Vector(1.to!vt, 0.to!vt, 0.to!vt, 0.to!vt); /// canonical basis for Euclidian space
+ enum Vector e2 = Vector(0.to!vt, 1.to!vt, 0.to!vt, 0.to!vt); /// ditto
+ enum Vector e3 = Vector(0.to!vt, 0.to!vt, 1.to!vt, 0.to!vt); /// ditto
+ enum Vector e4 = Vector(0.to!vt, 0.to!vt, 0.to!vt, 1.to!vt); /// ditto
}
unittest {
Something went wrong with that request. Please try again.