本文整理匯總了Java中org.lwjgl.util.vector.Vector4f.dot方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector4f.dot方法的具體用法?Java Vector4f.dot怎麽用?Java Vector4f.dot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.util.vector.Vector4f
的用法示例。
在下文中一共展示了Vector4f.dot方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isShown
import org.lwjgl.util.vector.Vector4f; //導入方法依賴的package包/類
public void isShown(Matrix4f viewport, ThreadsafeHashMap<GData1, Matrix4f> CACHE_viewByProjection, float zoom) {
if (wasShown) {
return;
}
final Matrix4f M2 = CACHE_viewByProjection.get(parent);
if (M2 == null) {
Matrix4f.mul(viewport, parent.productMatrix, M);
CACHE_viewByProjection.put(parent, M);
} else {
M = M2;
}
// Calculate the real coordinates
Matrix4f.transform(M, A2, A);
Matrix4f.transform(M, B2, B);
Matrix4f.transform(M, C2, C);
Matrix4f.transform(M, D2, D);
N.x = A.y - B.y;
N.y = B.x - A.x;
N.z = 0f;
N.w = 1f;
wasShown = zoom / Vector4f.dot(N, Vector4f.sub(C, A, null)) * Vector4f.dot(N, Vector4f.sub(D, A, null)) > -1e-20f;
}
示例2: drawGL20_BFC_Textured
import org.lwjgl.util.vector.Vector4f; //導入方法依賴的package包/類
@Override
public void drawGL20_BFC_Textured(Composite3D c3d) {
// done :)
if (GData.globalDrawObjects) {
final OpenGLRenderer20 r = (OpenGLRenderer20) c3d.getRenderer();
GL20.glUniform1f(r.getNormalSwitchLoc(), GData.globalNegativeDeterminant ^ GData.globalInvertNext ? 1f : 0f);
GL20.glUniform1f(r.getNoTextureSwitch(), 1f);
GL20.glUniform1f(r.getNoLightSwitch(), 1f);
GL20.glUniform1f(r.getCubeMapSwitch(), 0f);
if (!visible)
return;
if (!c3d.isDrawingSolidMaterials())
return;
float result;
float zoom = c3d.getZoom();
switch (c3d.getLineMode()) {
case 1:
result = 1f;
break;
case 2:
case 4:
return;
default:
final Matrix4f M2 = GData.CACHE_viewByProjection.get(parent);
if (M2 == null) {
Matrix4f.mul(c3d.getViewport(), parent.productMatrix, M);
GData.CACHE_viewByProjection.put(parent, M);
} else {
M = M2;
}
// Calculate the real coordinates
Matrix4f.transform(M, A2, A);
Matrix4f.transform(M, B2, B);
Matrix4f.transform(M, C2, C);
Matrix4f.transform(M, D2, D);
N.x = A.y - B.y;
N.y = B.x - A.x;
result = zoom / Vector4f.dot(N, Vector4f.sub(C, A, null)) * Vector4f.dot(N, Vector4f.sub(D, A, null));
break;
}
if (result > -1e-20f) {
float r2;
float g2;
float b2;
int cn;
if (colourNumber == 24 && (cn = parent.r == .5f && parent.g == .5f && parent.b == .5f && (parent.a == 1.1f || parent.a == -1) ? 16 : View.getLDConfigIndex(parent.r, parent.g, parent.b)) != 16) {
GColour c = View.getLDConfigEdgeColour(cn, c3d);
r2 = c.getR();
g2 = c.getG();
b2 = c.getB();
} else {
r2 = this.r;
g2 = this.g;
b2 = this.b;
}
GL11.glLineWidth(View.lineWidthGL[0]);
GL11.glColor4f(r2, g2, b2, 1f);
GL11.glBegin(GL11.GL_LINES);
GraphicalDataTools.setVertex(x1, y1, z1, this, true);
GraphicalDataTools.setVertex(x2, y2, z2, this, true);
GL11.glEnd();
}
}
if (GData.globalFoundTEXMAPNEXT) {
GData.globalFoundTEXMAPStack.pop();
GData.globalTextureStack.pop();
GData.globalFoundTEXMAPStack.push(false);
GData.globalFoundTEXMAPNEXT = false;
}
}