aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/olacraft/picker/joglBlockPicker.java
blob: 6eb279cae765cd0b6dff825f2bb1173ea90e81d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package ru.olamedia.olacraft.picker;

import java.nio.FloatBuffer;

import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;

import ru.olamedia.olacraft.world.block.Block;
import ru.olamedia.olacraft.world.provider.ChunkProvider;

public class joglBlockPicker {
	ChunkProvider provider;

	public void setChunkProvider(ChunkProvider provider) {
		this.provider = provider;
	}

	public Block pickBlock(GLAutoDrawable drawable) {
		GL2 gl = drawable.getGL().getGL2();
		FloatBuffer projMatrix = FloatBuffer.allocate(16);
		FloatBuffer modelMatrix = FloatBuffer.allocate(16);
		gl.glGetFloatv(GL2.GL_PROJECTION, projMatrix);
		gl.glGetFloatv(GL2.GL_MODELVIEW, modelMatrix);

		return null;
	}
}