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
GitLab 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
76d71735
Commit
76d71735
authored
Aug 7, 2020
by
Qurabi
Browse files
Options
Downloads
Patches
Plain Diff
Das Problem, dass man Schwierigkeiten bei Hochgehen einer Rampe hat, ist gelöst.
Allerdings soll nach besserer Lösung gefunden werden.
parent
c3d8b32a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
+9
-14
9 additions, 14 deletions
...e/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
with
9 additions
and
14 deletions
Source/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
+
9
−
14
View file @
76d71735
...
...
@@ -499,7 +499,7 @@ void AVirtualRealityPawn::MoveByGravityOrStepUp(float DeltaSeconds)
{
FVector
StartLineTraceUnderCollider
=
CapsuleColliderComponent
->
GetComponentLocation
();
StartLineTraceUnderCollider
.
Z
-=
CapsuleColliderComponent
->
GetScaledCapsuleHalfHeight
();
FHitResult
HitDetailsMultiLineTrace
=
CreateMultiLineTrace
(
FVector
(
0
,
0
,
-
1
),
StartLineTraceUnderCollider
,
CapsuleColliderComponent
->
GetScaledCapsuleRadius
()
/
2
.0f
,
fals
e
);
FHitResult
HitDetailsMultiLineTrace
=
CreateMultiLineTrace
(
FVector
(
0
,
0
,
-
1
),
StartLineTraceUnderCollider
,
CapsuleColliderComponent
->
GetScaledCapsuleRadius
()
/
4
.0f
,
tru
e
);
float
DiffernceDistance
=
abs
(
MaxStepHeight
-
HitDetailsMultiLineTrace
.
Distance
);
//Going up
if
((
HitDetailsMultiLineTrace
.
bBlockingHit
&&
HitDetailsMultiLineTrace
.
Distance
<
MaxStepHeight
))
...
...
@@ -613,24 +613,19 @@ FHitResult AVirtualRealityPawn::CreateMultiLineTrace(FVector Direction, const FV
OutHits
.
Add
(
CreateLineTrace
(
Direction
,
Vector
,
Visibility
));
}
FHitResult
HitDetails
WithSmallestDistance
=
OutHits
[
0
];
bool
IsBlockingHitAndSameActor
=
HitDetails
WithSmallestDistance
.
bBlockingHit
;
TWeakObjectPtr
<
class
AActor
>
HitFirstActor
=
HitDetailsWithSmallestDistance
.
Acto
r
;
FHitResult
First
HitDetails
=
OutHits
[
0
];
bool
IsBlockingHitAndSameActor
=
First
HitDetails
.
bBlockingHit
;
bool
IsAllNothingHiting
=
FirstHitDetails
.
Actor
==
nullpt
r
;
FVector
CurrentCameraPosition
=
CameraComponent
->
GetComponentLocation
();
for
(
FHitResult
&
Hit
:
OutHits
)
{
IsBlockingHitAndSameActor
&=
(
Hit
.
Actor
!=
nullptr
)
&&
(
Hit
.
Actor
==
HitFirstActor
);
if
(
IsBlockingHitAndSameActor
)
{
if
(
Hit
.
Distance
<
HitDetailsWithSmallestDistance
.
Distance
)
{
HitDetailsWithSmallestDistance
=
Hit
;
}
}
IsBlockingHitAndSameActor
&=
(
Hit
.
Actor
==
FirstHitDetails
.
Actor
);
//If all Hiting the same Object, then you are going up/down
IsAllNothingHiting
&=
(
Hit
.
Actor
==
nullptr
);
//If all Hiting nothing, then you are falling
}
if
(
IsBlockingHitAndSameActor
)
HitDetailsMultiLineTrace
=
HitDetails
WithSmallestDistance
;
if
(
IsBlockingHitAndSameActor
||
IsAllNothingHiting
)
HitDetailsMultiLineTrace
=
First
HitDetails
;
return
HitDetailsMultiLineTrace
;
}
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