fix slider not using same drag logic as character
This commit is contained in:
parent
ebb2cb8769
commit
70f54fefd5
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@ -1,4 +1,8 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "automatic",
|
||||
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx8G -Xms100m"
|
||||
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx32G -Xms100m",
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
"**/node_modules/**": true
|
||||
}
|
||||
}
|
||||
@ -3,13 +3,12 @@ layout (location = 0) in vec3 aPos;
|
||||
|
||||
uniform vec3 mPosition;
|
||||
uniform vec3 mDimension;
|
||||
uniform vec3 tPosition;
|
||||
uniform vec3 tDimension;
|
||||
|
||||
void main(){
|
||||
//0,0
|
||||
vec2 finalPos = vec2(
|
||||
((aPos.x + 1)/2 * mDimension.x + mPosition.x) * 2 - 1,
|
||||
-((((aPos.y + 1)/2) * mDimension.y + mPosition.y) * 2 - 1)
|
||||
((((aPos.y + 1)/2) * mDimension.y + mPosition.y) * 2 - 1)
|
||||
// aPos.y * mDimension.y + (mPosition.y) + (1 - mDimension.y)
|
||||
);
|
||||
gl_Position = vec4(finalPos.x, finalPos.y, 0.0, 1.0);
|
||||
|
||||
@ -5,7 +5,6 @@ package electrosphere.engine.assetmanager;
|
||||
* @author amaterasu
|
||||
*/
|
||||
public class AssetDataStrings {
|
||||
public static final String ASSET_STRING_BITMAP_FONT = "bitmapFont";
|
||||
public static final String ASSET_STRING_BITMAP_FONT_MESH_NAME = "quad";
|
||||
public static final String ASSET_STRING_SKYBOX_BASIC = "skyboxBasic";
|
||||
public static final String BITMAP_CHARACTER_MODEL = "bitmapCharacterModel";
|
||||
|
||||
@ -381,7 +381,6 @@ public class Globals {
|
||||
materialDefault.set_diffuse("Textures/default_diffuse.png");
|
||||
materialDefault.set_specular("Textures/default_specular.png");
|
||||
//create default lights
|
||||
assetManager.registerModelToSpecificString(RenderUtils.createBitmapDisplay(), AssetDataStrings.ASSET_STRING_BITMAP_FONT);
|
||||
assetManager.registerModelToSpecificString(RenderUtils.createBitmapCharacter(), AssetDataStrings.BITMAP_CHARACTER_MODEL);
|
||||
RawFontMap fontMap = FileUtils.loadObjectFromAssetPath("Textures/Fonts/myFont2Map.json", RawFontMap.class);
|
||||
FontUtils.setFontDataMap(fontMap);
|
||||
@ -413,7 +412,7 @@ public class Globals {
|
||||
assetManager.addModelPathToQueue("Models/unitplane.fbx");
|
||||
assetManager.addModelPathToQueue("Models/unitcube.fbx");
|
||||
imagePlaneModelID = assetManager.registerModel(RenderUtils.createPlaneModel("Shaders/plane/plane.vs", "Shaders/plane/plane.fs"));
|
||||
solidPlaneModelID = assetManager.registerModel(RenderUtils.createPlaneModel("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs"));
|
||||
solidPlaneModelID = assetManager.registerModel(RenderUtils.createInWindowPanel("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs"));
|
||||
|
||||
//image panel
|
||||
ImagePanel.imagePanelModelPath = assetManager.registerModel(RenderUtils.createPlaneModel("Shaders/font/bitmapchar/bitmapchar.vs", "Shaders/font/bitmapchar/bitmapchar.fs"));
|
||||
|
||||
@ -618,6 +618,7 @@ public class RenderUtils {
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public static Model createBitmapDisplay(){
|
||||
|
||||
Model rVal = new Model();
|
||||
@ -811,6 +812,93 @@ public class RenderUtils {
|
||||
|
||||
|
||||
|
||||
public static Model createInWindowPanel(String vertexShader, String fragmentShader){
|
||||
|
||||
Model rVal = new Model();
|
||||
rVal.meshes = new ArrayList<Mesh>();
|
||||
Mesh m = new Mesh();
|
||||
m.vertexArrayObject = glGenVertexArrays();
|
||||
glBindVertexArray(m.vertexArrayObject);
|
||||
//vertices
|
||||
FloatBuffer VertexArrayBufferData = BufferUtils.createFloatBuffer(12);
|
||||
VertexArrayBufferData.put(-1);
|
||||
VertexArrayBufferData.put( 1);
|
||||
|
||||
VertexArrayBufferData.put(-1);
|
||||
VertexArrayBufferData.put(-1);
|
||||
|
||||
VertexArrayBufferData.put( 1);
|
||||
VertexArrayBufferData.put(-1);
|
||||
|
||||
VertexArrayBufferData.put(-1);
|
||||
VertexArrayBufferData.put( 1);
|
||||
|
||||
VertexArrayBufferData.put( 1);
|
||||
VertexArrayBufferData.put(-1);
|
||||
|
||||
VertexArrayBufferData.put( 1);
|
||||
VertexArrayBufferData.put( 1);
|
||||
VertexArrayBufferData.flip();
|
||||
|
||||
|
||||
IntBuffer faceArrayBufferData = BufferUtils.createIntBuffer(6);
|
||||
faceArrayBufferData.put(0);
|
||||
faceArrayBufferData.put(1);
|
||||
faceArrayBufferData.put(2);
|
||||
|
||||
faceArrayBufferData.put(3);
|
||||
faceArrayBufferData.put(4);
|
||||
faceArrayBufferData.put(5);
|
||||
faceArrayBufferData.flip();
|
||||
|
||||
|
||||
|
||||
//texture coords
|
||||
FloatBuffer TextureArrayBufferData = BufferUtils.createFloatBuffer(12);
|
||||
TextureArrayBufferData.put(0);
|
||||
TextureArrayBufferData.put(1);
|
||||
|
||||
TextureArrayBufferData.put(0);
|
||||
TextureArrayBufferData.put(0);
|
||||
|
||||
TextureArrayBufferData.put(1);
|
||||
TextureArrayBufferData.put(0);
|
||||
|
||||
TextureArrayBufferData.put(0);
|
||||
TextureArrayBufferData.put(1);
|
||||
|
||||
TextureArrayBufferData.put(1);
|
||||
TextureArrayBufferData.put(0);
|
||||
|
||||
TextureArrayBufferData.put(1);
|
||||
TextureArrayBufferData.put(1);
|
||||
TextureArrayBufferData.flip();
|
||||
|
||||
|
||||
//buffer vertices
|
||||
m.buffer_vertices(VertexArrayBufferData, 2);
|
||||
//buffer normals
|
||||
m.buffer_normals(VertexArrayBufferData, 2);
|
||||
//buffer faces
|
||||
m.buffer_faces(faceArrayBufferData);
|
||||
//buffer texture coords
|
||||
m.buffer_texture_coords(TextureArrayBufferData, 2);
|
||||
|
||||
|
||||
m.shader = ShaderProgram.loadSpecificShader(vertexShader, fragmentShader);
|
||||
|
||||
|
||||
glBindVertexArray(0);
|
||||
m.parent = rVal;
|
||||
m.nodeID = "plane";
|
||||
|
||||
rVal.meshes.add(m);
|
||||
|
||||
return rVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static Model createTerrainModelPrecomputedShader(float[][] heightfield, float[][] texturemap, ShaderProgram program, int stride){
|
||||
Model rVal = new Model();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user