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
0
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
10f50fbf
Commit
10f50fbf
authored
5 years ago
by
Richard Gustavsen
Browse files
Options
Downloads
Patches
Plain Diff
QQuick3DNode: add mapToGlobalDirection() and vice-versa
parent
45fbd270
No related branches found
No related tags found
No related merge requests found
Pipeline
#5394
passed with stage
Stage: build
in 5 minutes and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/quick3d/qquick3dnode.cpp
+20
-0
20 additions, 0 deletions
src/quick3d/qquick3dnode.cpp
src/quick3d/qquick3dnode_p.h
+4
-0
4 additions, 0 deletions
src/quick3d/qquick3dnode_p.h
with
24 additions
and
0 deletions
src/quick3d/qquick3dnode.cpp
+
20
−
0
View file @
10f50fbf
...
...
@@ -696,4 +696,24 @@ QVector3D QQuick3DNode::mapFromNodePosition(const QQuick3DNode *node, const QVec
return
mapFromGlobalPosition
(
node
->
mapToGlobalPosition
(
localPosition
));
}
QVector3D
QQuick3DNode
::
mapToGlobalDirection
(
const
QVector3D
localDirection
)
const
{
return
mat33
::
transform
(
mat44
::
getUpper3x3
(
globalTransform
()),
localDirection
);
}
QVector3D
QQuick3DNode
::
mapFromGlobalDirection
(
const
QVector3D
globalDirection
)
const
{
return
mat33
::
transform
(
mat33
::
getInverse
(
mat44
::
getUpper3x3
(
globalTransform
())),
globalDirection
);
}
QVector3D
QQuick3DNode
::
mapToNodeDirection
(
const
QQuick3DNode
*
node
,
const
QVector3D
localDirection
)
const
{
return
node
->
mapFromGlobalDirection
(
mapToGlobalDirection
(
localDirection
));
}
QVector3D
QQuick3DNode
::
mapFromNodeDirection
(
const
QQuick3DNode
*
node
,
const
QVector3D
localDirection
)
const
{
return
mapFromGlobalDirection
(
node
->
mapToGlobalDirection
(
localDirection
));
}
QT_END_NAMESPACE
This diff is collapsed.
Click to expand it.
src/quick3d/qquick3dnode_p.h
+
4
−
0
View file @
10f50fbf
...
...
@@ -127,6 +127,10 @@ public:
Q_INVOKABLE
QVector3D
mapFromGlobalPosition
(
const
QVector3D
globalPosition
)
const
;
Q_INVOKABLE
QVector3D
mapToNodePosition
(
const
QQuick3DNode
*
node
,
const
QVector3D
localPosition
)
const
;
Q_INVOKABLE
QVector3D
mapFromNodePosition
(
const
QQuick3DNode
*
node
,
const
QVector3D
localPosition
)
const
;
Q_INVOKABLE
QVector3D
mapToGlobalDirection
(
const
QVector3D
localDirection
)
const
;
Q_INVOKABLE
QVector3D
mapFromGlobalDirection
(
const
QVector3D
globalDirection
)
const
;
Q_INVOKABLE
QVector3D
mapToNodeDirection
(
const
QQuick3DNode
*
node
,
const
QVector3D
localDirection
)
const
;
Q_INVOKABLE
QVector3D
mapFromNodeDirection
(
const
QQuick3DNode
*
node
,
const
QVector3D
localDirection
)
const
;
protected
:
void
connectNotify
(
const
QMetaMethod
&
signal
)
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