Panda3D
Functions
geom.I File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

Go to the source code of this file.

Functions

 CPT (GeomVertexData) Geom
 Returns a const pointer to the GeomVertexData, for application code to directly examine (but not modify) the geom's underlying data. More...
 
 PT (Geom) Geom
 Decomposes all of the primitives within this Geom, returning the result. More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
2005-03-06

Definition in file geom.I.

Function Documentation

◆ CPT()

CPT ( GeomVertexData  )
inline

Returns a const pointer to the GeomVertexData, for application code to directly examine (but not modify) the geom's underlying data.

Creates a context for the geom on the particular GSG, if it does not already exist.

Returns true if there appear to be no vertices to be rendered by this Geom, false if has some actual data. Returns the number of GeomPrimitive objects stored within the Geom, each of which represents a number of primitives of a particular type. Returns a const pointer to the ith GeomPrimitive object stored within the Geom. Use this call only to inspect the ith object; use modify_primitive() or set_primitive() if you want to modify it. Returns a modifiable pointer to the ith GeomPrimitive object stored within the Geom, so application code can directly manipulate the properties of this primitive.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

Returns the new (or old) GeomContext. This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new geoms. If this is not necessarily the case, you should use prepare() instead.

Normally, this is not called directly except by the GraphicsStateGuardian; a geom does not need to be explicitly prepared by the user before it may be rendered.

Definition at line 51 of file geom.I.

◆ PT()

PT ( Geom  )
inline

Decomposes all of the primitives within this Geom, returning the result.

See GeomPrimitive::decompose(). Doublesides all of the primitives within this Geom, returning the result. See GeomPrimitive::doubleside(). Reverses all of the primitives within this Geom, returning the result. See GeomPrimitive::reverse(). Rotates all of the primitives within this Geom, returning the result. See GeomPrimitive::rotate(). Unifies all of the primitives contained within this Geom into a single (or as few as possible, within the constraints of max_indices) primitive objects. This may require decomposing the primitives if, for instance, the Geom contains both triangle strips and triangle fans.

max_indices represents the maximum number of indices that will be put in any one GeomPrimitive. If preserve_order is true, then the primitives will not be reordered during the operation, even if this results in a suboptimal result. Returns a new Geom with points at all the vertices. See GeomPrimitive::make_points(). Returns a new Geom with lines at all the edges. See GeomPrimitive::make_lines(). Returns a new Geom with each primitive converted into a patch. Calls decompose() first. Returns a new Geom with each primitive converted into a corresponding version with adjacency information.

Since
1.10.0 Returns a sequence number which is guaranteed to change at least every time any of the primitives in the Geom is modified, or the set of primitives is modified. However, this does not include modifications to the vertex data, which should be tested separately. Marks the bounding volume of the Geom as stale so that it should be recomputed. Usually it is not necessary to call this explicitly. Specifies the desired type of bounding volume that will be created for this Geom. This is normally BoundingVolume::BT_default, which means to set the type according to the config variable "bounds-type".

If this is BT_sphere or BT_box, a BoundingSphere or BoundingBox is explicitly created. If it is BT_best, a BoundingBox is created.

This affects the implicit bounding volume only. If an explicit bounding volume is set on the Geom with set_bounds(), that bounding volume type is used. (This is different behavior from the similar method on PandaNode.)

Definition at line 124 of file geom.I.