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


Java Vector3d.negate方法代碼示例

本文整理匯總了Java中javax.vecmath.Vector3d.negate方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector3d.negate方法的具體用法?Java Vector3d.negate怎麽用?Java Vector3d.negate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.vecmath.Vector3d的用法示例。


在下文中一共展示了Vector3d.negate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBiggerVelocity

import javax.vecmath.Vector3d; //導入方法依賴的package包/類
private Vector3d getBiggerVelocity(Vector3d velocity, double scale, boolean negate, RefBoolean wantsToGoFaster) {
    Vector3d result = new Vector3d(velocity.x, velocity.y, velocity.z);
    if (negate) {
        result.negate();
        wantsToGoFaster.setValue(false);
    }
    result.scale(scale);
    return result;
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:10,代碼來源:PeopleAvoidanceSteer.java

示例2: tube

import javax.vecmath.Vector3d; //導入方法依賴的package包/類
public static void tube (MeshBuilder out, 
			Collection<LinearForm3D> before, Collection<LinearForm3D> after, 
			Line3d line, LinearForm3D left, LinearForm3D right, CrossGen gen ) {
		
		if (angle ( before, line) < 0.1 || angle ( after, line ) < 0.1 )
			return; // too pointy to touch
		
		Point3d middle = line.fromPPram( 0.5 );
		
		Vector3d along = line.dir();
		along.normalize();
		Vector3d nAlong = new Vector3d (along);
		nAlong.negate();
		
		Vector3d o1 = left.normal(), u1 = new Vector3d();
		u1.cross( along, o1 );
		
		Frame frame = Mathz.buildFrame ( o1, u1, along, middle);
		
		Vector3d u2 = right.normal();
		u2.cross( u2, along );
//		u2.add( middle );
		
		Vector2d leftDir = Mathz.toXY ( frame, u1 );
		Vector2d rightDir = Mathz.toXY ( frame, u2 );
		
		List<Point3d> profilePts = gen.gen( leftDir, rightDir ).stream().
				map( p -> Mathz.fromXY( frame, p ) ).collect( Collectors.toList() );
		
		List<LinearForm3D> dummy = new ArrayList<>();
		
		for (Pair <Point3d, Point3d> pair : new ConsecutivePairs<Point3d>( profilePts, true ) ) {
			
			Point3d 
					f1 = clip ( pair.first (), along , after , dummy ),
					f2 = clip ( pair.second(), along , after , dummy ),
					b1 = clip ( pair.first (), nAlong, before, dummy ),
					b2 = clip ( pair.second(), nAlong, before, dummy );

			out.add (f2, f1, b1, b2);
		}
		
//		cap( out, after ,  along, profilePts, true  );
//		cap( out, before, nAlong, profilePts, false );
	}
 
開發者ID:twak,項目名稱:chordatlas,代碼行數:46,代碼來源:Tube.java


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