Java Code Examples for com.watabou.glwrap.Matrix#setIdentity()

The following examples show how to use com.watabou.glwrap.Matrix#setIdentity() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Camera.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 6 votes vote down vote up
public Camera( int x, int y, int width, int height, float zoom ) {
	
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
	this.zoom = zoom;
	
	screenWidth = (int)(width * zoom);
	screenHeight = (int)(height * zoom);
	
	scroll = new PointF();
	
	matrix = new float[16];
	Matrix.setIdentity( matrix );
}
 
Example 2
Source File: Camera.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 6 votes vote down vote up
public Camera( int x, int y, int width, int height, float zoom ) {
	
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
	this.zoom = zoom;
	
	screenWidth = (int)(width * zoom);
	screenHeight = (int)(height * zoom);
	
	scroll = new PointF();
	
	matrix = new float[16];
	Matrix.setIdentity( matrix );
}
 
Example 3
Source File: Camera.java    From shattered-pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public Camera( int x, int y, int width, int height, float zoom ) {
	
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
	this.zoom = zoom;
	
	screenWidth = (int)(width * zoom);
	screenHeight = (int)(height * zoom);
	
	scroll = new PointF();
	
	matrix = new float[16];
	Matrix.setIdentity( matrix );
}
 
Example 4
Source File: Camera.java    From PD-classes with GNU General Public License v3.0 6 votes vote down vote up
public Camera( int x, int y, int width, int height, float zoom ) {
	
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
	this.zoom = zoom;
	
	screenWidth = (int)(width * zoom);
	screenHeight = (int)(height * zoom);
	
	scroll = new PointF();
	
	matrix = new float[16];
	Matrix.setIdentity( matrix );
}
 
Example 5
Source File: Camera.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public Camera( int x, int y, int width, int height, float zoom ) {
	
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
	this.zoom = zoom;
	
	screenWidth = (int)(width * zoom);
	screenHeight = (int)(height * zoom);
	
	scroll = new PointF();
	
	matrix = new float[16];
	Matrix.setIdentity( matrix );
}
 
Example 6
Source File: SystemText.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	// "origin" field is ignored
	Matrix.setIdentity(matrix);
	Matrix.translate(matrix, x, y);
	Matrix.scale(matrix, scale.x, scale.y);
	Matrix.rotate(matrix, angle);
}
 
Example 7
Source File: Visual.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
protected void updateMatrix() {
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	if (origin.x != 0 || origin.y != 0)
		Matrix.translate( matrix, origin.x, origin.y );
	if (angle != 0) {
		Matrix.rotate( matrix, angle );
	}
	if (scale.x != 1 || scale.y != 1) {
		Matrix.scale( matrix, scale.x, scale.y );
	}
	if (origin.x != 0 || origin.y != 0)
		Matrix.translate( matrix, -origin.x, -origin.y );
}
 
Example 8
Source File: BitmapText.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	// "origin" field is ignored
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.scale( matrix, scale.x, scale.y );
	Matrix.rotate( matrix, angle );
}
 
Example 9
Source File: Visual.java    From PD-classes with GNU General Public License v3.0 5 votes vote down vote up
protected void updateMatrix() {
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.translate( matrix, origin.x, origin.y );
	if (angle != 0) {
		Matrix.rotate( matrix, angle );
	}
	if (scale.x != 1 || scale.y != 1) {
		Matrix.scale( matrix, scale.x, scale.y );
	}
	Matrix.translate( matrix, -origin.x, -origin.y );
}
 
Example 10
Source File: BitmapText.java    From PD-classes with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	// "origin" field is ignored
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.scale( matrix, scale.x, scale.y );
	Matrix.rotate( matrix, angle );
}
 
Example 11
Source File: Camera.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public void updateFullscreenCameraZoom(float zoom) {
	width = (int)Math.ceil( Game.width() / zoom );
	height = (int)Math.ceil( Game.height() / zoom );
	x = (int)(Game.width() - width * zoom) / 2;
	y = (int)(Game.height() - height * zoom) / 2;
	this.zoom = zoom;

	screenWidth = (int)(width * zoom);
	screenHeight = (int)(height * zoom);

	scroll = new PointF();

	matrix = new float[16];
	Matrix.setIdentity( matrix );
}
 
Example 12
Source File: BitmapText.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	// "origin" field is ignored
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.scale( matrix, scale.x, scale.y );
	Matrix.rotate( matrix, angle );
}
 
Example 13
Source File: Visual.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
protected void updateMatrix() {
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.translate( matrix, origin.x, origin.y );
	if (angle != 0) {
		Matrix.rotate( matrix, angle );
	}
	if (scale.x != 1 || scale.y != 1) {
		Matrix.scale( matrix, scale.x, scale.y );
	}
	Matrix.translate( matrix, -origin.x, -origin.y );
}
 
Example 14
Source File: BitmapText.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	// "origin" field is ignored
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.scale( matrix, scale.x, scale.y );
	Matrix.rotate( matrix, angle );
}
 
Example 15
Source File: Visual.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
protected void updateMatrix() {
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	if (origin.x != 0 || origin.y != 0)
		Matrix.translate( matrix, origin.x, origin.y );
	if (angle != 0) {
		Matrix.rotate( matrix, angle );
	}
	if (scale.x != 1 || scale.y != 1) {
		Matrix.scale( matrix, scale.x, scale.y );
	}
	if (origin.x != 0 || origin.y != 0)
		Matrix.translate( matrix, -origin.x, -origin.y );
}
 
Example 16
Source File: BitmapText.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	// "origin" field is ignored
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.scale( matrix, scale.x, scale.y );
	Matrix.rotate( matrix, angle );
}
 
Example 17
Source File: Visual.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
protected void updateMatrix() {
	Matrix.setIdentity( matrix );
	Matrix.translate( matrix, x, y );
	Matrix.translate( matrix, origin.x, origin.y );
	if (angle != 0) {
		Matrix.rotate( matrix, angle );
	}
	if (scale.x != 1 || scale.y != 1) {
		Matrix.scale( matrix, scale.x, scale.y );
	}
	Matrix.translate(matrix, -origin.x, -origin.y);
}