This class generates 2-d "cards", that is, rectangular polygons, particularly useful for showing textures etc. More...
Public Member Functions | |
CardMaker (string name) | |
clearSourceGeometry () | |
Removes the node specified by an earlier call to set_source_geometry(). | |
PandaNode | generate () |
Generates a GeomNode that renders the specified geometry. | |
reset () | |
Resets all the parameters to their initial defaults. | |
setColor (VBase4 const color) | |
Sets the color of the card. | |
setColor (float r, float g, float b, float a) | |
Sets the color of the card. | |
setFrame (Point3 const ll, Point3 const lr, Point3 const ur, Point3 const ul) | |
Sets the size of the card. | |
setFrame (VBase4 const frame) | |
Sets the size of the card. | |
setFrame (float left, float right, float bottom, float top) | |
Sets the size of the card. | |
setFrameFullscreenQuad () | |
Sets the card to (-1,1,-1,1), which is appropriate if you plan to parent it to render2d and use it as a fullscreen quad. | |
setHas3dUvs (bool flag) | |
Sets the flag indicating whether vertices will be generated with 3-component UVW's (true) or 2-component UV's (the default, false). | |
setHasNormals (bool flag) | |
Sets the flag indicating whether vertices will be generated with normals or not. | |
setHasUvs (bool flag) | |
Sets the flag indicating whether vertices will be generated with UV's or not. | |
setSourceGeometry (PandaNode node, VBase4 const frame) | |
Sets a node that will be copied (and scaled and translated) to generate the frame, instead of generating a new polygon. | |
setUvRange (Point2 const ll, Point2 const ur) | |
Sets the range of UV's that will be applied to the vertices. | |
setUvRange (Point2 const ll, Point2 const lr, Point2 const ur, Point2 const ul) | |
Sets the range of UV's that will be applied to the vertices. | |
setUvRange (Point3 const ll, Point3 const lr, Point3 const ur, Point3 const ul) | |
Sets the range of UV's that will be applied to the vertices. | |
setUvRange (Vec4 const x, Vec4 const y, Vec4 const z) | |
Sets the range of UV's that will be applied to the vertices. | |
setUvRange (Texture const tex) | |
Sets the range of UV's that will be applied to the vertices appropriately to show the non-pad region of the texture. | |
setUvRangeCube (int face) | |
Sets the range of UV's that will be applied to the vertices appropriately for a cube-map face. |
This class generates 2-d "cards", that is, rectangular polygons, particularly useful for showing textures etc.
in the 2-d scene graph.
CardMaker | ( | string | name | ) |
Removes the node specified by an earlier call to set_source_geometry().
reset | ( | ) |
Resets all the parameters to their initial defaults.
setColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
Sets the color of the card.
Sets the size of the card.
setFrame | ( | float | left, |
float | right, | ||
float | bottom, | ||
float | top | ||
) |
Sets the size of the card.
Sets the card to (-1,1,-1,1), which is appropriate if you plan to parent it to render2d and use it as a fullscreen quad.
setHas3dUvs | ( | bool | flag | ) |
Sets the flag indicating whether vertices will be generated with 3-component UVW's (true) or 2-component UV's (the default, false).
Normally, this will be implicitly set by setting the uv_range.
setHasNormals | ( | bool | flag | ) |
Sets the flag indicating whether vertices will be generated with normals or not.
Normals are required if you intend to enable lighting on the card, but are just wasted space and bandwidth otherwise, so there is a (slight) optimization for disabling them. If enabled, the normals will be generated perpendicular to the card's face.
setHasUvs | ( | bool | flag | ) |
Sets the flag indicating whether vertices will be generated with UV's or not.
setSourceGeometry | ( | PandaNode | node, |
VBase4 const | frame | ||
) |
Sets a node that will be copied (and scaled and translated) to generate the frame, instead of generating a new polygon.
The node may contain arbitrary geometry that describes a flat polygon contained within the indicated left, right, bottom, top frame.
When generate() is called, the geometry in this node will be scaled and translated appropriately to give it the size and aspect ratio specified by set_frame().
setUvRange | ( | Point2 const | ll, |
Point2 const | ur | ||
) |
Sets the range of UV's that will be applied to the vertices.
If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV's, which will be useful if a texture is applied.
setUvRange | ( | Point2 const | ll, |
Point2 const | lr, | ||
Point2 const | ur, | ||
Point2 const | ul | ||
) |
Sets the range of UV's that will be applied to the vertices.
If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV's, which will be useful if a texture is applied.
setUvRange | ( | Point3 const | ll, |
Point3 const | lr, | ||
Point3 const | ur, | ||
Point3 const | ul | ||
) |
Sets the range of UV's that will be applied to the vertices.
If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV's, which will be useful if a texture is applied.
setUvRange | ( | Vec4 const | x, |
Vec4 const | y, | ||
Vec4 const | z | ||
) |
Sets the range of UV's that will be applied to the vertices.
If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV's, which will be useful if a texture is applied.
setUvRange | ( | Texture const | tex | ) |
Sets the range of UV's that will be applied to the vertices appropriately to show the non-pad region of the texture.
setUvRangeCube | ( | int | face | ) |
Sets the range of UV's that will be applied to the vertices appropriately for a cube-map face.