40 if (_vertex !=
nullptr)
delete _vertex;
41 if (_uv !=
nullptr)
delete _uv;
42 if (_color !=
nullptr)
delete _color;
58 _budget = total_budget;
74 set_clip(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h) {
85 quad_raw(
const LVector3 &v1,
const LVector4 &c1,
const LVector2 &uv1,
86 const LVector3 &v2,
const LVector4 &c2,
const LVector2 &uv2,
87 const LVector3 &v3,
const LVector4 &c3,
const LVector2 &uv3,
88 const LVector3 &v4,
const LVector4 &c4,
const LVector2 &uv4
91 if( _clear_index > _end_clear_index)
return;
113 INLINE
void MeshDrawer2D::
114 rectangle_raw(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h,
115 PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs,
116 const LVector4 &color
120 LVector3(x, 0, y), color, LVector2(u , v),
121 LVector3(x, 0, y+h), color, LVector2(u , v+vs),
122 LVector3(x+w, 0, y), color, LVector2(u+us, v),
123 LVector3(x+w, 0, y+h), color, LVector2(u+us, v+vs)
131 rectangle(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h,
132 PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs,
133 const LVector4 &color
136 if( w == 0 && h == 0 )
return;
137 if (x > _clip_x+_clip_w)
return;
138 if (y > _clip_y+_clip_h)
return;
139 if (x+w < _clip_x)
return;
140 if (y+h < _clip_y)
return;
144 PN_stdfloat x_uv_ratio = us/w;
145 PN_stdfloat y_uv_ratio = vs/h;
166 if (x+w > _clip_x+_clip_w){
168 dt = x+w - (_clip_x+_clip_w);
173 if (y+h > _clip_y+_clip_h){
175 dt = y+h - (_clip_y+_clip_h);
181 rectangle_raw(x,y,w,h,u,v,us,vs,color);
void set_clip(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h)
Sets clipping rectangle.
void quad_raw(const LVector3 &v1, const LVector4 &c1, const LVector2 &uv1, const LVector3 &v2, const LVector4 &c2, const LVector2 &uv2, const LVector3 &v3, const LVector4 &c3, const LVector2 &uv3, const LVector3 &v4, const LVector4 &c4, const LVector2 &uv4)
Draws a 2d rectangle.
~MeshDrawer2D()
Destroys the MeshDrawer2D low level system.
void add_data2(PN_stdfloat x, PN_stdfloat y)
Sets the write row to a particular 2-component value, and advances the write row.
void rectangle(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h, PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs, const LVector4 &color)
Draws a 2d rectangle, that can be cliped.
NodePath get_root()
Returns the root NodePath.
void add_data4(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat w)
Sets the write row to a particular 4-component value, and advances the write row.
void add_data3(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Sets the write row to a particular 3-component value, and advances the write row.
int get_budget()
Gets the total triangle budget of the drawer.
void set_budget(int budget)
Sets the total triangle budget of the drawer.
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
MeshDrawer2D()
Creates the MeshDrawer2D low level system.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...