mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
gobj: add margin to float comparison in lens.project()
Fixes unit tests in double-precision build. Cherry-picked from fa53e013cbc795dcccc57bc8503ca4788408fb86
This commit is contained in:
parent
dd77bd4cdf
commit
73b5316c6c
@ -1221,8 +1221,8 @@ do_project(const CData *cdata, const LPoint3 &point3d, LPoint3 &point2d) const {
|
|||||||
point2d.set(full[0] * recip_full3, full[1] * recip_full3, full[2] * recip_full3);
|
point2d.set(full[0] * recip_full3, full[1] * recip_full3, full[2] * recip_full3);
|
||||||
return
|
return
|
||||||
(full[3] > 0.0f) &&
|
(full[3] > 0.0f) &&
|
||||||
(point2d[0] >= -1.0f) && (point2d[0] <= 1.0f) &&
|
(point2d[0] >= -1.0f - NEARLY_ZERO(PN_stdfloat)) && (point2d[0] <= 1.0f + NEARLY_ZERO(PN_stdfloat)) &&
|
||||||
(point2d[1] >= -1.0f) && (point2d[1] <= 1.0f);
|
(point2d[1] >= -1.0f - NEARLY_ZERO(PN_stdfloat)) && (point2d[1] <= 1.0f + NEARLY_ZERO(PN_stdfloat));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user