1
German corner / Re: JPCT-AE: Möglichst genaue Kollision
« on: October 28, 2011, 10:20:04 am »
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
In the onSurfaceCreated() method I create all my objects and world and stuff. This are already around 300 lines and it is very unclear.If you have a lot of similar stuff to to, you could write yourself some helper functions or classes to get that better done. Example: If you need to load a lot of different 3D-Models, Gameobjects with additional information (like Cars or Gameitems) than write some Managers for thoose, so that you only have to write the name of that object and the Manager is doing the rest.
cam.setPosition(0,50,0);
cam.setOrientation(new SimpleVector(0,-1f,0), new SimpleVector(0,0,1f));
SimpleVector up = new SimpleVector(0,-1f,0);Also auf der x-z Ebene was die Richtung angeht, und die Oberseite des Modells zur Kamera hin gerichtet.
direction.x = (event.getY()-(h/2));
direction.z = -(event.getX()-(w/2));
ship.setOrientation(direction,new SimpleVector(0,1f,0));
setRotation(Matrix m ): it didn't work cause of some strange rendering of the box, after the rotation it came out streched and only half visible
direction.x = (event.getX()-(w/2));
direction.z = -(event.getY()-(h/2));
cam = world.getCamera();
cam.setPosition(0,-50,0);
cam.lookAt(ship.getTransformedCenter());
SimpleVector up = new SimpleVector(0,-1f,0);
direction.x = (event.getX()-(w/2));
direction.z = -(event.getY()-(h/2));
ship.setOrientation(direction, up);