Added constants to Vector2D, BlockVector and BlockVector2D and made the ones in Vector final.

This commit is contained in:
TomyLobo 2013-08-04 11:51:17 +02:00 committed by wizjany
parent 37373976f5
commit 4c496bfaac
4 changed files with 21 additions and 5 deletions

View File

@ -25,6 +25,12 @@ package com.sk89q.worldedit;
* @author sk89q
*/
public class BlockVector extends Vector {
public static final BlockVector ZERO = new BlockVector(0, 0, 0);
public static final BlockVector UNIT_X = new BlockVector(1, 0, 0);
public static final BlockVector UNIT_Y = new BlockVector(0, 1, 0);
public static final BlockVector UNIT_Z = new BlockVector(0, 0, 1);
public static final BlockVector ONE = new BlockVector(1, 1, 1);
/**
* Construct the Vector object.
*

View File

@ -25,6 +25,11 @@ package com.sk89q.worldedit;
* @author sk89q
*/
public class BlockVector2D extends Vector2D {
public static final BlockVector2D ZERO = new BlockVector2D(0, 0);
public static final BlockVector2D UNIT_X = new BlockVector2D(1, 0);
public static final BlockVector2D UNIT_Z = new BlockVector2D(0, 1);
public static final BlockVector2D ONE = new BlockVector2D(1, 1);
/**
* Construct the Vector object.
*

View File

@ -24,11 +24,11 @@ package com.sk89q.worldedit;
* @author sk89q
*/
public class Vector implements Comparable<Vector> {
public static Vector ZERO = new Vector(0, 0, 0);
public static Vector UNIT_X = new Vector(1, 0, 0);
public static Vector UNIT_Y = new Vector(0, 1, 0);
public static Vector UNIT_Z = new Vector(0, 0, 1);
public static Vector ONE = new Vector(1, 1, 1);
public static final Vector ZERO = new Vector(0, 0, 0);
public static final Vector UNIT_X = new Vector(1, 0, 0);
public static final Vector UNIT_Y = new Vector(0, 1, 0);
public static final Vector UNIT_Z = new Vector(0, 0, 1);
public static final Vector ONE = new Vector(1, 1, 1);
protected final double x, y, z;

View File

@ -24,6 +24,11 @@ package com.sk89q.worldedit;
* @author sk89q
*/
public class Vector2D {
public static final Vector2D ZERO = new Vector2D(0, 0);
public static final Vector2D UNIT_X = new Vector2D(1, 0);
public static final Vector2D UNIT_Z = new Vector2D(0, 1);
public static final Vector2D ONE = new Vector2D(1, 1);
protected final double x, z;
/**