Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITAGeo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Institute of Technical Acoustics (ITA)
ITAGeo
Commits
677987a4
Commit
677987a4
authored
Apr 15, 2019
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up detection sphere implementation
parent
25933f56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/ITAGeo/Utils.cpp
src/ITAGeo/Utils.cpp
+6
-7
No files found.
src/ITAGeo/Utils.cpp
View file @
677987a4
...
...
@@ -416,15 +416,14 @@ bool ITAGeoUtils::RayFaceIntersectionTest( const VistaRay& rRay, CITAMesh* pMesh
bool
ITAGeoUtils
::
RayDetectionSphereIntersectionTest
(
const
VistaRay
&
rRay
,
std
::
shared_ptr
<
ITAGeo
::
CPropagationAnchor
>
pDestination
,
float
fDetectionSphereRadius
,
VistaVector3D
&
v3DetectionPoint
)
{
const
VistaVector3D
v3RayOrigin2RcvPos
=
pDestination
->
v3InteractionPoint
-
rRay
.
GetOrigin
();
// Nearest Point of ray to detection sphere origin
const
auto
v3RayOrigin2RcvPos
=
pDestination
->
v3InteractionPoint
-
rRay
.
GetOrigin
();
v3DetectionPoint
=
rRay
.
GetDir
().
Dot
(
v3RayOrigin2RcvPos
)
*
rRay
.
GetDir
()
+
rRay
.
GetOrigin
();
const
auto
v3DetectionOffset
=
v3DetectionPoint
-
pDestination
->
v3InteractionPoint
;
const
auto
fDetectedRadius
=
v3DetectionOffset
.
GetLength
();
const
auto
bInsideSphere
=
fDetectedRadius
<=
fDetectionSphereRadius
;
return
((
v3DetectionPoint
-
pDestination
->
v3InteractionPoint
).
GetLength
()
<=
fDetectionSphereRadius
);
//float tDeviationAngle = acos(rRay.GetDir().Dot(v3RayOrigin2RcvPos.GetNormalized()));
//return (abs(v3RayOrigin2RcvPos.GetLength() * sin(tDeviationAngle)) < fDetectionSphereRadius);
return
bInsideSphere
;
}
VistaVector3D
ITAGeoUtils
::
GetReflectedDirection
(
CITAMesh
*
pMesh
,
CITAMesh
::
FaceHandle
hFace
,
const
VistaRay
&
rRay
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment