2D collision detection

Sorry, I just saw gradlew.bat inside the folder. I got confused because I don’t really know what gradle is/does. Il read up on it thanks.

1 Like

I get an error when building, what is tools.jar?

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.

Could not find tools.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 12.584 secs

It means that you don’t have a JDK properly installed with the java_home environment variable set, etc…

BUILD SUCCESSFUL :smile:

Should be getting a pull request soon if I make it work :thumbsup:

Hey Paul, I got it working properly. Android does not support 1.8 yet.

I replaced the UP and DOWN with TAP and it works great, no more double event.

I added a pull request in Lemur.

Thanks for helping, I am glad that I got more familiar with Gradle and Git.

Can you post your code? :sweat_smile:

Lemur/src/main/java/com/simsilica/lemur/event/TouchAppState.java

protected class TouchObserver extends DefaultRawInputListener {

    @Override
    public void onTouchEvent(TouchEvent te) {
        if (!isEnabled()) {
            return;
        }
        PointerData pointerData;
        switch (te.getType()) {
            case TAP:
                pointerData = pointerDataMap.get(te.getPointerId());
                if (pointerData != null) {
                    pointerData.lastX = (int)te.getX();
                    pointerData.lastY = (int)te.getY();
                    if (dispatchButton(pointerData, false)) {
                        te.setConsumed();
                    }
                    pointerDataMap.remove(te.getPointerId());
                }
                break;
            case MOVE:
                pointerData = pointerDataMap.get(te.getPointerId());
                if (pointerData != null) {
                    pointerData.lastX = (int)te.getX();
                    pointerData.lastY = (int)te.getY();
                }
                break;
            default:
                break;
        }
    }
}

I think we still need UP and DOWN for dragging don’t we?

:rolling_eyes:

Ok, I will help you make as much of it work as possible. I already tried adding property panels but one of the dependencies won’t pre-dex on Android, il get back to you on which one it is.

Adding me as a collaborator would help, this way I can push branches and commits directly from JME3.

For the dragging, I need to make the up & down work but only for dragging and sliding for now. I think the touch listener needs additional input parameters depending on what it is being used for. Il have to detect what kind of object the event is being sent to and use that to decide weather to use Up, Down or Tap. There are plenty of other types, if I find any that could be usefull for other Lemur object il let you know. The zoom type for example could be used to scale containers and stuff.

Il find a solution.

Cheers

Really, even for tap you should be sending a down and an up. I thought the real issue was distinguishing tap from down + up on the input side. I assumed this was why you were getting click called twice.

Lemur only catches a few events for a reason. Apps are always free to add their own RawInputListener and do their own processing for more complicated stuff.

P.S.: Glad you got your build working. :slight_smile: