< Zurück | Inhalt | Weiter >

8.2.5 Primitive flags

All of the Primitives have a primitive flags (primflags) argument in one of their constructors. Primitive flags influence the attributes applied to the Shape3D geometry when it is generated internally for the Primitive. The available primitive flags are shown in table 8.1.


Table 8.1 Primitive flags for Primitive derived classes


Primitive flag

Effect


ENABLE_APPEARANCE_MODIFY

Set ALLOW_APPEARANCE_READ and

ALLOW_APPEARANCE_WRITE capabilities on the generated geometry's Shape3D nodes.

ENABLE_GEOMETRY_PICKING

Set ALLOW_INTERSECT capability on the generated geometry.

GENERATE_NORMALS

Generate normal vectors along with geometry.

GENERATE_NORMALS_INWARD

Normal vectors flipped along the surface.

GENERATE_TEXTURE_COORDS

Generate texture coordinates along with geometry.

GEOMETRY_NOT_SHARED

Generate geometry that will not be shared by another scene graph node.

After a Primitive has been generated, the capabilities for the Shape3D subparts can also be accessed by calling


getShape(partid).setCapability(ALLOW_INTERSECT);


Note that the setPrimitiveFlags method should not be used, as it does not have any effect once the

Primitive has been created.


Unless primitive flags are explicitly supplied, the default GENERATE_NORMALS primitive flag is used. In other words, both vertex coordinates and normal vectors are generated (to allow surfaces to be lighted).