• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Plane类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.badlogic.gdx.math.Plane的典型用法代码示例。如果您正苦于以下问题:Java Plane类的具体用法?Java Plane怎么用?Java Plane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Plane类属于com.badlogic.gdx.math包,在下文中一共展示了Plane类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: LightGrid

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
public LightGrid(int x, int y) {
    planePoints = new Vector3[8];
    for (int i = 0; i < 8; i++) {
        planePoints[i] = new Vector3();
    }
    sizex = x;
    sizey = y;
    verticalPlanes = new Plane[2][10];
    horizontalPlanes = new Plane[2][10];
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 2; j++) {
            verticalPlanes[j][i] = new Plane(new Vector3(), 0);
            horizontalPlanes[j][i] = new Plane(new Vector3(), 0);
        }
    }
    nearBotLeft = new Vector3();
    nearBotRight = new Vector3();
    nearTopRight = new Vector3();
    nearTopLeft = new Vector3();
    farBotLeft = new Vector3();
    farBotRight = new Vector3();
    farTopRight = new Vector3();
    farTopLeft = new Vector3();
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:25,代码来源:LightGrid.java


示例2: checkObject

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
@Override
public boolean checkObject(OctreeObject object) {
  object.getBoundingBox(tempBox);
  for (int i = 0, len2 = frustum.planes.length; i < len2; i++) {
    if (frustum.planes[i].testPoint(tempBox.getCorner000(tmpV)) != Plane.PlaneSide.Back) continue;
    if (frustum.planes[i].testPoint(tempBox.getCorner001(tmpV)) != Plane.PlaneSide.Back) continue;
    if (frustum.planes[i].testPoint(tempBox.getCorner010(tmpV)) != Plane.PlaneSide.Back) continue;
    if (frustum.planes[i].testPoint(tempBox.getCorner011(tmpV)) != Plane.PlaneSide.Back) continue;
    if (frustum.planes[i].testPoint(tempBox.getCorner100(tmpV)) != Plane.PlaneSide.Back) continue;
    if (frustum.planes[i].testPoint(tempBox.getCorner101(tmpV)) != Plane.PlaneSide.Back) continue;
    if (frustum.planes[i].testPoint(tempBox.getCorner110(tmpV)) != Plane.PlaneSide.Back) continue;
    if (frustum.planes[i].testPoint(tempBox.getCorner111(tmpV)) != Plane.PlaneSide.Back) continue;
    return false;
  }

  return true;
}
 
开发者ID:macbury,项目名称:ForgE,代码行数:18,代码来源:FrustrumOctreeQuery.java


示例3: write

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
@Override
public void write(Kryo kryo, Output output, Plane plane) {
    Vector3 normal = plane.normal;
    output.writeFloat(normal.x);
    output.writeFloat(normal.y);
    output.writeFloat(normal.z);
    output.writeFloat(plane.d);
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:9,代码来源:PlaneSerializer.java


示例4: read

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
@Override
public Plane read(Kryo kryo, Input input, Class<Plane> type) {
    Plane plane = new Plane();
    Vector3 normal = plane.normal;
    normal.x = input.readFloat();
    normal.y = input.readFloat();
    normal.z = input.readFloat();
    plane.d = input.readFloat();
    return plane;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:11,代码来源:PlaneSerializer.java


示例5: DebugFrustrum

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
public DebugFrustrum(Frustum copy, Matrix4 invProjectionView) {
  super();
  for (int i = 0; i < copy.planes.length; i++) {
    planes[i] = new Plane(copy.planes[i].getNormal(), copy.planes[i].getD());
  }

  for (int i = 0; i < copy.planePoints.length; i++) {
    planePoints[i] = new Vector3(copy.planePoints[i].x, copy.planePoints[i].y, copy.planePoints[i].z);
  }

  update(invProjectionView);
}
 
开发者ID:macbury,项目名称:ForgE,代码行数:13,代码来源:DebugFrustrum.java


示例6: test

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
public static boolean test(Sphere sphere, Plane plane) {
	float distance = sphere.center.dot(plane.normal) - plane.d;
	if (Math.abs(distance) <= sphere.radius)
		return true;
	else
		return false;
}
 
开发者ID:gered,项目名称:gdx-toolbox,代码行数:8,代码来源:IntersectionTester.java


示例7: sideLeftPlane

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
public Plane.PlaneSide sideLeftPlane(Vector3 point) {
	return leftPlane.testPoint(point);
}
 
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:4,代码来源:NavMeshPointPath.java


示例8: sideRightPlane

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
public Plane.PlaneSide sideRightPlane(Vector3 point) {
	return rightPlane.testPoint(point);
}
 
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:4,代码来源:NavMeshPointPath.java


示例9: calculateEdgePoints

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
/**
 * Calculate the shortest point path through the path triangles, using the Simple Stupid Funnel Algorithm.
 *
 * @return
 */
private void calculateEdgePoints() {
	Edge edge = getEdge(0);
	addPoint(start, edge.fromNode);
	lastPointAdded.fromNode = edge.fromNode;

	Funnel funnel = new Funnel();
	funnel.pivot.set(start);
	funnel.setPlanes(funnel.pivot, edge);

	int leftIndex = 0;
	int rightIndex = 0;
	int lastRestart = 0;

	for (int i = 1; i < numEdges(); ++i) {
		edge = getEdge(i);

		Plane.PlaneSide leftPlaneLeftDP = funnel.sideLeftPlane(edge.leftVertex);
		Plane.PlaneSide leftPlaneRightDP = funnel.sideLeftPlane(edge.rightVertex);
		Plane.PlaneSide rightPlaneLeftDP = funnel.sideRightPlane(edge.leftVertex);
		Plane.PlaneSide rightPlaneRightDP = funnel.sideRightPlane(edge.rightVertex);

		if (rightPlaneRightDP != Plane.PlaneSide.Front) {
			if (leftPlaneRightDP != Plane.PlaneSide.Front) {
				// Tighten the funnel.
				funnel.setRightPlane(funnel.pivot, edge.rightVertex);
				rightIndex = i;
			} else {
				// Right over left, insert left to path and restart scan from portal left point.
				calculateEdgeCrossings(lastRestart, leftIndex, funnel.pivot, funnel.leftPortal);
				funnel.pivot.set(funnel.leftPortal);
				i = leftIndex;
				rightIndex = i;
				if (i < numEdges() - 1) {
					lastRestart = i;
					funnel.setPlanes(funnel.pivot, getEdge(i + 1));
					continue;
				}
				break;
			}
		}
		if (leftPlaneLeftDP != Plane.PlaneSide.Front) {
			if (rightPlaneLeftDP != Plane.PlaneSide.Front) {
				// Tighten the funnel.
				funnel.setLeftPlane(funnel.pivot, edge.leftVertex);
				leftIndex = i;
			} else {
				// Left over right, insert right to path and restart scan from portal right point.
				calculateEdgeCrossings(lastRestart, rightIndex, funnel.pivot, funnel.rightPortal);
				funnel.pivot.set(funnel.rightPortal);
				i = rightIndex;
				leftIndex = i;
				if (i < numEdges() - 1) {
					lastRestart = i;
					funnel.setPlanes(funnel.pivot, getEdge(i + 1));
					continue;
				}
				break;
			}
		}
	}
	calculateEdgeCrossings(lastRestart, numEdges() - 1, funnel.pivot, end);

	for (int i = 1; i < pathPoints.size; i++) {
		EdgePoint p = pathPoints.get(i);
		p.fromNode = pathPoints.get(i - 1).toNode;
	}
	return;
}
 
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:74,代码来源:NavMeshPointPath.java


示例10: Stage3D

import com.badlogic.gdx.math.Plane; //导入依赖的package包/类
public Stage3D() {
	super();
	this.plane = new Plane(new Vector3(0, 0, 1), Vector3.Zero);
}
 
开发者ID:nooone,项目名称:gdx-vr,代码行数:5,代码来源:Stage3D.java



注:本文中的com.badlogic.gdx.math.Plane类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ReplicationException类代码示例发布时间:2022-05-23
下一篇:
Java JavaSysMon类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap