private SEVector3f worldLocationToDesk(SEVector3f worldLocation) { float r = worldLocation.getVectorZ().getLength(); float postitionAngle = (float) (worldLocation.getVectorZ().getAngle_II() * 180 / Math.PI); float preAngle = mWallShelf.getUserRotate().getAngle(); float angle = postitionAngle - preAngle; float x = (float) (-r * Math.sin(angle * Math.PI / 180)); float y = (float) (r * Math.cos(angle * Math.PI / 180)); SEVector3f deskLocation = new SEVector3f(x, y, worldLocation.getZ()); return deskLocation; }
private void setMovePoint(int touchX, int touchY) { House house = (House) mWallShelf.getParent(); SEVector3f location = house.getFingerLocation(touchX, touchY); float radius = house.getWallRadius() * 0.8f; // SERay Ray = getScene().getCamera().screenCoordinateToRay(touchX, touchY); mRealLocation = location; // getTouchLocation(Ray, mWallShelf.getBorderHeight()); // SEVector3f touchLocation = getTouchLocation(Ray, mWallShelf.getBorderHeight() + 5); mObjectTransParas = new SETransParas(); mObjectTransParas.mTranslate = new SEVector3f(location.getX(), location.getY() - 60, location.getZ()); mObjectTransParas.mRotate.set(mWallShelf.getUserRotate().getAngle(), 0, 0, 1); }