mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
commit
6d237f3f79
4 changed files with 7 additions and 7 deletions
|
@ -209,7 +209,7 @@ bool BillboardOverlay::findRayIntersection(const glm::vec3& origin, const glm::v
|
|||
float maxSize = glm::max(width, height);
|
||||
glm::vec2 dimensions = _scale * glm::vec2(width / maxSize, height / maxSize);
|
||||
|
||||
return findRayRectangleIntersection(origin, direction, rotation, _position, dimensions);
|
||||
return findRayRectangleIntersection(origin, direction, rotation, _position, dimensions, distance);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -95,5 +95,5 @@ QScriptValue Planar3DOverlay::getProperty(const QString& property) {
|
|||
|
||||
bool Planar3DOverlay::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||
float& distance, BoxFace& face) {
|
||||
return findRayRectangleIntersection(origin, direction, _rotation, _position, _dimensions);
|
||||
return findRayRectangleIntersection(origin, direction, _rotation, _position, _dimensions, distance);
|
||||
}
|
||||
|
|
|
@ -494,8 +494,8 @@ void PolygonClip::copyCleanArray(int& lengthA, glm::vec2* vertexArrayA, int& len
|
|||
}
|
||||
}
|
||||
|
||||
bool findRayRectangleIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||
const glm::quat& rotation, const glm::vec3& position, const glm::vec2& dimensions) {
|
||||
bool findRayRectangleIntersection(const glm::vec3& origin, const glm::vec3& direction, const glm::quat& rotation,
|
||||
const glm::vec3& position, const glm::vec2& dimensions, float& distance) {
|
||||
RayIntersectionInfo rayInfo;
|
||||
rayInfo._rayStart = origin;
|
||||
rayInfo._rayDirection = direction;
|
||||
|
@ -511,7 +511,7 @@ bool findRayRectangleIntersection(const glm::vec3& origin, const glm::vec3& dire
|
|||
bool intersects = plane.findRayIntersection(rayInfo);
|
||||
|
||||
if (intersects) {
|
||||
float distance = rayInfo._hitDistance;
|
||||
distance = rayInfo._hitDistance;
|
||||
|
||||
glm::vec3 hitPosition = origin + (distance * direction);
|
||||
glm::vec3 localHitPosition = glm::inverse(rotation) * (hitPosition - position);
|
||||
|
|
|
@ -76,8 +76,8 @@ bool findRaySphereIntersection(const glm::vec3& origin, const glm::vec3& directi
|
|||
bool findRayCapsuleIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||
const glm::vec3& start, const glm::vec3& end, float radius, float& distance);
|
||||
|
||||
bool findRayRectangleIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||
const glm::quat& rotation, const glm::vec3& position, const glm::vec2& dimensions);
|
||||
bool findRayRectangleIntersection(const glm::vec3& origin, const glm::vec3& direction, const glm::quat& rotation,
|
||||
const glm::vec3& position, const glm::vec2& dimensions, float& distance);
|
||||
|
||||
bool findRayTriangleIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||
const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2, float& distance);
|
||||
|
|
Loading…
Reference in a new issue