Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
MoVR
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
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Halvor Bakken Smedås
MoVR
Commits
0a091541
Commit
0a091541
authored
6 years ago
by
Halvor Bakken Smedås
Browse files
Options
Downloads
Patches
Plain Diff
Better hand position mapping
parent
0cbfe3a0
No related branches found
No related tags found
1 merge request
!1
Vr rigged
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Assets/Scripts/IKHandler.cs
+5
-4
5 additions, 4 deletions
Assets/Scripts/IKHandler.cs
with
5 additions
and
4 deletions
Assets/Scripts/IKHandler.cs
+
5
−
4
View file @
0a091541
...
@@ -9,6 +9,7 @@ public class IKHandler : MonoBehaviour
...
@@ -9,6 +9,7 @@ public class IKHandler : MonoBehaviour
public
float
IK_weight
=
1
;
public
float
IK_weight
=
1
;
public
Vector3
handOffset
=
new
Vector3
();
public
Transform
root
;
public
Transform
root
;
public
Transform
IK_targetLeftFoot
;
public
Transform
IK_targetLeftFoot
;
...
@@ -37,14 +38,14 @@ public class IKHandler : MonoBehaviour
...
@@ -37,14 +38,14 @@ public class IKHandler : MonoBehaviour
animator
.
SetIKPositionWeight
(
AvatarIKGoal
.
LeftHand
,
IK_weight
);
animator
.
SetIKPositionWeight
(
AvatarIKGoal
.
LeftHand
,
IK_weight
);
animator
.
SetIKPositionWeight
(
AvatarIKGoal
.
RightHand
,
IK_weight
);
animator
.
SetIKPositionWeight
(
AvatarIKGoal
.
RightHand
,
IK_weight
);
animator
.
SetIKPosition
(
AvatarIKGoal
.
LeftHand
,
IK_targetLeftHand
.
position
);
animator
.
SetIKPosition
(
AvatarIKGoal
.
LeftHand
,
IK_targetLeftHand
.
position
+
IK_targetLeftHand
.
TransformVector
(
handOffset
)
);
animator
.
SetIKPosition
(
AvatarIKGoal
.
RightHand
,
IK_targetRightHand
.
position
);
animator
.
SetIKPosition
(
AvatarIKGoal
.
RightHand
,
IK_targetRightHand
.
position
+
IK_targetRightHand
.
TransformVector
(
handOffset
)
);
//ROTATION
//ROTATION
animator
.
SetIKRotationWeight
(
AvatarIKGoal
.
LeftHand
,
IK_weight
);
animator
.
SetIKRotationWeight
(
AvatarIKGoal
.
LeftHand
,
IK_weight
);
animator
.
SetIKRotationWeight
(
AvatarIKGoal
.
RightHand
,
IK_weight
);
animator
.
SetIKRotationWeight
(
AvatarIKGoal
.
RightHand
,
IK_weight
);
animator
.
SetIKRotation
(
AvatarIKGoal
.
LeftHand
,
IK_targetLeftHand
.
rotation
*
Quaternion
.
Euler
(
0
,
0
,
90
));
animator
.
SetIKRotation
(
AvatarIKGoal
.
LeftHand
,
IK_targetLeftHand
.
rotation
*
Quaternion
.
Euler
(
3
0
,
1
0
,
90
));
animator
.
SetIKRotation
(
AvatarIKGoal
.
RightHand
,
IK_targetRightHand
.
rotation
*
Quaternion
.
Euler
(
0
,
0
,
-
90
));
animator
.
SetIKRotation
(
AvatarIKGoal
.
RightHand
,
IK_targetRightHand
.
rotation
*
Quaternion
.
Euler
(
3
0
,
1
0
,
-
90
));
//animator.SetBoneLocalRotation(HumanBodyBones.LeftHand, IK_targetLeftHand.rotation);
//animator.SetBoneLocalRotation(HumanBodyBones.LeftHand, IK_targetLeftHand.rotation);
...
...
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