If you think the Android project geoar-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
* Copyright 2012 52North Initiative for Geospatial Open Source Software GmbH
*//www.java2s.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/package org.n52.geoar.view.geoar.gl.mode;
import org.n52.geoar.ar.view.gl.GLESCamera;
publicabstractclass Spatial {
protecteddouble longitude;
protecteddouble latitude;
@Deprecated
protecteddouble altitude;
protectedfinalfloat[] position = newfloat[]{0.0f, -1.6f, 0.0f, 1.0f};
protectedfinalfloat[] rotation = newfloat[]{0.0f, 0.0f, 0.0f, 1.0f};
protectedfinalfloat[] scale = newfloat[]{1.0f, 1.0f, 1.0f};
public Spatial() {
float[] cameraPosition = GLESCamera.cameraPosition;
position[0] = -cameraPosition[0];
position[1] = -cameraPosition[1];
position[2] = -cameraPosition[2];
position[3] = 1;
}
publicfloat[] getPosition() {
return position;
}
publicvoid setRelativePosition(float[] position) {
this.position[0] = position[0]; // - GLESCamera.cameraPosition[0];
this.position[1] = position[1] - GLESCamera.cameraPosition[1];
this.position[2] = position[2]; // - GLESCamera.cameraPosition[2];
}
publicfloat getMinimumYCoordinate(){
return 0;
}
publicfloat getX() {
return position[0];
}
publicfloat getY() {
return position[1];
}
publicfloat getZ() {
return position[2];
}
publicvoid setX(float x) {
position[0] = x;
}
publicvoid setY(float y) {
position[1] = y;
}
publicvoid setZ(float z) {
position[2] = z;
}
publicvoid setScale(float scaleX, float scaleY, float scaleZ) {
scale[0] = scaleX;
scale[1] = scaleY;
scale[2] = scaleZ;
}
publicfloat[] getScale() {
return scale;
}
/**
* @return the longitude
*/publicdouble getLongitude() {
return longitude;
}
/**
* @param longitude
* the longitude to set
*/publicvoid setLongitude(double longitude) {
this.longitude = longitude;
}
/**
* @return the latitude
*/publicdouble getLatitude() {
return latitude;
}
/**
* @param latitude
* the latitude to set
*/publicvoid setLatitude(double latitude) {
this.latitude = latitude;
}
/**
* @return the altitude
*/publicdouble getAltitude() {
return altitude;
}
/**
* @param altitude
* the altitude to set
*/publicvoid setAltitude(double altitude) {
this.altitude = altitude;
}
}