/** * Constructs a PolygonAttributes object with default parameters. * The default values are as follows: * <ul> * cull face : CULL_BACK<br> * back face normal flip : false<br> * polygon mode : POLYGON_FILL<br> * polygon offset : 0.0<br> * polygon offset factor : 0.0<br> * </ul> */ public PolygonAttributes() { // Just use defaults for all attributes // set default read capabilities setDefaultReadCapabilities(readCapabilities); }
/** * Constructs PolygonAttributes object with specified values. * @param polygonMode polygon rasterization mode; one of POLYGON_POINT, * POLYGON_LINE, or POLYGON_FILL * @param cullFace polygon culling mode; one of CULL_NONE, * CULL_BACK, or CULL_FRONT * @param polygonOffset constant polygon offset * @param backFaceNormalFlip back face normal flip flag; true or false * @param polygonOffsetFactor polygon offset factor for slope-based polygon * offset * * @since Java 3D 1.2 */ public PolygonAttributes(int polygonMode, int cullFace, float polygonOffset, boolean backFaceNormalFlip, float polygonOffsetFactor) { if (polygonMode < POLYGON_POINT || polygonMode > POLYGON_FILL) throw new IllegalArgumentException(J3dI18N.getString("PolygonAttributes0")); if (cullFace < CULL_NONE || cullFace > CULL_FRONT) throw new IllegalArgumentException(J3dI18N.getString("PolygonAttributes12")); // set default read capabilities setDefaultReadCapabilities(readCapabilities); ((PolygonAttributesRetained)this.retained).initPolygonMode(polygonMode); ((PolygonAttributesRetained)this.retained).initCullFace(cullFace); ((PolygonAttributesRetained)this.retained).initPolygonOffset(polygonOffset); ((PolygonAttributesRetained)this.retained).initBackFaceNormalFlip(backFaceNormalFlip); ((PolygonAttributesRetained)this.retained).initPolygonOffsetFactor(polygonOffsetFactor); }