本文整理匯總了Java中org.lwjgl.util.vector.Vector4f.sub方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector4f.sub方法的具體用法?Java Vector4f.sub怎麽用?Java Vector4f.sub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.util.vector.Vector4f
的用法示例。
在下文中一共展示了Vector4f.sub方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkNormal
import org.lwjgl.util.vector.Vector4f; //導入方法依賴的package包/類
private GData3 checkNormal(GData3 g3, Matrix4f vport) {
Vertex[] v = triangles.get(g3);
Vector4f n = new Vector4f();
n.setW(1f);
n.setX((v[2].y - v[0].y) * (v[1].z - v[0].z) - (v[2].z - v[0].z) * (v[1].y - v[0].y));
n.setY((v[2].z - v[0].z) * (v[1].x - v[0].x) - (v[2].x - v[0].x) * (v[1].z - v[0].z));
n.setZ((v[2].x - v[0].x) * (v[1].y - v[0].y) - (v[2].y - v[0].y) * (v[1].x - v[0].x));
Matrix4f.transform(vport, n, n);
Vector4f.sub(n, new Vector4f(vport.m03, vport.m13, vport.m23, 0f), n);
if (n.z > 0f ^ Editor3DWindow.getWindow().hasBfcToggle()) {
return new GData3(g3.colourNumber, g3.r, g3.g, g3.b, g3.a, v[0], v[2], v[1], View.DUMMY_REFERENCE, linkedDatFile, g3.isTriangle);
} else {
return null;
}
}
示例2: mntm_Manipulator_X_XReverse
import org.lwjgl.util.vector.Vector4f; //導入方法依賴的package包/類
public void mntm_Manipulator_X_XReverse() {
for (OpenGLRenderer renderer : renders) {
Composite3D c3d = renderer.getC3D();
if (c3d.getLockableDatFileReference().equals(Project.getFileToEdit())) {
Vector4f.sub(new Vector4f(0f, 0f, 0f, 2f), c3d.getManipulator().getXaxis(), c3d.getManipulator().getXaxis());
BigDecimal[] a = c3d.getManipulator().getAccurateXaxis();
c3d.getManipulator().setAccurateXaxis(a[0].negate(), a[1].negate(), a[2].negate());
}
}
regainFocus();
}
示例3: mntm_Manipulator_XI_YReverse
import org.lwjgl.util.vector.Vector4f; //導入方法依賴的package包/類
public void mntm_Manipulator_XI_YReverse() {
for (OpenGLRenderer renderer : renders) {
Composite3D c3d = renderer.getC3D();
if (c3d.getLockableDatFileReference().equals(Project.getFileToEdit())) {
Vector4f.sub(new Vector4f(0f, 0f, 0f, 2f), c3d.getManipulator().getYaxis(), c3d.getManipulator().getYaxis());
BigDecimal[] a = c3d.getManipulator().getAccurateYaxis();
c3d.getManipulator().setAccurateYaxis(a[0].negate(), a[1].negate(), a[2].negate());
}
}
regainFocus();
}
示例4: mntm_Manipulator_XII_ZReverse
import org.lwjgl.util.vector.Vector4f; //導入方法依賴的package包/類
public void mntm_Manipulator_XII_ZReverse() {
for (OpenGLRenderer renderer : renders) {
Composite3D c3d = renderer.getC3D();
if (c3d.getLockableDatFileReference().equals(Project.getFileToEdit())) {
Vector4f.sub(new Vector4f(0f, 0f, 0f, 2f), c3d.getManipulator().getZaxis(), c3d.getManipulator().getZaxis());
BigDecimal[] a = c3d.getManipulator().getAccurateZaxis();
c3d.getManipulator().setAccurateZaxis(a[0].negate(), a[1].negate(), a[2].negate());
}
}
regainFocus();
}
示例5: mntm_Manipulator_4_toVertex
import org.lwjgl.util.vector.Vector4f; //導入方法依賴的package包/類
public void mntm_Manipulator_4_toVertex() {
for (OpenGLRenderer renderer : renders) {
Composite3D c3d = renderer.getC3D();
if (c3d.getLockableDatFileReference().equals(Project.getFileToEdit())) {
float minDist = Float.MAX_VALUE;
Vector4f next = new Vector4f(c3d.getManipulator().getPosition());
Vector4f min = new Vector4f(c3d.getManipulator().getPosition());
VertexManager vm = c3d.getLockableDatFileReference().getVertexManager();
Set<Vertex> vertices;
if (vm.getSelectedVertices().isEmpty()) {
vertices = vm.getVertices();
} else {
vertices = vm.getSelectedVertices();
}
Vertex minVertex = new Vertex(0f, 0f, 0f);
for (Vertex vertex : vertices) {
Vector4f sub = Vector4f.sub(next, vertex.toVector4f(), null);
float d2 = sub.lengthSquared();
if (d2 < minDist) {
minVertex = vertex;
minDist = d2;
min = vertex.toVector4f();
}
}
c3d.getManipulator().getPosition().set(min.x, min.y, min.z, 1f);
c3d.getManipulator().setAccuratePosition(minVertex.X, minVertex.Y, minVertex.Z);
}
}
regainFocus();
}