本文整理匯總了Java中com.badlogic.gdx.math.Vector3.scl方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector3.scl方法的具體用法?Java Vector3.scl怎麽用?Java Vector3.scl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.math.Vector3
的用法示例。
在下文中一共展示了Vector3.scl方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawRay
import com.badlogic.gdx.math.Vector3; //導入方法依賴的package包/類
private void drawRay(GL2 gl, Ray ray) {
float axisSize = 50;
Vector3 v = new Vector3(ray.direction);
v.scl(axisSize);
//Draw Camera Axis
if (colide >= 0) {
gl.glColor3d(1.0, 0.0, 0.0);
} else {
gl.glColor3d(0.0, 0.0, 1.0);
}
gl.glBegin(GL.GL_LINES);
gl.glVertex3d(view.getX(), 1, view.getZ());
gl.glVertex3d(view.getX() + v.x, view.getY() + v.y, view.getZ() + v.z);
gl.glEnd();
}
示例2: calculateBezierPoint
import com.badlogic.gdx.math.Vector3; //導入方法依賴的package包/類
public static Vector3 calculateBezierPoint(float t, Vector3 p0, Vector3 p1, Vector3 p2) {
float u = 1 - t;
float tt = t*t;
float uu = u*u;
float uuu = uu * u;
Vector3 p = p0.scl(uuu); //first term
p = p.add(p1.scl(3 * uu * t)); //second term
p = p.add(p2.scl(3 * u * tt)); //third term
//p = p.add(p3.scl(ttt)); //fourth term Can one just remove this to create a quadratic curve?
return p;
}
示例3: drawRay
import com.badlogic.gdx.math.Vector3; //導入方法依賴的package包/類
public static void drawRay(GL2 gl, Ray ray, FlyView view, float size) {
Vector3 v = new Vector3(ray.direction);
v.scl(size);
gl.glBegin(GL.GL_LINES);
gl.glVertex3d(view.getX(), view.getY()-0.1, view.getZ());
gl.glVertex3d(view.getX()+v.x, view.getY()+v.y, view.getZ()+v.z);
gl.glEnd();
}
示例4: drawRay
import com.badlogic.gdx.math.Vector3; //導入方法依賴的package包/類
private void drawRay(GL2 gl, Ray ray) {
float axisSize = 50;
Vector3 v = new Vector3(ray.direction);
v.scl(axisSize);
//Draw Camera Axis
gl.glColor3d(0.0, 0.0, 1.0);
gl.glBegin(GL.GL_LINES);
gl.glVertex3d(view.getX(), 1, view.getZ());
gl.glVertex3d(view.getX()+v.x, view.getY()+v.y, view.getZ()+v.z);
gl.glEnd();
}