Beispiel #1
0
 public static float angle(warp_Vector a, warp_Vector b)
 // returns the angle between 2 vectors
 {
     a.normalize();
     b.normalize();
     return(a.x * b.x + a.y * b.y + a.z * b.z);
 }
Beispiel #2
0
        void rebuildMatrices()
        {
            if (!needsRebuild)
            {
                return;
            }
            needsRebuild = false;

            warp_Vector forward, up, right;

            forward = warp_Vector.sub(lookat, pos);
            up      = new warp_Vector(0f, 1f, 0f);
            right   = warp_Vector.getNormal(up, forward);
            up      = warp_Vector.getNormal(forward, right);

            forward.normalize();
            up.normalize();
            right.normalize();

            normalmatrix = new warp_Matrix(right, up, forward);
            normalmatrix.rotate(0, 0, rollfactor);
            matrix = normalmatrix.getClone();
            matrix.shift(pos.x, pos.y, pos.z);

            normalmatrix = normalmatrix.inverse();
            matrix       = matrix.inverse();
        }
Beispiel #3
0
 public warp_Light(warp_Vector direction, int diffuse, int specular, int highlightSheen, int highlightSpread)
 {
     v = direction.getClone();
     v.normalize();
     this.diffuse         = diffuse;
     this.specular        = specular;
     this.highlightSheen  = highlightSheen;
     this.highlightSpread = highlightSpread;
 }
Beispiel #4
0
		public warp_Light(warp_Vector direction, int color, int highlightSheen, int highlightSpread)
		{
			v = direction.getClone();
			v.normalize();
			this.diffuse = color;
			this.specular = color;
			this.highlightSheen = highlightSheen;
			this.highlightSpread = highlightSpread;
		}
 public warp_Light(warp_Vector direction, int diffuse, int specular, int highlightSheen, int highlightSpread)
 {
     v = direction;
     v.normalize();
     this.diffuse = diffuse;
     this.specular = specular;
     this.highlightSheen = highlightSheen;
     this.highlightSpread = highlightSpread;
 }
Beispiel #6
0
 public warp_Light(warp_Vector direction, int color, int highlightSheen, int highlightSpread)
 {
     v = direction;
     v.normalize();
     this.diffuse         = color;
     this.specular        = color;
     this.highlightSheen  = highlightSheen;
     this.highlightSpread = highlightSpread;
 }
        void rebuildMatrices()
        {
            if (!needsRebuild) return;
            needsRebuild = false;

            warp_Vector forward, up, right;

            forward = warp_Vector.sub(lookat, pos);
            up = new warp_Vector(0f, 1f, 0f);
            right = warp_Vector.getNormal(up, forward);
            up = warp_Vector.getNormal(forward, right);

            forward.normalize();
            up.normalize();
            right.normalize();

            normalmatrix = new warp_Matrix(right, up, forward);
            normalmatrix.rotate(0, 0, rollfactor);
            matrix = normalmatrix.getClone();
            matrix.shift(pos.x, pos.y, pos.z);

            normalmatrix = normalmatrix.inverse();
            matrix = matrix.inverse();
        }
Beispiel #8
0
		public static float angle(warp_Vector a, warp_Vector b)
			// returns the angle between 2 vectors
		{
			a.normalize();
			b.normalize();
			return (a.x*b.x+a.y*b.y+a.z*b.z);
		}
Beispiel #9
0
 public warp_Light(warp_Vector direction, int diffuse)
 {
     v = direction.getClone();
     v.normalize();
     this.diffuse = diffuse;
 }
Beispiel #10
0
 public warp_Light(warp_Vector direction)
 {
     v = direction.getClone();
     v.normalize();
 }
 public warp_Light(warp_Vector direction, int diffuse)
 {
     v = direction;
     v.normalize();
     this.diffuse = diffuse;
 }
 public warp_Light(warp_Vector direction)
 {
     v = direction;
     v.normalize();
 }
Beispiel #13
0
		public warp_Light(warp_Vector direction)
		{
			v = direction.getClone();
			v.normalize();
		}
Beispiel #14
0
 public warp_Light(warp_Vector direction)
 {
     v = direction;
     v.normalize();
 }