-
-
Notifications
You must be signed in to change notification settings - Fork 440
Expand file tree
/
Copy pathTestInteractor.java
More file actions
76 lines (59 loc) · 2.37 KB
/
Copy pathTestInteractor.java
File metadata and controls
76 lines (59 loc) · 2.37 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import app.f3d.F3D.*;
public class TestInteractor {
// On Windows, try to load opengl32 from Java path
// It's only useful in order to force Mesa software OpenGL
static {
if (System.getProperty("os.name").startsWith("Windows"))
{
try {
System.loadLibrary("opengl32");
} catch (UnsatisfiedLinkError e) {
// Ignore if opengl32 is not available
}
}
}
public static void main(String[] args) {
Engine.autoloadPlugins();
Engine engine = Engine.create(true);
Interactor interactor = engine.getInteractor();
interactor.addCommand("test::hello", cmdArgs -> {
System.out.println("Hello command called with " + cmdArgs.size() + " args");
});
interactor.getCommandActions();
interactor.removeCommand("test::hello");
Interactor.InteractionBind bind = new Interactor.InteractionBind();
bind.mod = Interactor.ModifierKeys.CTRL;
bind.inter = "A";
bind.format();
Interactor.InteractionBind parsed = Interactor.InteractionBind.parse("Ctrl+A");
Interactor.InteractionBind parsed2 = Interactor.InteractionBind.parse("Shift+B");
Interactor.InteractionBind parsed3 = Interactor.InteractionBind.parse("C");
bind.equals(parsed);
parsed.compareTo(parsed2);
parsed2.hashCode();
interactor.toggleAnimation();
interactor.toggleAnimation(Interactor.AnimationDirection.FORWARD);
interactor.toggleAnimation(Interactor.AnimationDirection.BACKWARD);
interactor.startAnimation();
interactor.startAnimation(Interactor.AnimationDirection.FORWARD);
interactor.startAnimation(Interactor.AnimationDirection.BACKWARD);
interactor.stopAnimation();
interactor.isPlayingAnimation();
interactor.getAnimationDirection();
interactor.setNotificationCallback((desc, value, bindStr, duration) -> {
System.out.println("Notification: " + desc + " " + value + " " + bindStr + " " + duration);
return true;
});
interactor.triggerNotification("foo", "bar", 3.0);
Interactor.AnimationDirection.FORWARD.getValue();
Interactor.AnimationDirection.BACKWARD.getValue();
Interactor.AnimationDirection.fromValue(0);
Interactor.AnimationDirection.fromValue(1);
interactor.enableCameraMovement();
interactor.disableCameraMovement();
interactor.requestRender();
interactor.toggleAnimation()
.enableCameraMovement();
engine.close();
}
}