本文整理汇总了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;
}
示例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 );
}