mirror of
https://github.com/panda3d/panda3d.git
synced 2026-03-13 13:08:59 -05:00
generate_vis_points() should respect zero_special
This commit is contained in:
@@ -885,10 +885,15 @@ generate_vis_points() const {
|
||||
if (_y_size > 1) {
|
||||
uv_scale[1] = 1.0f / PN_stdfloat(_y_size - 1);
|
||||
}
|
||||
|
||||
|
||||
int num_points = 0;
|
||||
for (int yi = 0; yi < _y_size; ++yi) {
|
||||
for (int xi = 0; xi < _x_size; ++xi) {
|
||||
const LPoint3 &point = get_point(xi, yi);
|
||||
if (_has_no_data_value && point == _no_data_value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
LPoint2 uv(PN_stdfloat(xi) * uv_scale[0],
|
||||
PN_stdfloat(yi) * uv_scale[1]);
|
||||
if (_vis_inverse) {
|
||||
@@ -901,12 +906,13 @@ generate_vis_points() const {
|
||||
vertex.add_data3(point);
|
||||
texcoord.add_data2(uv);
|
||||
}
|
||||
++num_points;
|
||||
}
|
||||
}
|
||||
|
||||
PT(Geom) geom = new Geom(vdata);
|
||||
PT(GeomPoints) points = new GeomPoints(Geom::UH_static);
|
||||
points->add_next_vertices(_x_size * _y_size);
|
||||
points->add_next_vertices(num_points);
|
||||
geom->add_primitive(points);
|
||||
|
||||
PT(GeomNode) gnode = new GeomNode("");
|
||||
|
||||
Reference in New Issue
Block a user