mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 03:42:10 +02:00
more correct bounding sphere around avatar for SafeLanding query
This commit is contained in:
parent
0d8fdf51c5
commit
4bbfd7cad1
3 changed files with 6 additions and 4 deletions
|
@ -6937,8 +6937,9 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) {
|
|||
bool interstitialModeEnabled = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled();
|
||||
|
||||
ConicalViewFrustum sphericalView;
|
||||
sphericalView.set(_viewFrustum);
|
||||
sphericalView.setSimpleRadius(INITIAL_QUERY_RADIUS);
|
||||
AABox box = getMyAvatar()->getGlobalBoundingBox();
|
||||
float radius = glm::max(INITIAL_QUERY_RADIUS, 0.5f * glm::length(box.getDimensions()));
|
||||
sphericalView.setPositionAndSimpleRadius(box.calcCenter(), radius);
|
||||
|
||||
if (interstitialModeEnabled) {
|
||||
ConicalViewFrustum farView;
|
||||
|
|
|
@ -145,7 +145,8 @@ int ConicalViewFrustum::deserialize(const unsigned char* sourceBuffer) {
|
|||
return sourceBuffer - startPosition;
|
||||
}
|
||||
|
||||
void ConicalViewFrustum::setSimpleRadius(float radius) {
|
||||
void ConicalViewFrustum::setPositionAndSimpleRadius(const glm::vec3& position, float radius) {
|
||||
_position = position;
|
||||
_radius = radius;
|
||||
_farClip = radius / 2.0f;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
int deserialize(const unsigned char* sourceBuffer);
|
||||
|
||||
// Just test for within radius.
|
||||
void setSimpleRadius(float radius);
|
||||
void setPositionAndSimpleRadius(const glm::vec3& position, float radius);
|
||||
|
||||
private:
|
||||
glm::vec3 _position { 0.0f, 0.0f, 0.0f };
|
||||
|
|
Loading…
Reference in a new issue