1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#include "qssgplane_p.h"
6
7QT_BEGIN_NAMESPACE
8
9namespace {
10float magnitude(const QVector3D &vector)
11{
12 return std::sqrt(x: vector.x() * vector.x() + vector.y() * vector.y() + vector.z() * vector.z());
13}
14}
15
16void QSSGPlane::normalize()
17{
18 float denom = 1.0f / magnitude(vector: n);
19 n *= denom;
20 d *= denom;
21}
22
23QT_END_NAMESPACE
24

source code of qtquick3d/src/utils/qssgplane.cpp