Panda3D
Public Member Functions | Static Public Member Functions

CardMaker Class Reference

This class generates 2-d "cards", that is, rectangular polygons, particularly useful for showing textures etc. More...

Inheritance diagram for CardMaker:
Namable

List of all members.

Public Member Functions

 CardMaker (string name)
 clearName ()
 Resets the Namable's name to empty.
 clearSourceGeometry ()
 Removes the node specified by an earlier call to set_source_geometry().
PandaNode generate ()
 Generates a GeomNode that renders the specified geometry.
string getName ()
bool hasName ()
 Returns true if the Namable has a nonempty name set, false if the name is empty.
 output (ostream out)
 Outputs the Namable.
 reset ()
 Resets all the parameters to their initial defaults.
 setColor (float r, float g, float b, float a)
 Sets the color of the card.
 setColor (VBase4 const color)
 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 (float left, float right, float bottom, float top)
 Sets the size of the card.
 setFrame (VBase4 const frame)
 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.
 setName (string name)
 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 (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.
 setUvRange (Point2 const ll, Point2 const ur)
 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 (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.
 setUvRangeCube (int face)
 Sets the range of UV's that will be applied to the vertices appropriately for a cube-map face.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

This class generates 2-d "cards", that is, rectangular polygons, particularly useful for showing textures etc.

in the 2-d scene graph.


Constructor & Destructor Documentation

CardMaker ( string  name)

Member Function Documentation

clearName ( ) [inherited]

Resets the Namable's name to empty.

Reimplemented in AsyncTask.

clearSourceGeometry ( )

Removes the node specified by an earlier call to set_source_geometry().

PandaNode generate ( )

Generates a GeomNode that renders the specified geometry.

static TypeHandle getClassType ( ) [static, inherited]

Reimplemented in PGItem, PandaNode, PGButton, PGTop, PGEntry, PGMouseWatcherBackground, MouseWatcherRegion, PGVirtualFrame, PGSliderBar, PGScrollFrame, PGWaitBar, ButtonThrower, DataNode, MouseInterfaceNode, DriveInterface, MouseSubregion, MouseWatcher, Trackball, Transform2SG, TextFont, DynamicTextPage, Texture, DynamicTextFont, StaticTextFont, TextNode, ParametricCurve, CubicCurveseg, PiecewiseCurve, HermiteCurve, NurbsCurve, RopeNode, SheetNode, AnimateVerticesRequest, AsyncTask, Material, TextureReloadRequest, VideoTexture, AsyncTaskBase, AsyncTaskChain, AsyncTaskManager, AsyncTaskPause, AsyncTaskSequence, PythonTask, Thread, ExternalThread, MainThread, PythonThread, AnalogNode, ButtonNode, DialNode, MouseAndKeyboard, TrackerNode, VirtualMouse, CollisionNode, CollisionTraverser, CollisionVisualizer, CharacterJoint, MovingPartMatrix, CharacterSlider, MovingPartScalar, Character, PartBundleNode, CharacterJointBundle, PartBundle, AnimGroup, AnimBundle, AnimBundleNode, PartGroup, AnimControl, AnimChannelBase, AnimChannelACMatrixSwitchType, AnimChannelACScalarSwitchType, AnimChannelMatrixDynamic, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, BindAnimRequest, ModelLoadRequest, MovingPartBase, MovingPartACMatrixSwitchType, MovingPartACScalarSwitchType, FFMpegTexture, FrameRateMeter, SceneGraphAnalyzerMeter, MovieTexture, RigidBodyCombiner, MovieVideo, MovieAudio, InkblotVideo, FfmpegVideo, FfmpegAudio, MicrophoneAudio, UserDataAudio, LensNode, Camera, PlaneNode, GeomNode, Fog, PandaLoader, ModelFlattenRequest, ModelNode, ModelRoot, PolylightNode, PortalNode, UvScrollNode, LightNode, AmbientLight, CallbackNode, LightLensNode, DirectionalLight, LODNode, FadeLODNode, PointLight, SelectiveChildNode, SequenceNode, Spotlight, SwitchNode, and MouseRecorder.

string getName ( ) [inherited]

Reimplemented in DynamicTextFont.

bool hasName ( ) [inherited]

Returns true if the Namable has a nonempty name set, false if the name is empty.

output ( ostream  out) [inherited]

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented in PandaNode, MouseWatcherRegion, TextNode, AdaptiveLru, SimpleLru, AsyncTask, Material, AsyncTaskChain, AsyncTaskManager, Thread, CollisionTraverser, PartBundle, AnimGroup, AnimControl, PandaLoader, LightNode, and LightLensNode.

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).

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.

setName ( string  name) [inherited]

Reimplemented in PGItem, and AsyncTask.

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 ( 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 ( 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 ( 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 ( 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.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties