Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RWTH VR Toolkit
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
Container 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
RWTH VR Toolkit
Commits
75b578ca
Commit
75b578ca
authored
1 month ago
by
David Gilbert
Browse files
Options
Downloads
Patches
Plain Diff
fix(replication): Makes ClientTransformReplication use relative position and rotation.
parent
b82a2022
Branches
Branches containing commit
No related tags found
1 merge request
!113
Pull dev/5.4 changes into dev/5.5
Pipeline
#554930
passed
1 month ago
Stage: analyze
Stage: generate
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/RWTHVRToolkit/Private/Core/ClientTransformReplication.cpp
+2
-2
2 additions, 2 deletions
...RWTHVRToolkit/Private/Core/ClientTransformReplication.cpp
Source/RWTHVRToolkit/Public/Core/ClientTransformReplication.h
+4
-1
4 additions, 1 deletion
...ce/RWTHVRToolkit/Public/Core/ClientTransformReplication.h
with
6 additions
and
3 deletions
Source/RWTHVRToolkit/Private/Core/ClientTransformReplication.cpp
+
2
−
2
View file @
75b578ca
...
...
@@ -26,8 +26,8 @@ void UClientTransformReplication::UpdateState(float DeltaTime)
// Only do this if we actually replicate the actor
if
(
GetIsReplicated
())
{
const
FVector
Loc
=
OwningActor
->
Get
Actor
Location
();
const
FRotator
Rot
=
OwningActor
->
Get
Actor
Rotation
();
const
FVector
Loc
=
OwningActor
->
Get
RootComponent
()
->
GetRelative
Location
();
const
FRotator
Rot
=
OwningActor
->
Get
RootComponent
()
->
GetRelative
Rotation
();
// Only update state if the local state changed
if
(
!
Loc
.
Equals
(
ReplicatedTransform
.
Position
)
||
!
Rot
.
Equals
(
ReplicatedTransform
.
Rotation
))
...
...
This diff is collapsed.
Click to expand it.
Source/RWTHVRToolkit/Public/Core/ClientTransformReplication.h
+
4
−
1
View file @
75b578ca
...
...
@@ -56,7 +56,10 @@ protected:
// For now, directly apply the transforms:
auto
*
OwningActor
=
GetOwner
();
if
(
OwningActor
&&
OwningActor
->
HasValidRootComponent
())
OwningActor
->
SetActorLocationAndRotation
(
ReplicatedTransform
.
Position
,
ReplicatedTransform
.
Rotation
);
{
OwningActor
->
SetActorRelativeLocation
(
ReplicatedTransform
.
Position
);
OwningActor
->
SetActorRelativeRotation
(
ReplicatedTransform
.
Rotation
);
}
}
// Unreliable Server RPC that sends the transform from owning client to the server
...
...
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