Fastest pixel blitting renderer being created in Java. 3D renderer. For educational purposes and most importantly, FUN
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package sig;
|
|
|
|
|
|
|
|
public class Vector2 {
|
|
|
|
public float u,v,w;
|
|
|
|
Vector2() {
|
|
|
|
this(0,0,1);
|
|
|
|
}
|
|
|
|
public Vector2(float u,float v) {
|
|
|
|
this(u,v,1);
|
|
|
|
}
|
|
|
|
public Vector2(float u,float v,float w) {
|
|
|
|
this.u=u;
|
|
|
|
this.v=v;
|
|
|
|
this.w=w;
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
protected Object clone(){
|
|
|
|
return new Vector2(u,v,w);
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Vector2 [u=" + u + ", v=" + v + ", w=" + w + "]";
|
|
|
|
}
|
|
|
|
}
|