Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Virtual Acoustics Plugin
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Plugins
Virtual Acoustics Plugin
Commits
50403963
Commit
50403963
authored
1 year ago
by
David Gilbert
Browse files
Options
Downloads
Patches
Plain Diff
Replace deprecated GetComponentsByClass function
parent
97513198
No related branches found
No related tags found
1 merge request
!10
Replace deprecated GetComponentsByClass function
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/VAPlugin/Private/SoundSource/VAAbstractSourceComponent.cpp
+33
-27
33 additions, 27 deletions
...APlugin/Private/SoundSource/VAAbstractSourceComponent.cpp
with
33 additions
and
27 deletions
Source/VAPlugin/Private/SoundSource/VAAbstractSourceComponent.cpp
+
33
−
27
View file @
50403963
...
...
@@ -95,18 +95,19 @@ void UVAAbstractSourceComponent::UpdateSkeletalMeshIfAttachToBone()
bool
bFoundSkelMesh
=
false
;
while
(
!
bFoundSkelMesh
&&
Owner
!=
nullptr
)
{
TArray
<
UActorComponent
*>
MeshComponents
=
Owner
->
GetComponentsByClass
(
USkeletalMeshComponent
::
StaticClass
());
for
(
UActorComponent
*
Component
:
MeshComponents
)
TArray
<
USkeletalMeshComponent
*>
MeshComponents
;
Owner
->
GetComponents
(
MeshComponents
);
for
(
USkeletalMeshComponent
*
Component
:
MeshComponents
)
{
USkeletalMeshComponent
*
MeshComp
=
Cast
<
USkeletalMeshComponent
>
(
Component
);
if
(
MeshComp
&&
MeshComp
->
DoesSocketExist
(
FName
(
*
BoneName
)))
if
(
Component
&&
Component
->
DoesSocketExist
(
FName
(
*
BoneName
)))
{
//found the right mesh component
SkeletalMeshComponent
=
Mesh
Comp
;
SkeletalMeshComponent
=
Comp
onent
;
bFoundSkelMesh
=
true
;
break
;
}
}
Owner
=
Owner
->
GetAttachParentActor
();
}
...
...
@@ -138,7 +139,8 @@ void UVAAbstractSourceComponent::Initialize()
// If no Rec Actor found spawn one with default parameters
if
(
ReceiverActorTmp
==
nullptr
)
{
FVAUtils
::
LogStuff
(
"[UVASourceComponent::BeginPlay()]: No AVAReceiver found! Spawning one with default values"
,
false
);
FVAUtils
::
LogStuff
(
"[UVASourceComponent::BeginPlay()]: No AVAReceiver found! Spawning one with default values"
,
false
);
ReceiverActorTmp
=
this
->
GetWorld
()
->
SpawnActor
<
AVAReceiverActor
>
(
AVAReceiverActor
::
StaticClass
());
}
}
...
...
@@ -151,8 +153,12 @@ void UVAAbstractSourceComponent::Initialize()
{
FVAPlugin
::
SetUseVA
(
false
);
FVAUtils
::
OpenMessageBox
(
"There are more than 1 Receiver Actors in the world. Stopping VAPlugin. Make sure to remove the wrong one."
,
true
);
FVAUtils
::
LogStuff
(
"[UVASourceComponent::BeginPlay()]: More than 1 Receiver found! Stopping VAPlugin. Make sure to remove the wrong one"
,
true
);
FVAUtils
::
OpenMessageBox
(
"There are more than 1 Receiver Actors in the world. Stopping VAPlugin. Make sure to remove the wrong one."
,
true
);
FVAUtils
::
LogStuff
(
"[UVASourceComponent::BeginPlay()]: More than 1 Receiver found! Stopping VAPlugin. Make sure to remove the wrong one"
,
true
);
return
;
}
...
...
@@ -169,9 +175,11 @@ void UVAAbstractSourceComponent::Initialize()
SpawnRotation
=
GetOwner
()
->
GetTransform
().
GetRotation
().
Rotator
();
const
std
::
string
ExplicitRendererID
=
bRendererExplicit
?
std
::
string
(
TCHAR_TO_UTF8
(
*
RendererID
)
)
:
""
;
// Empty ID => general source
const
std
::
string
ExplicitRendererID
=
bRendererExplicit
?
std
::
string
(
TCHAR_TO_UTF8
(
*
RendererID
))
:
""
;
// Empty ID => general source
const
std
::
string
SoundSourceName
=
std
::
string
(
TCHAR_TO_UTF8
(
*
GetName
()));
SoundSource
=
MakeShared
<
FVASoundSource
>
(
GetWorld
(),
GetPosition
(),
GetRotation
(),
SoundPower
,
SoundSourceName
,
ExplicitRendererID
);
SoundSource
=
MakeShared
<
FVASoundSource
>
(
GetWorld
(),
GetPosition
(),
GetRotation
(),
SoundPower
,
SoundSourceName
,
ExplicitRendererID
);
if
(
UVirtualRealityUtilities
::
IsMaster
())
{
...
...
@@ -234,7 +242,8 @@ bool UVAAbstractSourceComponent::SetSignalSourceID(const std::string& SignalSour
{
if
(
!
SoundSource
.
IsValid
())
{
FVAUtils
::
OpenMessageBox
(
FString
(
"[UVASourceComponent::SetSignalSourceID]: VA sound source not initialized"
),
true
);
FVAUtils
::
OpenMessageBox
(
FString
(
"[UVASourceComponent::SetSignalSourceID]: VA sound source not initialized"
),
true
);
return
false
;
}
if
(
!
SoundSource
->
SetSignalSource
(
SignalSourceID
))
...
...
@@ -309,7 +318,6 @@ bool UVAAbstractSourceComponent::GetHandleReflections() const
}
// ****************************************************************** //
// ******* Sound Pose *********************************************** //
// ****************************************************************** //
...
...
@@ -451,7 +459,6 @@ bool UVAAbstractSourceComponent::SetOffsetRotation(const FRotator Rot)
}
// ****************************************************************** //
// ******* Directivity stuff **************************************** //
// ****************************************************************** //
...
...
@@ -516,7 +523,6 @@ FString UVAAbstractSourceComponent::GetDirectivityFileName() const
}
// ****************************************************************** //
// ******* Graphical Representation ********************************* //
// ****************************************************************** //
...
...
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