本文整理汇总了Java中com.jme3.math.Vector3f.length方法的典型用法代码示例。如果您正苦于以下问题:Java Vector3f.length方法的具体用法?Java Vector3f.length怎么用?Java Vector3f.length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.math.Vector3f
的用法示例。
在下文中一共展示了Vector3f.length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildFrame
import com.jme3.math.Vector3f; //导入方法依赖的package包/类
private Matrix4d buildFrame( Vector3f[] locs ) {
Vector3f dir0 = new Vector3f(locs[1]);
dir0 = dir0.subtract(locs[0]);
dir0.y = 0;
// dir.normalize();
Vector3f dir1 = new Vector3f(0,dir0.length(),0);
Vector3f dir2 = new Vector3f(-dir0.z, 0, dir0.x);
Matrix4d out = new Matrix4d();
out.setRow( 0, toArray( dir2 ));
out.setRow( 1, toArray( dir1 ));
out.setRow( 2, toArray( dir0 ));
out.m03 = locs[0].x;
out.m13 = 0;
out.m23 = locs[0].z;
out.m33 = 1;
if (false)
{
Point3d a = new Point3d (0,0,0);
Point3d b = new Point3d (0,0,1);
out.transform( a );
out.transform( b );
System.out.println( a + " >>><<< " + b );
System.out.println( locs[0] + " <<<>>> " + locs[1] );
}
return out;
}