/** * Returns the (4-space) angle in radians between this vector and * the vector parameter; the return value is constrained to the * range [0,PI]. * @param v1 the other vector * @return the angle in radians in the range [0,PI] */ public final float angle(Vector4f v1) { double vDot = this.dot(v1) / ( this.length()*v1.length() ); if( vDot < -1.0) vDot = -1.0; if( vDot > 1.0) vDot = 1.0; return((float) (Math.acos( vDot ))); }
boolean equivalent(TexCoordGenerationRetained tr) { if (tr == null) { return (false); } else if ((this.changedFrequent != 0) || (tr.changedFrequent != 0)) { return (this == tr); } return ((tr.genMode == genMode) && (tr.format == format) && (tr.enable == enable) && tr.planeS.equals(planeS) && tr.planeT.equals(planeT) && tr.planeR.equals(planeR)); }
/** * Retrieves a copy of the plane equation used to * generate the S coordinate. * @param planeS the S coordinate plane equation */ final void getPlaneS(Vector4f planeS) { planeS.set(this.planeS); }
/** * Sets the R coordinate plane equation. This plane equation * is used to generate the R coordinate in OBJECT_LINEAR and EYE_LINEAR * texture generation modes. * @param planeR plane equation for the R coordinate */ final void initPlaneR(Vector4f planeR) { this.planeR.set(planeR); }
Vector3f vector3 = new Vector3f(x,y,z); Vector4f vector4 = new Vector4f((Tuple3f)vector3);
/** * Retrieves a copy of the plane equation used to * generate the R coordinate. * @param planeR the R coordinate plane equation */ final void getPlaneR(Vector4f planeR) { planeR.set(this.planeR); }
public Vector4f readVector4f( DataInput in ) throws IOException { return (Vector4f)readTuple4f( in, new Vector4f() ); }
/** * Sets the Q coordinate plane equation. This plane equation * is used to generate the Q coordinate in OBJECT_LINEAR and EYE_LINEAR * texture generation modes. * @param planeQ plane equation for the Q coordinate */ final void initPlaneQ(Vector4f planeQ) { this.planeQ.set(planeQ); }
Vector4f vpos = new Vector4f(0, 0, 0, 1); // (0,0,0,1) because it's relative to the cam float mv[]=new float[16]; ByteBuffer temp = ByteBuffer.allocateDirect(64); temp.order(ByteOrder.nativeOrder()); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)temp.asFloatBuffer()); temp.asFloatBuffer().get(mv); Matrix4f m4 = new Matrix4f(); m4.load((FloatBuffer)temp.asFloatBuffer()); m4.invert(); vpos = Matrix4f.transform(m4, vpos, vpos);
/** * Sets the S coordinate plane equation. This plane equation * is used to generate the S coordinate in OBJECT_LINEAR and EYE_LINEAR * texture generation modes. * @param planeS plane equation for the S coordinate */ final void initPlaneS(Vector4f planeS) { this.planeS.set(planeS); }
/** * Sets the T coordinate plane equation. This plane equation * is used to generate the T coordinate in OBJECT_LINEAR and EYE_LINEAR * texture generation modes. * @param planeT plane equation for the T coordinate */ final void initPlaneT(Vector4f planeT) { this.planeT.set(planeT); }
/** * Retrieves a copy of the plane equation used to * generate the T coordinate. * @param planeT the T coordinate plane equation */ final void getPlaneT(Vector4f planeT) { planeT.set(this.planeT); }
/** * Sets the T coordinate plane equation. This plane equation * is used to generate the T coordinate in OBJECT_LINEAR and EYE_LINEAR * texture generation modes. * @param planeT plane equation for the T coordinate */ final void setPlaneT(Vector4f planeT) { initPlaneT(planeT); sendMessage(PLANE_T_CHANGED, new Vector4f(planeT)); }
/** * Retrieves a copy of the plane equation used to * generate the Q coordinate. * @param planeQ the Q coordinate plane equation */ final void getPlaneQ(Vector4f planeQ) { planeQ.set(this.planeQ); }
/** * Sets the S coordinate plane equation. This plane equation * is used to generate the S coordinate in OBJECT_LINEAR and EYE_LINEAR * texture generation modes. * @param planeS plane equation for the S coordinate */ final void setPlaneS(Vector4f planeS) { initPlaneS(planeS); sendMessage(PLANE_S_CHANGED, new Vector4f(planeS)); }
/** * Sets the R coordinate plane equation. This plane equation * is used to generate the R coordinate in OBJECT_LINEAR and EYE_LINEAR * texture generation modes. * @param planeR plane equation for the R coordinate */ final void setPlaneR(Vector4f planeR) { initPlaneR(planeR); sendMessage(PLANE_R_CHANGED, new Vector4f(planeR)); }