/** * Instantiate the configured shape in Bullet. */ protected void createShape() { objectId = createShape(plane.getNormal(), plane.getConstant()); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); // objectId = new StaticPlaneShape(Converter.convert(plane.getNormal()),plane.getConstant()); // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
protected void createShape() { cShape = new StaticPlaneShape(Converter.convert(plane.getNormal()),plane.getConstant()); cShape.setLocalScaling(Converter.convert(getScale())); cShape.setMargin(margin); }
/** * * @param p * @param loc * @return true if the ray collides with the given Plane */ public boolean intersectsWherePlane(Plane p, Vector3f loc) { float denominator = p.getNormal().dot(direction); if (denominator > -FastMath.FLT_EPSILON && denominator < FastMath.FLT_EPSILON) { return false; // coplanar } float numerator = -(p.getNormal().dot(origin) - p.getConstant()); float ratio = numerator / denominator; if (ratio < FastMath.FLT_EPSILON) { return false; // intersects behind origin } loc.set(direction).multLocal(ratio).addLocal(origin); return true; }
Vector3f point = clipPlane.getNormal().mult(clipPlane.getConstant(), vars.vect1); Vector3f pp = ivm.mult(point, vars.vect2); Vector3f pn = ivm.multNormal(clipPlane.getNormal(), vars.vect3);
worldPlane[LEFT_PLANE].setConstant(worldPlane[LEFT_PLANE].getConstant() + frustumLeft); worldPlane[RIGHT_PLANE].setConstant(worldPlane[RIGHT_PLANE].getConstant() - frustumRight); worldPlane[TOP_PLANE].setConstant(worldPlane[TOP_PLANE].getConstant() - frustumTop); worldPlane[BOTTOM_PLANE].setConstant(worldPlane[BOTTOM_PLANE].getConstant() + frustumBottom);
for (int i = 0; i < MAX_WORLD_PLANES; ++i) { worldPlane[i].setNormal(cam.worldPlane[i].getNormal()); worldPlane[i].setConstant(cam.worldPlane[i].getConstant());
protected void createShape() { objectId = createShape(plane.getNormal(), plane.getConstant()); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); // objectId = new StaticPlaneShape(Converter.convert(plane.getNormal()),plane.getConstant()); // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
protected void createShape() { objectId = createShape(plane.getNormal(), plane.getConstant()); Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId)); // objectId = new StaticPlaneShape(Converter.convert(plane.getNormal()),plane.getConstant()); // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); setScale(scale); setMargin(margin); }
private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
private void updateClipPlanes() { reflectionClipPlane = plane.clone(); reflectionClipPlane.setConstant(reflectionClipPlane.getConstant() + reflectionClippingOffset); refractionClipPlane = plane.clone(); refractionClipPlane.setConstant(refractionClipPlane.getConstant() + refractionClippingOffset); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
/** * Set the water plane for this processor. * @param plane */ public void setPlane(Plane plane) { this.plane.setConstant(plane.getConstant()); this.plane.setNormal(plane.getNormal()); updateClipPlanes(); }
protected void createShape() { cShape = new StaticPlaneShape(Converter.convert(plane.getNormal()),plane.getConstant()); cShape.setLocalScaling(Converter.convert(getScale())); cShape.setMargin(margin); }
/** * * @param p * @param loc * @return true if the ray collides with the given Plane */ public boolean intersectsWherePlane(Plane p, Vector3f loc) { float denominator = p.getNormal().dot(direction); if (denominator > -FastMath.FLT_EPSILON && denominator < FastMath.FLT_EPSILON) { return false; // coplanar } float numerator = -(p.getNormal().dot(origin) - p.getConstant()); float ratio = numerator / denominator; if (ratio < FastMath.FLT_EPSILON) { return false; // intersects behind origin } loc.set(direction).multLocal(ratio).addLocal(origin); return true; }
/** * * @param p * @param loc * @return true if the ray collides with the given Plane */ public boolean intersectsWherePlane(Plane p, Vector3f loc) { float denominator = p.getNormal().dot(direction); if (denominator > -FastMath.FLT_EPSILON && denominator < FastMath.FLT_EPSILON) { return false; // coplanar } float numerator = -(p.getNormal().dot(origin) - p.getConstant()); float ratio = numerator / denominator; if (ratio < FastMath.FLT_EPSILON) { return false; // intersects behind origin } loc.set(direction).multLocal(ratio).addLocal(origin); return true; }
for (int i = 0; i < MAX_WORLD_PLANES; ++i) { worldPlane[i].setNormal(cam.worldPlane[i].getNormal()); worldPlane[i].setConstant(cam.worldPlane[i].getConstant());