Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gaze-study
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Rings, Sebastian Reiner
gaze-study
Commits
9e3530cc
Commit
9e3530cc
authored
3 years ago
by
Unknown
Browse files
Options
Downloads
Patches
Plain Diff
change ActionHandler to work if Ball is 10cm away
parent
ef7911bd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Assets/Scripts/ActionHandler.cs
+16
-0
16 additions, 0 deletions
Assets/Scripts/ActionHandler.cs
with
16 additions
and
0 deletions
Assets/Scripts/ActionHandler.cs
+
16
−
0
View file @
9e3530cc
...
@@ -118,6 +118,22 @@ public class ActionHandler : MonoBehaviour
...
@@ -118,6 +118,22 @@ public class ActionHandler : MonoBehaviour
// Activate target on pickup
// Activate target on pickup
TouchPress
(
fromAction
,
fromSource
);
TouchPress
(
fromAction
,
fromSource
);
}
}
else
{
// Check if Ball is close
var
dist
=
Vector3
.
Distance
(
BallSnapPos
.
transform
.
position
,
Ball
.
transform
.
position
);
// If less than 10cm to Ball, attach it anyway.
if
(
dist
<=
0.10f
)
{
collidingObject
=
Ball
;
HoldGameObj
(
collidingObject
);
//call Hold Ball Method
SysTimeTriggerpress
=
DateTimeOffset
.
UtcNow
.
ToUnixTimeMilliseconds
().
ToString
();
//Timestamp saved when trigger got pressed
// Activate target on pickup
TouchPress
(
fromAction
,
fromSource
);
}
}
}
}
public
void
TouchPress
(
SteamVR_Action_Boolean
fromAction
,
SteamVR_Input_Sources
fromSource
)
//when touchpad gets clicked, this method gets called
public
void
TouchPress
(
SteamVR_Action_Boolean
fromAction
,
SteamVR_Input_Sources
fromSource
)
//when touchpad gets clicked, this method gets called
...
...
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