当前位置: 首页>>代码示例>>Java>>正文


Java Loopz.inside方法代码示例

本文整理汇总了Java中org.twak.utils.collections.Loopz.inside方法的典型用法代码示例。如果您正苦于以下问题:Java Loopz.inside方法的具体用法?Java Loopz.inside怎么用?Java Loopz.inside使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.twak.utils.collections.Loopz的用法示例。


在下文中一共展示了Loopz.inside方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: meanModeHeightColor

import org.twak.utils.collections.Loopz; //导入方法依赖的package包/类
public static void meanModeHeightColor( Loop<Point2d> pts, SuperFace sf, BlockGen blockgen ) {
		
		double[] minMax = Loopz.minMax2d( pts );

		double sample = 2;

		double missCost = 30;
		
		if (sf.colors != null)
			sf.colors.clear();
		
		sf.heights.clear();
		
		int insideGIS = 0, outsideGIS = 0;

		LoopL<Point2d> gis = blockgen.profileGen.gis;
		gis = Loopz.removeInnerEdges( gis );
		gis = Loopz.removeNegativeArea( gis, -1 );
		gis = Loopz.mergeAdjacentEdges( gis, 1, 0.05 );
		
		for ( double x = minMax[ 0 ]; x < minMax[ 1 ]; x += sample )
			for ( double y = minMax[ 2 ]; y < minMax[ 3 ]; y += sample ) {
				
				Point2d p2d = new Point2d( x, y );
				
				if ( Loopz.inside( p2d, pts ) ) {

						CollisionResults results = new CollisionResults();
						blockgen.gNode.collideWith( new Ray( Jme3z.toJmeV( x, 0, y ), UP ), results );
						CollisionResult cr = results.getFarthestCollision();

						double height;

						if ( cr != null ) {

							height = cr.getDistance();
							sf.heights.add( height );
							
							if ( sf != null && sf.colors != null ) {
								ColorRGBA col = getColor( cr.getGeometry(), cr.getContactPoint(), cr.getTriangleIndex(), blockgen.tweed );
								sf.colors.add( new float[] { col.r, col.g, col.b } );
							}
						}
						
						
					if ( Loopz.inside( p2d, gis ) ) { 
						insideGIS ++;
//						PaintThing.debug( Color.yellow, 1, p2d);
					}
					else {
						outsideGIS ++;
//						PaintThing.debug( Color.green, 1, p2d);
					}
				}
			}
		

		if ( sf.heights.size() < 2 )
			sf.height = -Double.MAX_VALUE;
		else if ( TweedSettings.settings.useGis &&  insideGIS  <  gisInterior * outsideGIS )
			sf.height = -missCost;
		else {
			sf.updateHeight();
		}
		
		sf.maxProfHeights = new ArrayList();
		
		for (HalfEdge e : sf) {
			SuperEdge se = ((SuperEdge) e);
			if ( se.profLine!= null ) 
				for (Prof p : ((SuperLine)se.profLine).getMega().getTween( e.start, e.end, 0.3) )
					sf.maxProfHeights.add( p.get( p.size()-1 ).y );
		}
	}
 
开发者ID:twak,项目名称:chordatlas,代码行数:75,代码来源:SkelFootprint.java

示例2: distance

import org.twak.utils.collections.Loopz; //导入方法依赖的package包/类
protected double distance( LoopL<Point2d> gis2, Point2d start ) {

		double out = Double.MAX_VALUE;
		
		for (Loop<Point2d> p : gis2) {
			
			if (Loopz.inside( start, p ))
				return 0;
			
			for (Loopable<Point2d> ll : p.loopableIterator() ) 
				out = Math.min (out, new Line (ll.get(), ll.getNext().get()).distance( start ));
		}
		
		return out;
	}
 
开发者ID:twak,项目名称:chordatlas,代码行数:16,代码来源:ProfileGen.java

示例3: project

import org.twak.utils.collections.Loopz; //导入方法依赖的package包/类
public boolean project (Matrix4d to2d, Matrix4d to3d, Loop<? extends Point2d> facade, LinearForm3D facePlane, Vector3d perp ) {

			boolean allInside = true;
			
			for (int i = 0; i < 4; i++) {
				
//				Point3d proj = new Point3d(corners[i]);
				
				Point3d sec = facePlane.collide( corners[i], perp );
				
				if (sec != null) {
				
				to2d.transform( sec );
				
				boolean inside = Loopz.inside( new Point2d (sec.x, sec.z), facade );
				
				allInside &= inside;
				
				if ( inside ) {
					sec.y = 0;
					to3d.transform( sec );
					found[i] = sec;
				}
				}
			}
			
			return allInside;
		}
 
开发者ID:twak,项目名称:chordatlas,代码行数:29,代码来源:Greeble.java


注:本文中的org.twak.utils.collections.Loopz.inside方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。