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
0b5fd620
Commit
0b5fd620
authored
Jul 17, 2020
by
Qurabi
Browse files
Options
Downloads
Patches
Plain Diff
CapsulMesh gelöscht, da dies zum Testen war.
Ein paar Zeile Kommentiert. Den Code an Unreal Style angespasst.
parent
ca3dd2bf
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
+10
-5
10 additions, 5 deletions
...e/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
+0
-1
0 additions, 1 deletion
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
with
10 additions
and
6 deletions
Source/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
+
10
−
5
View file @
0b5fd620
...
...
@@ -308,10 +308,12 @@ void AVirtualRealityPawn::SetCapsuleColliderCharacterSizeVR()
{
float
ColliderHeight
=
CharachterSize
-
MaxStepHeight
;
float
ColliderHalfHeight
=
ColliderHeight
/
2.0f
;
if
(
ColliderHalfHeight
<
40.0f
)
{
if
(
ColliderHalfHeight
<
40.0f
)
{
//Collider is an Sphere
CapsuleColliderComponent
->
SetCapsuleSize
(
ColliderHalfHeight
,
ColliderHalfHeight
);
}
else
{
else
{
CapsuleColliderComponent
->
SetCapsuleSize
(
40.0f
,
ColliderHalfHeight
);
}
...
...
@@ -334,7 +336,8 @@ void AVirtualRealityPawn::PhysWolkingMode()
FHitResult
FHitResultPhys
;
CapsuleColliderComponent
->
AddWorldOffset
(
Direction
,
true
,
&
FHitResultPhys
);
if
(
FHitResultPhys
.
bBlockingHit
)
{
if
(
FHitResultPhys
.
bBlockingHit
)
{
RootComponent
->
AddLocalOffset
(
FHitResultPhys
.
Normal
*
FHitResultPhys
.
PenetrationDepth
);
}
}
...
...
@@ -370,7 +373,7 @@ void AVirtualRealityPawn::VRClimbStepUp(float DeltaSeconds)
FHitResult
HitDetailsMultiLineTrace
=
CreateMultiLineTrace
(
FVector
(
0
,
0
,
-
1
),
StartLineTraceUnderCollider
,
CapsuleColliderComponent
->
GetScaledCapsuleRadius
()
/
2.0f
,
false
);
float
DiffernceDistance
=
abs
(
MaxStepHeight
-
HitDetailsMultiLineTrace
.
Distance
);
static
float
SumUpSteppingSpeed
=
0.0f
;
//Going up
if
((
HitDetailsMultiLineTrace
.
bBlockingHit
&&
HitDetailsMultiLineTrace
.
Distance
<
MaxStepHeight
))
{
SumUpSteppingSpeed
+=
UpSteppingSpeed
*
DeltaSeconds
;
...
...
@@ -383,6 +386,7 @@ void AVirtualRealityPawn::VRClimbStepUp(float DeltaSeconds)
RootComponent
->
AddLocalOffset
(
FVector
(
0.f
,
0.f
,
+
DiffernceDistance
));
}
}
//Falling, Gravity, Going down
else
if
((
HitDetailsMultiLineTrace
.
bBlockingHit
&&
HitDetailsMultiLineTrace
.
Distance
>
MaxStepHeight
)
||
HitDetailsMultiLineTrace
.
Actor
==
nullptr
&&
HitDetailsMultiLineTrace
.
Distance
!=
-
1.0f
)
{
GravitySpeed
-=
1000.0f
*
DeltaSeconds
;
...
...
@@ -395,6 +399,7 @@ void AVirtualRealityPawn::VRClimbStepUp(float DeltaSeconds)
RootComponent
->
AddLocalOffset
(
FVector
(
0.f
,
0.f
,
-
DiffernceDistance
));
}
}
//Going on the ground
else
{
GravitySpeed
=
0.0f
;
...
...
@@ -464,7 +469,7 @@ FHitResult AVirtualRealityPawn::CreateLineTrace(FVector Direction, const FVector
FHitResult
AVirtualRealityPawn
::
CreateMultiLineTrace
(
FVector
Direction
,
const
FVector
Start
,
float
distance
,
bool
Visibility
)
{
FHitResult
HitDetailsMultiLineTrace
;
HitDetailsMultiLineTrace
.
Distance
=
-
1.0f
;
//-1 not exist, but to know if this Objekt not Initialized(when all Traces not compatible)
HitDetailsMultiLineTrace
.
Distance
=
-
1.0f
;
//
(Distance=
-1
)
not exist
ing
, but to know if this Objekt not Initialized(when all Traces not compatible)
FHitResult
HitDetailsFromLineTraceCenter
=
CreateLineTrace
(
Direction
,
Start
,
Visibility
);
FHitResult
HitDetailsFromLineTraceLeft
=
CreateLineTrace
(
Direction
,
Start
+
FVector
(
0
,
-
distance
,
0
),
Visibility
);
...
...
This diff is collapsed.
Click to expand it.
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
+
0
−
1
View file @
0b5fd620
...
...
@@ -116,7 +116,6 @@ protected:
UPROPERTY
(
EditAnywhere
,
BlueprintReadWrite
,
Category
=
"Pawn"
)
EAttachementType
AttachLeftHandInCAVE
=
EAttachementType
::
AT_NONE
;
UPROPERTY
(
VisibleAnywhere
,
BlueprintReadOnly
,
Category
=
"Pawn"
,
meta
=
(
AllowPrivateAccess
=
"true"
))
UCapsuleComponent
*
CapsuleColliderComponent
=
nullptr
;
UStaticMeshComponent
*
CapsuleMesh
;
private:
float
DeltaTime
=
0.0f
;
float
GravitySpeed
=
0.0f
;
...
...
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