java.lang.NoClassDefFoundError error need help
in
Android Processing
•
2 years ago
i am trying to implement peasycam into my sketch and i don't know why.
i have a simple implementation of PeasyCam as seen below:
import peasy.org.apache.commons.math.*;
import peasy.*;
import peasy.org.apache.commons.math.geometry.*;
- FATAL EXCEPTION: GLThread 10
- java.lang.NoClassDefFoundError: peasy.PeasyCam$PeasyMousewheelListener
- at peasy.PeasyCam.<init>(Unknown Source)
- at peasy.PeasyCam.<init>(Unknown Source)
- at processing.android.test.atomos.Atomos.setup(Atomos.java:31)
- at processing.core.PApplet.handleDraw(PApplet.java:1783)
- at processing.core.PGraphicsAndroid3D$A3DRenderer.onDrawFrame(PGraphicsAndroid3D.java:7358)
- at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
- at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
i have a simple implementation of PeasyCam as seen below:
import peasy.org.apache.commons.math.*;
import peasy.*;
import peasy.org.apache.commons.math.geometry.*;
- PeasyCam cam;
- void setup() {
- cam = new PeasyCam(this, 200);
- cam.setMinimumDistance(-500);
- cam.setMaximumDistance(500);
- }
- void draw() {
- smooth();
- background(255);
- }
- public boolean surfaceTouchEvent(MotionEvent event) {
- float initialDist = 0;
- float currentDist = 0;
- switch(event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- initialDist = dist(event.getX(0), event.getY(0), event.getX(1), event.getY(1));
- break;
- case MotionEvent.ACTION_MOVE:
- currentDist = calculateZoom(event);
- cam.setDistance(cam.getDistance()*(currentDist/initialDist));
- break;
- case MotionEvent.ACTION_UP:
- break;
- default:
- break;
- }
- return super.surfaceTouchEvent(event);
- }
- public float calculateZoom(MotionEvent event){
- float zoom = 1;
- if(event.getPointerCount() == 2){
- zoom = dist(event.getX(0), event.getY(0), event.getX(1), event.getY(1));
- }
- return zoom;
- }
any help would be greatly appreciated.
1