Skip to content

Commit

Permalink
new release (source = ca952840)
Browse files Browse the repository at this point in the history
  • Loading branch information
charleschandesris committed Jun 25, 2024
1 parent d355a24 commit c23f1a4
Show file tree
Hide file tree
Showing 156 changed files with 2,703 additions and 2,062 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
#include <glm/gtc/matrix_inverse.hpp>
#include <glm/vec3.hpp>

glm::dmat4 CalcBoundsOperation::getModelToUnrealWorldMatrix() const {
glm::dmat4 FITwinCalcBoundsOperation::getModelToUnrealWorldMatrix() const {
const FMatrix matrix = localToWorld.ToMatrixWithScale();
return VecMath::createMatrix4D(matrix);
return FITwinVecMath::createMatrix4D(matrix);
}

glm::dmat4 CalcBoundsOperation::getTilesetToUnrealWorldMatrix() const {
glm::dmat4 FITwinCalcBoundsOperation::getTilesetToUnrealWorldMatrix() const {
const glm::dmat4 modelToUnreal = getModelToUnrealWorldMatrix();
const glm::dmat4 tilesetToModel = glm::affineInverse(highPrecisionTransform);
return modelToUnreal * tilesetToModel;
}

FBoxSphereBounds CalcBoundsOperation::operator()(
FBoxSphereBounds FITwinCalcBoundsOperation::operator()(
const CesiumGeometry::BoundingSphere& sphere) const {
glm::dmat4 matrix = getTilesetToUnrealWorldMatrix();
glm::dvec3 center = glm::dvec3(matrix * glm::dvec4(sphere.getCenter(), 1.0));
Expand All @@ -28,13 +28,13 @@ FBoxSphereBounds CalcBoundsOperation::operator()(
sphereRadius = glm::max(sphereRadius, glm::length(halfAxes[2]));

FBoxSphereBounds result;
result.Origin = VecMath::createVector(center);
result.Origin = FITwinVecMath::createVector(center);
result.SphereRadius = sphereRadius;
result.BoxExtent = FVector(sphereRadius, sphereRadius, sphereRadius);
return result;
}

FBoxSphereBounds CalcBoundsOperation::operator()(
FBoxSphereBounds FITwinCalcBoundsOperation::operator()(
const CesiumGeometry::OrientedBoundingBox& box) const {
glm::dmat4 matrix = getTilesetToUnrealWorldMatrix();
glm::dvec3 center = glm::dvec3(matrix * glm::dvec4(box.getCenter(), 1.0));
Expand All @@ -55,24 +55,24 @@ FBoxSphereBounds CalcBoundsOperation::operator()(
glm::abs(halfAxes[2].z);

FBoxSphereBounds result;
result.Origin = VecMath::createVector(center);
result.Origin = FITwinVecMath::createVector(center);
result.SphereRadius = sphereRadius;
result.BoxExtent = FVector(maxX, maxY, maxZ);
return result;
}

FBoxSphereBounds CalcBoundsOperation::operator()(
FBoxSphereBounds FITwinCalcBoundsOperation::operator()(
const CesiumGeospatial::BoundingRegion& region) const {
return (*this)(region.getBoundingBox());
}

FBoxSphereBounds CalcBoundsOperation::operator()(
FBoxSphereBounds FITwinCalcBoundsOperation::operator()(
const CesiumGeospatial::BoundingRegionWithLooseFittingHeights& region)
const {
return (*this)(region.getBoundingRegion());
}

FBoxSphereBounds CalcBoundsOperation::operator()(
FBoxSphereBounds FITwinCalcBoundsOperation::operator()(
const CesiumGeospatial::S2CellBoundingVolume& s2) const {
return (*this)(s2.computeBoundingRegion());
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <glm/mat3x3.hpp>
#include <glm/mat4x4.hpp>

struct CalcBoundsOperation {
struct FITwinCalcBoundsOperation {
const FTransform& localToWorld;
const glm::dmat4& highPrecisionTransform;

Expand Down
Loading

0 comments on commit c23f1a4

Please sign in to comment.