com.watabou.glwrap.Matrix Java Examples

The following examples show how to use com.watabou.glwrap.Matrix. 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 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 #2
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 #3
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 #4
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 #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: 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 #7
Source File: ItemSprite.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.copy(matrix, shadowMatrix);
	Matrix.translate(shadowMatrix,
			(width() * (1f - shadowWidth)) / 2f,
			(height() * (1f - shadowHeight)) + shadowOffset);
	Matrix.scale(shadowMatrix, shadowWidth, shadowHeight);
}
 
Example #8
Source File: CharSprite.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.copy(matrix, shadowMatrix);
	Matrix.translate(shadowMatrix,
			(width() * (1f - shadowWidth)) / 2f,
			(height() * (1f - shadowHeight)) + shadowOffset);
	Matrix.scale(shadowMatrix, shadowWidth, shadowHeight);
}
 
Example #9
Source File: RenderedText.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	//sometimes the font is rendered oddly, so we offset here to put it in the correct spot
	if (renderedHeight != height) {
		Matrix.translate(matrix, 0, Math.round(height - renderedHeight));
	}
}
 
Example #10
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 #11
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 #12
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 #13
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 #14
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 #15
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 #16
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 #17
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 #18
Source File: ItemSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.copy(matrix, shadowMatrix);
	Matrix.translate(shadowMatrix,
			(width() * (1f - shadowWidth)) / 2f,
			(height() * (1f - shadowHeight)) + shadowOffset);
	Matrix.scale(shadowMatrix, shadowWidth, shadowHeight);
}
 
Example #19
Source File: CharSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.copy(matrix, shadowMatrix);
	Matrix.translate(shadowMatrix,
			(width * (1f - shadowWidth)) / 2f,
			(height * (1f - shadowHeight)) + shadowOffset);
	Matrix.scale(shadowMatrix, shadowWidth, shadowHeight);
}
 
Example #20
Source File: RenderedText.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	//sometimes the font is rendered oddly, so we offset here to put it in the correct spot
	if (renderedHeight != height) {
		Matrix.translate(matrix, 0, Math.round(height - renderedHeight));
	}
}
 
Example #21
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 #22
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 #23
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);
}
 
Example #24
Source File: SurfaceScene.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.skewX( matrix, (float)(angle / Matrix.G2RAD) );
}
 
Example #25
Source File: SurfaceScene.java    From remixed-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.skewX(matrix, (float) (angle / Matrix.G2RAD));
}
 
Example #26
Source File: SurfaceScene.java    From pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.skewX( matrix, (float)(angle / Matrix.G2RAD) );
}
 
Example #27
Source File: SurfaceScene.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.skewX( matrix, (float)(angle / Matrix.G2RAD) );
}
 
Example #28
Source File: SurfaceScene.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.skewX( matrix, (float)(angle / Matrix.G2RAD) );
}
 
Example #29
Source File: SurfaceScene.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void updateMatrix() {
	super.updateMatrix();
	Matrix.skewX( matrix, (float)(angle / Matrix.G2RAD) );
}