Minor vect/rect changes

This commit is contained in:
Ondřej Hruška
2014-04-13 10:39:01 +02:00
parent e1d87df697
commit cacaa9dcce
41 changed files with 557 additions and 387 deletions
@@ -62,7 +62,7 @@ public class SoundSystem extends RootBusNode implements Updateable {
*/
public static VectView getListener()
{
return listener.getView();
return listener.view();
}
// -- instance --
@@ -80,7 +80,7 @@ public class MouseButtonEvent implements Event<MouseButtonEvent.Listener> {
*/
public VectView getPos()
{
return pos.getView();
return pos.view();
}
@@ -23,8 +23,8 @@ public class MouseMotionEvent implements Event<MouseMotionEvent.Listener> {
* @param move move vector
*/
public MouseMotionEvent(Vect pos, Vect move) {
this.move = move.getValue();
this.pos = pos.getValue();
this.move = move.copy();
this.pos = pos.copy();
}
@@ -52,7 +52,7 @@ public class ScreenChangeEvent implements Event<ScreenChangeEvent.Listener> {
*/
public VectView getScreenSize()
{
return screenSize.getView();
return screenSize.view();
}
@@ -1,7 +1,7 @@
package mightypork.gamecore.gui.components.layout;
import static mightypork.utils.math.constraints.Bounds.*;
import static mightypork.utils.math.constraints.ConstraintFactory.*;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.components.PluggableRenderable;
import mightypork.utils.math.constraints.RectBound;
@@ -1,7 +1,7 @@
package mightypork.gamecore.gui.components.layout;
import static mightypork.utils.math.constraints.Bounds.*;
import static mightypork.utils.math.constraints.ConstraintFactory.*;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.components.PluggableRenderable;
import mightypork.utils.math.constraints.RectBound;
@@ -155,7 +155,7 @@ public class InputSystem extends RootBusNode implements Updateable, KeyBinder {
move.mul(1, -1, 1);
if (button != -1 || wheeld != 0) {
getEventBus().send(new MouseButtonEvent(pos.getValue(), button, down, wheeld));
getEventBus().send(new MouseButtonEvent(pos.copy(), button, down, wheeld));
}
moveSum.add(move);
+5 -5
View File
@@ -213,7 +213,7 @@ public class Render {
*/
public static void rotate(double angle, Vect axis)
{
final Vect vec = axis.getView().norm(1);
final Vect vec = axis.view().norm(1);
glRotated(angle, vec.x(), vec.y(), vec.z());
}
@@ -351,7 +351,7 @@ public class Render {
*/
public static void quad(Rect quad)
{
final double x1 = quad.getLeft();
final double x1 = quad.left();
final double y1 = quad.top();
final double x2 = quad.right();
final double y2 = quad.bottom();
@@ -391,12 +391,12 @@ public class Render {
*/
public static void quadUV_nobound(Rect quad, Rect uvs)
{
final double x1 = quad.getLeft();
final double x1 = quad.left();
final double y1 = quad.top();
final double x2 = quad.right();
final double y2 = quad.bottom();
final double tx1 = uvs.getLeft();
final double tx1 = uvs.left();
final double ty1 = uvs.top();
final double tx2 = uvs.right();
final double ty2 = uvs.bottom();
@@ -437,7 +437,7 @@ public class Render {
*/
public static void quadColor(Rect quad, RGB colorHMinVMin, RGB colorHMaxVMin, RGB colorHMaxVMax, RGB colorHMinVMax)
{
final double x1 = quad.getLeft();
final double x1 = quad.left();
final double y1 = quad.top();
final double x2 = quad.right();
final double y2 = quad.bottom();
@@ -110,7 +110,7 @@ public class FontRenderer {
{
Render.pushMatrix();
Render.translate(pos.getValue().round());
Render.translate(pos.copy().round());
Render.scaleXY(getScale(height));
font.draw(text, color);