Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qtquick3d
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andy Nichols
qtquick3d
Commits
ced9a3bf
Commit
ced9a3bf
authored
5 years ago
by
Richard Gustavsen
Browse files
Options
Downloads
Patches
Plain Diff
QDemonView3D::viewToWorld(): rename argument
parent
685cce6e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3689
passed
5 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/quick3d/qdemonview3d.cpp
+5
-5
5 additions, 5 deletions
src/quick3d/qdemonview3d.cpp
src/quick3d/qdemonview3d.h
+1
-1
1 addition, 1 deletion
src/quick3d/qdemonview3d.h
with
6 additions
and
6 deletions
src/quick3d/qdemonview3d.cpp
+
5
−
5
View file @
ced9a3bf
...
...
@@ -446,21 +446,21 @@ QVector3D QDemonView3D::worldToView(const QVector3D &worldPos) const
}
/*!
* Transforms \a view
port
Pos from view space into world space. \a The x-, and y
* values of \l view
port
Pos should be within the width and height of the view.
* Transforms \a viewPos from view space into world space. \a The x-, and y
* values of \l viewPos should be within the width and height of the view.
* The z value should be the distance from the camera into the world in world units. If
* \a view
port
Pos cannot be mapped to a position, a position of [-1, -1, -1] is returned.
* \a viewPos cannot be mapped to a position, a position of [-1, -1, -1] is returned.
*
* \sa QDemonCamera::viewportToWorld QDemonView3D::worldToView
*/
QVector3D
QDemonView3D
::
viewToWorld
(
const
QVector3D
&
view
port
Pos
)
const
QVector3D
QDemonView3D
::
viewToWorld
(
const
QVector3D
&
viewPos
)
const
{
if
(
!
m_camera
)
{
qmlWarning
(
this
)
<<
"Cannot resolve world position without a camera assigned!"
;
return
QVector3D
(
-
1
,
-
1
,
-
1
);
}
const
QVector3D
normalizedPos
=
view
port
Pos
/
QVector3D
(
float
(
width
()),
float
(
height
()),
1
);
const
QVector3D
normalizedPos
=
viewPos
/
QVector3D
(
float
(
width
()),
float
(
height
()),
1
);
return
m_camera
->
viewportToWorld
(
normalizedPos
);
}
...
...
This diff is collapsed.
Click to expand it.
src/quick3d/qdemonview3d.h
+
1
−
1
View file @
ced9a3bf
...
...
@@ -58,7 +58,7 @@ public:
static
QSurfaceFormat
idealSurfaceFormat
();
Q_INVOKABLE
QVector3D
worldToView
(
const
QVector3D
&
worldPos
)
const
;
Q_INVOKABLE
QVector3D
viewToWorld
(
const
QVector3D
&
view
port
Pos
)
const
;
Q_INVOKABLE
QVector3D
viewToWorld
(
const
QVector3D
&
viewPos
)
const
;
protected
:
void
geometryChanged
(
const
QRectF
&
newGeometry
,
const
QRectF
&
oldGeometry
)
override
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment