bbox fixes
This commit is contained in:
@@ -16,11 +16,12 @@ BBox::BBox(CoreBBox** t_bboxes, const u32& count) : CoreBBox(t_bboxes, count) {
|
||||
setData();
|
||||
}
|
||||
|
||||
BBox::BBox(Vec4* t_vertices, u32 count) : CoreBBox(t_vertices, count) {
|
||||
BBox::BBox(const Vec4* t_vertices, const u32& count)
|
||||
: CoreBBox(t_vertices, count) {
|
||||
setData();
|
||||
}
|
||||
|
||||
BBox::BBox(Vec4* t_vertices, u32* faces, u32 count)
|
||||
BBox::BBox(const Vec4* t_vertices, const u32* faces, const u32& count)
|
||||
: CoreBBox(t_vertices, faces, count) {
|
||||
setData();
|
||||
}
|
||||
@@ -32,7 +33,7 @@ BBox::BBox(const BBox& t_bbox, const M4x4& t_matrix)
|
||||
setData();
|
||||
}
|
||||
|
||||
BBox::BBox(Vec4* t_vertices) : CoreBBox(t_vertices) { setData(); }
|
||||
BBox::BBox(const Vec4* t_vertices) : CoreBBox(t_vertices) { setData(); }
|
||||
|
||||
BBox BBox::getTransformed(const M4x4& t_matrix) const {
|
||||
return BBox(*this, t_matrix);
|
||||
|
||||
@@ -86,7 +86,7 @@ CoreBBox::CoreBBox(const std::vector<CoreBBox>& t_bboxes, const u32& startIndex,
|
||||
vertices[7].set(hiX, hiY, hiZ);
|
||||
}
|
||||
|
||||
CoreBBox::CoreBBox(Vec4* t_vertices, u32* faces, u32 count) {
|
||||
CoreBBox::CoreBBox(const Vec4* t_vertices, const u32* faces, const u32& count) {
|
||||
float lowX, lowY, lowZ, hiX, hiY, hiZ;
|
||||
lowX = hiX = t_vertices[faces[0]].x;
|
||||
lowY = hiY = t_vertices[faces[0]].y;
|
||||
@@ -113,7 +113,7 @@ CoreBBox::CoreBBox(Vec4* t_vertices, u32* faces, u32 count) {
|
||||
vertices[7].set(hiX, hiY, hiZ);
|
||||
}
|
||||
|
||||
CoreBBox::CoreBBox(Vec4* t_vertices, u32 count) {
|
||||
CoreBBox::CoreBBox(const Vec4* t_vertices, const u32& count) {
|
||||
float lowX, lowY, lowZ, hiX, hiY, hiZ;
|
||||
lowX = hiX = t_vertices[0].x;
|
||||
lowY = hiY = t_vertices[0].y;
|
||||
@@ -159,7 +159,7 @@ void CoreBBox::operator=(const CoreBBox& v) {
|
||||
for (auto i = 0; i < 8; i++) Vec4::copy(&vertices[i], v.vertices[i].xyzw);
|
||||
}
|
||||
|
||||
CoreBBox::CoreBBox(Vec4* t_vertices) {
|
||||
CoreBBox::CoreBBox(const Vec4* t_vertices) {
|
||||
for (auto i = 0; i < 8; i++) Vec4::copy(&vertices[i], t_vertices[i].xyzw);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,14 @@ RenderBBox::RenderBBox(const std::vector<CoreBBox>& t_bboxes,
|
||||
const u32& startIndex, const u32& stopIndex)
|
||||
: CoreBBox(t_bboxes, startIndex, stopIndex) {}
|
||||
|
||||
RenderBBox::RenderBBox(Vec4* t_vertices, u32* faces, u32 count)
|
||||
RenderBBox::RenderBBox(const Vec4* t_vertices, const u32* faces,
|
||||
const u32& count)
|
||||
: CoreBBox(t_vertices, faces, count) {}
|
||||
|
||||
RenderBBox::RenderBBox(Vec4* t_vertices, u32 count)
|
||||
RenderBBox::RenderBBox(const Vec4* t_vertices, const u32& count)
|
||||
: CoreBBox(t_vertices, count) {}
|
||||
|
||||
RenderBBox::RenderBBox(Vec4* t_vertices) : CoreBBox(t_vertices) {}
|
||||
RenderBBox::RenderBBox(const Vec4* t_vertices) : CoreBBox(t_vertices) {}
|
||||
|
||||
RenderBBox::RenderBBox(const RenderBBox& t_bbox, const M4x4& t_matrix)
|
||||
: CoreBBox(t_bbox, t_matrix) {}
|
||||
@@ -64,6 +65,6 @@ CoreBBoxFrustum RenderBBox::clipFrustumCheck(const Plane* frustumPlanes,
|
||||
guardBand[5] = -10.0F; // FAR
|
||||
|
||||
return frustumCheck(frustumPlanes, model, guardBand); // Let's check it again
|
||||
} // namespace Tyra
|
||||
}
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
Reference in New Issue
Block a user