Editor: jMonkeyBuilder

When I bring up a model with an embedded controller the application crashes so even though you don’t support editing controls the models with attached controls will not load and will crash your editor without the classpath.

Oh, I have understood you. You can create the issue in my repository and I will implement supporting additional classpath :slight_smile:

1 Like

I added the issue.

Updated the first post.

ver. 0.7.0
-Implemented loading classes from every *.jars in opened asset folder.

2 Likes

Does that mean that I have to put all my jars in my asset folder?

@javasabr I wrote a utility class about 12 years ago that will allow you do add classpaths to the system class loader at run-time. You are free to use it. This way you can ask the user to give you a class path entry and you can add it to the system class loader.

/**

  • @author Zissis Trabaris
    */
    public class ClassLoaderUtils
    {
    private static final Class[] parameters = new Class[]
    { URL.class };

    public static void addFileToSystemClassLoader(String s) throws IOException
    {
    File f = new File(s);
    addFileToSystemClassLoader(f);
    }

    public static void addFileToSystemClassLoader(File f) throws IOException
    {
    addURLToSystemClassLoader(f.toURI().toURL());
    }

    public static void addURLToSystemClassLoader(URL u) throws IOException
    {
    URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader();
    Class sysclass = URLClassLoader.class;
    try
    {
    Method method = sysclass.getDeclaredMethod(“addURL”, parameters);
    method.setAccessible(true);
    method.invoke(sysloader, new Object[]
    { u });
    } catch (Throwable t)
    {
    t.printStackTrace();
    throw new IOException(“Error, could not add URL to system classloader”);
    }
    }
    }

4 Likes

You can create reference to folder with your jars in your asset folder . :slight_smile:

I think I can add UI for adding asset-independent jars to classpath.

Updated the first post.

ver. 0.7.1
-Implemented additional classpath folder in Settings → Other settings.
-Implemented autosynchronize asset folder with filesystem.

Is my last solution about additional classpath better for you? You can select an external folder with jars for extending classpath of editor.

Yes that works. Thank you

welcome :slight_smile:

have updated the first post.

ver. 0.7.2
-Updated the editor camera for working with large objects.

2 Likes

Hi, I just used this cool stuff. can you give me idea on how to change the camera perspective just like blender. e.g if we press ‘1’ show front view, on press ‘2’ show right view etc…

see the code block I tried in AbstractEditorState. Some how the EditorCamera class is not letting change translation and rotation of camera.
can you give me idea how can I make it working.

Class:- EditorCamera

	public static enum Perspective {
	FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM, USER
	}

	private Perspective perspective = Perspective.USER;

Class:- AbstractEditorState
Register keys

	...
	if (!inputManager.hasMapping(KEY_1)) {
		inputManager.addMapping(KEY_1, new KeyTrigger(KeyInput.KEY_1));
	}
	if (!inputManager.hasMapping(KEY_2)) {
		inputManager.addMapping(KEY_2, new KeyTrigger(KeyInput.KEY_2));
	}
	if (!inputManager.hasMapping(KEY_3)) {
		inputManager.addMapping(KEY_3, new KeyTrigger(KeyInput.KEY_3));
	}
	if (!inputManager.hasMapping(KEY_4)) {
		inputManager.addMapping(KEY_4, new KeyTrigger(KeyInput.KEY_4));
	}
	if (!inputManager.hasMapping(KEY_5)) {
		inputManager.addMapping(KEY_5, new KeyTrigger(KeyInput.KEY_5));
	}
	if (!inputManager.hasMapping(KEY_6)) {
		inputManager.addMapping(KEY_6, new KeyTrigger(KeyInput.KEY_6));
	}
	...
	inputManager.addListener(actionListener, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6);

onActionImpl

	...
	if (KEY_1.equals(name) && !getEditorCamera().isFrontPerspective()) {
		cam.setLocation(new Vector3f(0, 0, 100));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
		getEditorCamera().setPerspective(Perspective.FRONT);
		cam.update();
	} else if (KEY_2.equals(name) && !getEditorCamera().isBackPerspective()) 		{
		cam.setLocation(new Vector3f(0, 0, -100));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
		getEditorCamera().setPerspective(Perspective.BACK);
		cam.update();
	} else if (KEY_3.equals(name) && !getEditorCamera().isTopPerspective()) {
		cam.setLocation(new Vector3f(0, 100, 0));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Z.negate());
		getEditorCamera().setPerspective(Perspective.TOP);
		cam.update();
	} else if (KEY_4.equals(name) && 		!getEditorCamera().isBottomPerspective()) {
		cam.setLocation(new Vector3f(0, -100, 0));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Z);
		getEditorCamera().setPerspective(Perspective.BOTTOM);
        cam.update();
	} else if (KEY_5.equals(name) && !getEditorCamera().isLeftPerspective()) 		{
		cam.setLocation(new Vector3f(-100, 0, 0));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
		getEditorCamera().setPerspective(Perspective.LEFT);
		cam.update();
	} else if (KEY_6.equals(name) && 		!getEditorCamera().isRightPerspective()) {
        cam.setLocation(new Vector3f(100, 0, 0));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
		getEditorCamera().setPerspective(Perspective.RIGHT);
		cam.update();
	}

You can create an issue about this on my repository, then I will implement this :slight_smile:
or… do you want to implement this yourself?

I want to implement this… If you want I can create issue on repository.

just I’m going to update this editor, so I can implement your enhancement :slight_smile:

This will be gr8…

Just created issue in your repository with title
‘Change the perspective on key press like blender’.

ok :slight_smile: