More work for large worlds
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "BoundingBox.h"
|
||||
#include "BoundingSphere.h"
|
||||
#include "Matrix.h"
|
||||
#include "Transform.h"
|
||||
#include "../Types/String.h"
|
||||
|
||||
const BoundingBox BoundingBox::Empty(Vector3(MAX_float), Vector3(MIN_float));
|
||||
@@ -147,3 +148,11 @@ void BoundingBox::Transform(const BoundingBox& box, const Matrix& matrix, Boundi
|
||||
result = FromPoints(corners, 8);
|
||||
*/
|
||||
}
|
||||
|
||||
void BoundingBox::Transform(const BoundingBox& box, const ::Transform& transform, BoundingBox& result)
|
||||
{
|
||||
// TODO: optimize it and support large worlds without using Matrix
|
||||
Matrix matrix;
|
||||
transform.GetWorld(matrix);
|
||||
Transform(box, matrix, result);
|
||||
}
|
||||
|
||||
@@ -296,6 +296,14 @@ public:
|
||||
/// <param name="result">The result transformed box.</param>
|
||||
static void Transform(const BoundingBox& box, const Matrix& matrix, BoundingBox& result);
|
||||
|
||||
/// <summary>
|
||||
/// Transforms the bounding box using the specified transformation.
|
||||
/// </summary>
|
||||
/// <param name="box">The box.</param>
|
||||
/// <param name="transform">The transformation.</param>
|
||||
/// <param name="result">The result transformed box.</param>
|
||||
static void Transform(const BoundingBox& box, const ::Transform& transform, BoundingBox& result);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Determines if there is an intersection between the current object and a Ray.
|
||||
|
||||
Reference in New Issue
Block a user