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
bae1f6a8
Commit
bae1f6a8
authored
May 27, 2020
by
Qurabi
Browse files
Options
Downloads
Patches
Plain Diff
Das physikalische Gehen ist fertig.
parent
04fccf59
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
+16
-11
16 additions, 11 deletions
...e/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
+1
-1
1 addition, 1 deletion
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
with
17 additions
and
12 deletions
Source/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
+
16
−
11
View file @
bae1f6a8
...
...
@@ -363,17 +363,22 @@ void AVirtualRealityPawn::Tick(float DeltaSeconds)
Super
::
Tick
(
DeltaSeconds
);
MyDeltaSeconds
=
DeltaSeconds
;
SetCapsuleColliderCharacterSizeVR
();
//if (IsColliderOnGround()&&IsPhysMoving) {
// FVector CurrentCameraPosition = GetCameraComponent()->GetComponentLocation();
// FVector DirectionVector = CurrentCameraPosition - LastCameraPosition;
// DirectionVector.Z = 0.0f;
// FHitResult FHitResultPhys;
// CapsuleColliderComponent->AddWorldOffset(DirectionVector, true, &FHitResultPhys);
// if (FHitResultPhys.bBlockingHit) {
// RootComponent->SetWorldLocation(LastPawnPosition, true);
// }
//
//}
if
(
IsColliderOnGround
())
{
FVector
CurrentCameraPosition
=
GetCameraComponent
()
->
GetComponentLocation
();
FVector
DirectionVector
=
CurrentCameraPosition
-
LastCameraPosition
;
DirectionVector
.
Z
=
0.0f
;
FHitResult
FHitResultPhys
;
CapsuleColliderComponent
->
AddWorldOffset
(
DirectionVector
,
true
,
&
FHitResultPhys
);
if
(
FVector
::
Distance
(
FHitResultPhys
.
ImpactPoint
,
CapsuleColliderComponent
->
GetComponentLocation
())
<
CapsuleColliderComponent
->
GetScaledCapsuleRadius
())
{
FVector
DiffFHitResultPhysLocationAndCapsuleCollider
=
FHitResultPhys
.
ImpactPoint
-
CapsuleColliderComponent
->
GetComponentLocation
();
float
InsideDistance
=
CapsuleColliderComponent
->
GetScaledCapsuleRadius
()
-
FVector
::
Distance
(
FHitResultPhys
.
ImpactPoint
,
CapsuleColliderComponent
->
GetComponentLocation
());
RootComponent
->
AddLocalOffset
(
DiffFHitResultPhysLocationAndCapsuleCollider
.
GetSafeNormal
()
*
InsideDistance
*
DeltaSeconds
,
true
);
}
}
PhysMoving
(
DeltaSeconds
);
...
...
This diff is collapsed.
Click to expand it.
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
+
1
−
1
View file @
bae1f6a8
...
...
@@ -132,7 +132,7 @@ private:
float
GravitySpeed
=
0.0f
;
bool
IsPhysMoving
=
false
;
FHitResult
CreateLineTrace
(
FVector
Direction
,
const
FVector
Start
,
bool
Visibility
);
float
NewRadius
=
32
.0f
;
FVector
LastCameraPosition
;
FVector
LastPawnPosition
;
float
NewRadius
=
40
.0f
;
FVector
LastCameraPosition
;
FVector
LastPawnPosition
;
float
ColliderHalfHight
=
96.0f
;
FHitResult
HitResults
;
FHitResult
HitResultsPhysicaly
;
float
MyDeltaSeconds
=
0.0f
;
void
SetCapsuleColliderCharacterSizeVR
();
void
PhysMoving
(
float
DeltaTime
);
bool
IsColliderOnGround
();
void
VRClimbStepUp
(
float
DeltaTime
);
void
InitRoomMountedComponentReferences
();
...
...
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