com.supermap.ar.areffect.utils
类 ScreenPointTool
- java.lang.Object
-
- com.supermap.ar.areffect.utils.ScreenPointTool
-
public class ScreenPointTool extends java.lang.Object屏幕坐标转换工具 AR坐标 => 屏幕坐标
-
-
构造器概要
构造器 构造器和说明 ScreenPointTool()
-
方法概要
所有方法 静态方法 具体方法 限定符和类型 方法和说明 static <any>convertToPixel(EffectView effectView, java.util.List<Point3D> point3DList)将AR场景坐标集转为屏幕像素坐标static <any>convertToPixel(EffectView effectView, java.util.List<Point3D> point3DList, boolean isModify)将AR场景坐标集转为屏幕像素坐标static int[]convertToScreenPoint(AREffectView arView, Point3D point3D)将场景中的点转为Z值为0的屏幕坐标static int[]convertToScreenPoint(AREffectView arView, Vector3 vector3)将场景中的点转为Z值为0的屏幕坐标 注:坐标原点为屏幕中心static Point2DconvertToScreenPoint2D(AREffectView arView, Point3D point3D)将场景中的点转为Z值为0的屏幕坐标static int[][]generateBounds(AREffectView arView, java.util.List<Vector3> arVertexGroup)将AR中的顶点组转换为屏幕坐标中的最大矩形的顶点 (bounds[0][0],bounds[0][1])----------------- | | | | -----------------(bounds[1][0],bounds[1][1])static floatgetDpScale(android.content.Context context)获取dp值与真实尺度的比例static floatgetScreenDensity(AREffectBaseView arEffectView)获取屏幕密度static intgetScreenDensityDPI(android.content.Context context)获取屏幕dpistatic floatgetScreenHeight_DP(EffectBaseView arEffectView)获取屏幕高度 单位:dpstatic intgetScreenHeightPixel(android.content.Context context)获取手机屏幕高度static floatgetScreenWidth_DP(EffectBaseView arEffectView)获取屏幕宽度 单位:dpstatic intgetScreenWidthPixel(android.content.Context context)获取手机屏幕宽度static RayscreenPointToRay(EffectBaseView arEffectView, int x, int y)屏幕坐标转射线
-
-
-
方法详细资料
-
convertToScreenPoint
public static int[] convertToScreenPoint(AREffectView arView, Point3D point3D)
将场景中的点转为Z值为0的屏幕坐标- 参数:
point3D-- 返回:
-
convertToScreenPoint2D
public static Point2D convertToScreenPoint2D(AREffectView arView, Point3D point3D)
将场景中的点转为Z值为0的屏幕坐标- 参数:
arView-point3D-- 返回:
-
convertToScreenPoint
public static int[] convertToScreenPoint(AREffectView arView, Vector3 vector3)
将场景中的点转为Z值为0的屏幕坐标 注:坐标原点为屏幕中心- 参数:
arView-vector3-- 返回:
-
generateBounds
public static int[][] generateBounds(AREffectView arView, java.util.List<Vector3> arVertexGroup)
将AR中的顶点组转换为屏幕坐标中的最大矩形的顶点(bounds[0][0],bounds[0][1])-----------------
| |
| |
-----------------(bounds[1][0],bounds[1][1])
- 参数:
arView-arVertexGroup-- 返回:
-
getScreenDensity
public static float getScreenDensity(AREffectBaseView arEffectView)
获取屏幕密度- 参数:
arEffectView-- 返回:
-
getDpScale
public static float getDpScale(android.content.Context context)
获取dp值与真实尺度的比例- 参数:
context-- 返回:
- AR场景中1米在布局文件中对应多少dp值
-
getScreenWidth_DP
public static float getScreenWidth_DP(EffectBaseView arEffectView)
获取屏幕宽度 单位:dp- 参数:
arEffectView-- 返回:
-
getScreenHeight_DP
public static float getScreenHeight_DP(EffectBaseView arEffectView)
获取屏幕高度 单位:dp- 参数:
arEffectView-- 返回:
-
screenPointToRay
public static Ray screenPointToRay(EffectBaseView arEffectView, int x, int y)屏幕坐标转射线- 参数:
arEffectView-x-y-- 返回:
-
convertToPixel
public static <any> convertToPixel(EffectView effectView, java.util.List<Point3D> point3DList)将AR场景坐标集转为屏幕像素坐标- 参数:
effectView-point3DList-- 返回:
- 屏幕坐标集
-
getScreenHeightPixel
public static int getScreenHeightPixel(android.content.Context context)
获取手机屏幕高度- 参数:
context- 上下文- 返回:
- 高度,单位:像素
-
getScreenWidthPixel
public static int getScreenWidthPixel(android.content.Context context)
获取手机屏幕宽度- 参数:
context- 上下文- 返回:
- 宽度,单位:像素
-
convertToPixel
public static <any> convertToPixel(EffectView effectView, java.util.List<Point3D> point3DList, boolean isModify)将AR场景坐标集转为屏幕像素坐标- 参数:
effectView- arViewpoint3DList- 待转换的3D点集isModify- 是否保持位置镜像- 返回:
- 屏幕坐标集
-
getScreenDensityDPI
public static int getScreenDensityDPI(android.content.Context context)
获取屏幕dpi- 参数:
context-- 返回:
-
-