MeshDrawer
from panda3d.core import MeshDrawer
- class MeshDrawer
Bases:
TypedObject
Mesh drawer creates a single geom object that can be shaped with different draw commands. This is an efficient way to render bunch of billboards, particles, fast changing triangles. Its implemented by recycling same geom over and over again. Max budget specifies how many triangles are allowed. Some uses of this class can be : particle system, radar icons, health bars, 2d icons, 2d ui, bullets, missile trails. Any that can be drawn with triangles can be drawn with this class. At the low level this uses the GeomVertexRewriter’s. The internal geom consists of vertex, normal, uv and color channels.
Inheritance diagram
- __init__(*args, **kwargs)
- begin()
C++ Interface: begin(const MeshDrawer self, NodePath camera, NodePath render)
- /**
Pass the current camera node and the root node. Passing the camera is
required to generate bill boards that face it.
*/
- billboard()
C++ Interface: billboard(const MeshDrawer self, const LVector3f pos, const LVector4f frame, float size, const LVector4f color)
- /**
Draws a billboard - particle with no rotation. Billboards always face the
camera. Frame contains u,v,u-size,v-size quadruple.
*/
- blendedParticle()
C++ Interface: blended_particle(const MeshDrawer self, const LVector3f pos, const LVector4f frame1, const LVector4f frame2, float blend, float size, const LVector4f color, float rotation)
- /**
Works just like particle but accepts 2 frames and a blend (from 0 to 1)
component between them Frame contains u,v,u-size,v-size quadruple.
*/
- blended_particle()
C++ Interface: blended_particle(const MeshDrawer self, const LVector3f pos, const LVector4f frame1, const LVector4f frame2, float blend, float size, const LVector4f color, float rotation)
- /**
Works just like particle but accepts 2 frames and a blend (from 0 to 1)
component between them Frame contains u,v,u-size,v-size quadruple.
*/
- crossSegment()
C++ Interface: cross_segment(const MeshDrawer self, const LVector3f start, const LVector3f stop, const LVector4f frame, float thickness, const LVector4f color)
- /**
Draws a segment a line with a thickness. This segment does not use the
bill boarding behavior and instead draws 2 planes in a cross. Stars at
start and ends at stop. Frame contains u,v,u-size,v-size quadruple.
*/
- cross_segment()
C++ Interface: cross_segment(const MeshDrawer self, const LVector3f start, const LVector3f stop, const LVector4f frame, float thickness, const LVector4f color)
- /**
Draws a segment a line with a thickness. This segment does not use the
bill boarding behavior and instead draws 2 planes in a cross. Stars at
start and ends at stop. Frame contains u,v,u-size,v-size quadruple.
*/
- end()
C++ Interface: end(const MeshDrawer self)
- /**
Finish the drawing and clearing off the remaining vertexes.
*/
- explosion()
C++ Interface: explosion(const MeshDrawer self, const LVector3f pos, const LVector4f frame, float size, const LVector4f color, int seed, int number, float distance)
- /**
Draws number of particles in a sphere like emitter. Frame contains
u,v,u-size,v-size quadruple.
*/
- geometry()
C++ Interface: geometry(const MeshDrawer self, NodePath node)
- /**
Draws the geometry that is inside this node path into the MeshDrawer
object. This performs a similar functions as RigidBodyCombiner but for
very dynamic situations that share the same texture like physcal chunks of
explosions. It can be a little slow
*/
- getBudget()
C++ Interface: get_budget(const MeshDrawer self)
- /**
Gets the total triangle budget of the drawer
*/
- getClassType()
C++ Interface: get_class_type()
- getRoot()
C++ Interface: get_root(const MeshDrawer self)
- /**
Returns the root NodePath. You should use this node to reparent mesh
drawer onto the scene might also want to disable depth draw or enable
transparency.
*/
- get_budget()
C++ Interface: get_budget(const MeshDrawer self)
- /**
Gets the total triangle budget of the drawer
*/
- get_class_type()
C++ Interface: get_class_type()
- get_root()
C++ Interface: get_root(const MeshDrawer self)
- /**
Returns the root NodePath. You should use this node to reparent mesh
drawer onto the scene might also want to disable depth draw or enable
transparency.
*/
- linkSegment()
C++ Interface: link_segment(const MeshDrawer self, const LVector3f pos, const LVector4f frame, float thickness, const LVector4f color)
- /**
Stars or continues linked segment. Control position, frame, thickness and
color with parameters. Frame contains u,v,u-size,v-size quadruple.
Note that for the first two calls to this method, the “frame” parameter is
ignored; it first takes effect as of the third call.
Similarly, note that in the second call to this method, the “color” parameter
is ignored; it only has effect in the first call and calls from the third
onwards.
*/
- linkSegmentEnd()
C++ Interface: link_segment_end(const MeshDrawer self, const LVector4f frame, const LVector4f color)
- /**
Finish drawing linked segments, needs at least two calls to link_segment
before it can end the linked segment. Frame contains u,v,u-size,v-size
quadruple.
*/
- link_segment()
C++ Interface: link_segment(const MeshDrawer self, const LVector3f pos, const LVector4f frame, float thickness, const LVector4f color)
- /**
Stars or continues linked segment. Control position, frame, thickness and
color with parameters. Frame contains u,v,u-size,v-size quadruple.
Note that for the first two calls to this method, the “frame” parameter is
ignored; it first takes effect as of the third call.
Similarly, note that in the second call to this method, the “color” parameter
is ignored; it only has effect in the first call and calls from the third
onwards.
*/
- link_segment_end()
C++ Interface: link_segment_end(const MeshDrawer self, const LVector4f frame, const LVector4f color)
- /**
Finish drawing linked segments, needs at least two calls to link_segment
before it can end the linked segment. Frame contains u,v,u-size,v-size
quadruple.
*/
- particle()
C++ Interface: particle(const MeshDrawer self, const LVector3f pos, const LVector4f frame, float size, const LVector4f color, float rotation)
- /**
Draws a particle that is sort of like a bill board but has an extra
rotation component. Frame contains u,v,u-size,v-size quadruple.
*/
- segment()
C++ Interface: segment(const MeshDrawer self, const LVector3f start, const LVector3f stop, const LVector4f frame, float thickness, const LVector4f color)
- /**
Draws a segment a line with a thickness. That has billboarding effect.
Frame contains u,v,u-size,v-size quadruple.
*/
- setBudget()
C++ Interface: set_budget(const MeshDrawer self, int budget)
- /**
Sets the total triangle budget of the drawer. This will not be exceeded.
Don’t set some thing too large because it will be slow
*/
- set_budget()
C++ Interface: set_budget(const MeshDrawer self, int budget)
- /**
Sets the total triangle budget of the drawer. This will not be exceeded.
Don’t set some thing too large because it will be slow
*/
- stream()
C++ Interface: stream(const MeshDrawer self, const LVector3f start, const LVector3f stop, const LVector4f frame, float size, const LVector4f color, int number, float offset)
- /**
Draws a number of particles in a big line with a shift dictated by the
offset. Frame contains u,v,u-size,v-size quadruple.
*/
- tri()
C++ Interface: tri(const MeshDrawer self, const LVector3f v1, const LVector4f c1, const LVector2f uv1, const LVector3f v2, const LVector4f c2, const LVector2f uv2, const LVector3f v3, const LVector4f c3, const LVector2f uv3)
- /**
Draws a triangle with the given parameters.
*/
- unevenSegment()
C++ Interface: uneven_segment(const MeshDrawer self, const LVector3f start, const LVector3f stop, const LVector4f frame, float thickness_start, const LVector4f color_start, float thickness_stop, const LVector4f color_stop)
- /**
Draws a segment a line with different thickness and color on both sides.
Stars at start and ends at stop. Frame contains u,v,u-size,v-size
quadruple.
*/
- uneven_segment()
C++ Interface: uneven_segment(const MeshDrawer self, const LVector3f start, const LVector3f stop, const LVector4f frame, float thickness_start, const LVector4f color_start, float thickness_stop, const LVector4f color_stop)
- /**
Draws a segment a line with different thickness and color on both sides.
Stars at start and ends at stop. Frame contains u,v,u-size,v-size
quadruple.
*/