當前位置: 首頁>>代碼示例>>Java>>正文


Java Vector3.prj方法代碼示例

本文整理匯總了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;
   }
 
開發者ID:game-libgdx-unity,項目名稱:GDX-Engine,代碼行數:15,代碼來源:GameService.java

示例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);
   }
 
開發者ID:game-libgdx-unity,項目名稱:GDX-Engine,代碼行數:12,代碼來源:GameService.java

示例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);
   }
 
開發者ID:game-libgdx-unity,項目名稱:GDX-Engine,代碼行數:14,代碼來源:GameService.java


注:本文中的com.badlogic.gdx.math.Vector3.prj方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。