本文整理匯總了Java中com.badlogic.gdx.math.Vector3.prj方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector3.prj方法的具體用法?Java Vector3.prj怎麽用?Java Vector3.prj使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.math.Vector3
的用法示例。
在下文中一共展示了Vector3.prj方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPositionOnMap
import com.badlogic.gdx.math.Vector3; //導入方法依賴的package包/類
@Override
public Vector2 getPositionOnMap(Vector2 position) {
Vector3 vec = new Vector3(position.x, position.y, 0);
position.y = Gdx.graphics.getHeight() - position.y - 1;
vec.x = (2 * position.x) / Gdx.graphics.getWidth() - 1;
vec.y = (2 * position.y) / Gdx.graphics.getHeight() - 1;
vec.z = 2 * vec.z - 1;
vec.prj(camera.invProjectionView);
position.x = vec.x;
position.y = vec.y;
return position;
}
示例2: getPositionOnWorld
import com.badlogic.gdx.math.Vector3; //導入方法依賴的package包/類
@Override
public Vector2 getPositionOnWorld(float x, float y) {
Vector3 vec = new Vector3(x, y, 0);
y = Gdx.graphics.getHeight() - y - 1;
vec.x = (2 * x) / Gdx.graphics.getWidth() - 1;
vec.y = (2 * y) / Gdx.graphics.getHeight() - 1;
vec.z = 2 * vec.z - 1;
vec.prj(camera.invProjectionView);
return new Vector2(vec.x, vec.y);
}
示例3: positionFromWorldUsingGameViewport
import com.badlogic.gdx.math.Vector3; //導入方法依賴的package包/類
@Override
public Vector2 positionFromWorldUsingGameViewport(float x, float y) {
Vector3 vec = new Vector3(x, y, 0);
x = x - Game.viewportX;
y = Gdx.graphics.getHeight() - y - 1;
y = y - Game.viewportY;
vec.x = (2 * x) / Game.viewportWidth - 1;
vec.y = (2 * y) / Game.viewportHeight - 1;
vec.z = 2 * vec.z - 1;
vec.prj(camera.invProjectionView);
return new Vector2(vec.x, vec.y);
}