Ejemplo n.º 1
0
 //!Apply an OpenGL scale matrix to this
 public GLMatrix4d applyScale(GLVector2d scale)
 {
     //improved version
     //Assuming z = 1
     m[0] *= scale.x;    m[1] *= scale.x;    m[2] *= scale.x;    m[3] *= scale.x;
     m[4] *= scale.y;    m[5] *= scale.y;    m[6] *= scale.y;    m[7] *= scale.y;
     return(this);
 }
Ejemplo n.º 2
0
 //!Apply an OpenGL translate matrix to this
 public GLMatrix4d applyTranslate(GLVector2d trans)
 {
     ////improved version
     ////assuming z = 0
     m[12] += m[0] * trans.x + m[4] * trans.y;
     m[13] += m[1] * trans.x + m[5] * trans.y;
     m[14] += m[2] * trans.x + m[6] * trans.y;
     return(this);
 }
Ejemplo n.º 3
0
 //!Apply an OpenGL translate matrix to this
 public GLMatrix4d applyTranslate( GLVector2d trans)
 {
     ////improved version
     ////assuming z = 0
     m[12] += m[0]*trans.x + m[4]*trans.y;
     m[13] += m[1]*trans.x + m[5]*trans.y;
     m[14] += m[2]*trans.x + m[6]*trans.y;
     return this;
 }
Ejemplo n.º 4
0
 //!Apply an OpenGL scale matrix to this
 public GLMatrix4d applyScale( GLVector2d scale)
 {
     //improved version
     //Assuming z = 1
    m[0]*=scale.x;    m[1]*=scale.x;    m[2]*=scale.x;    m[3]*=scale.x;
    m[4]*=scale.y;    m[5]*=scale.y;    m[6]*=scale.y;    m[7]*=scale.y;
    return this;
 }
Ejemplo n.º 5
0
 //!Copy a vector
 public GLVector2d( GLVector2d gv)
 {
     Buffer.BlockCopy( gv.val, 0, val, 0, Buffer.ByteLength( gv.val ) );
 }
Ejemplo n.º 6
0
 //!Get the vector projection of this and a vector
 public GLVector2d vectorProjection( GLVector2d vin)
 {
     return this * dot(vin);
 }
Ejemplo n.º 7
0
 //!Get the projection of this and a vector
 public double projection( GLVector2d vin)
 {
     return dot(vin);
 }
Ejemplo n.º 8
0
 //!Get the orthogonal projection of this and a vector
 public GLVector2d orthogonalProjection( GLVector2d vin)
 {
     return vin - vectorProjection(vin);
 }
Ejemplo n.º 9
0
 //!Get the dot product of this and a vector
 public double dot( GLVector2d gv)
 {
     return x*gv.x + y*gv.y;
 }
Ejemplo n.º 10
0
 //!Copy a vector
 public GLVector2d(GLVector2d gv)
 {
     Buffer.BlockCopy(gv.val, 0, val, 0, Buffer.ByteLength(gv.val));
 }
Ejemplo n.º 11
0
 //!Get the vector projection of this and a vector
 public GLVector2d vectorProjection(GLVector2d vin)
 {
     return(this * dot(vin));
 }
Ejemplo n.º 12
0
 //!Get the orthogonal projection of this and a vector
 public GLVector2d orthogonalProjection(GLVector2d vin)
 {
     return(vin - vectorProjection(vin));
 }
Ejemplo n.º 13
0
 //!Get the projection of this and a vector
 public double projection(GLVector2d vin)
 {
     return(dot(vin));
 }
Ejemplo n.º 14
0
 //!Get the dot product of this and a vector
 public double dot(GLVector2d gv)
 {
     return(x * gv.x + y * gv.y);
 }