fixed clipper bug
This commit is contained in:
@@ -195,7 +195,7 @@ CoreBBoxFrustum CoreBBox::isInFrustum(const Plane* frustumPlanes,
|
|||||||
for (u8 y = 0; y < 8 && (boxIn == 0 || boxOut == 0); y++) {
|
for (u8 y = 0; y < 8 && (boxIn == 0 || boxOut == 0); y++) {
|
||||||
boxCalcTemp = model * _vertices[y];
|
boxCalcTemp = model * _vertices[y];
|
||||||
|
|
||||||
auto isOut = frustumPlanes[i].distanceTo(boxCalcTemp) < margin;
|
auto isOut = frustumPlanes[i].distanceTo(boxCalcTemp) <= margin;
|
||||||
|
|
||||||
if (isOut)
|
if (isOut)
|
||||||
boxOut++;
|
boxOut++;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ RenderBBox::RenderBBox(Vec4* t_vertices) : CoreBBox(t_vertices) {}
|
|||||||
*/
|
*/
|
||||||
CoreBBoxFrustum RenderBBox::clipIsInFrustum(const Plane* frustumPlanes,
|
CoreBBoxFrustum RenderBBox::clipIsInFrustum(const Plane* frustumPlanes,
|
||||||
const M4x4& model) const {
|
const M4x4& model) const {
|
||||||
|
return isInFrustum(frustumPlanes, model);
|
||||||
auto result = isInFrustum(frustumPlanes, model);
|
auto result = isInFrustum(frustumPlanes, model);
|
||||||
|
|
||||||
if (result != PARTIALLY_IN_FRUSTUM) {
|
if (result != PARTIALLY_IN_FRUSTUM) {
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ EEClipAlgorithm::~EEClipAlgorithm() { delete[] tempVertices; }
|
|||||||
float EEClipAlgorithm::clipMargin = -10.0F;
|
float EEClipAlgorithm::clipMargin = -10.0F;
|
||||||
|
|
||||||
void EEClipAlgorithm::init(const RendererSettings& settings) {
|
void EEClipAlgorithm::init(const RendererSettings& settings) {
|
||||||
// halfWidth = settings.getWidth() / 2;
|
|
||||||
// halfHeight = settings.getHeight() / 2;
|
|
||||||
halfWidth = 0.5F;
|
halfWidth = 0.5F;
|
||||||
halfHeight = 0.5F;
|
halfHeight = 0.5F;
|
||||||
near = settings.getNear() - (-clipMargin);
|
near = settings.getNear() - (-clipMargin);
|
||||||
|
|||||||
Reference in New Issue
Block a user