Skip to content

Commit 82a5e19

Browse files
committed
final
1 parent 1708594 commit 82a5e19

49 files changed

Lines changed: 3717 additions & 38 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

void-nexus/Assets/Bhaptics/SDK2/Resources/BhapticsSettings.asset

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

void-nexus/Assets/IK Haptic/HandLookat.cs

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public class HandLookat : MonoBehaviour
1212
[SerializeField] private bool isHand;
1313
[SerializeField] private Vector3 rotationOffset;
1414
[SerializeField] private Transform rig;
15-
[Range(0, 360)] public float targetZAngle;
1615
public Transform objectB; // Îáúåêò B, ê êîòîðîìó áóäåò íàïðàâëåíà îñü Z îáúåêòà A
1716
public Transform objectC; // Îáúåêò C, ê êîòîðîìó áóäåò íàïðàâëåíà îñü Y îáúåêòà A
1817

@@ -29,13 +28,37 @@ void Update()
2928
{
3029
if ((!space._LgrabbingActive && left))
3130
{
32-
Vector3 pos = (head.position + offset) - transform.position;
33-
transform.rotation = Quaternion.LookRotation(pos);
31+
// Íàïðàâëåíèå îò îáúåêòà A ê îáúåêòó B (îñü Z)
32+
Vector3 directionToB = (objectB.position - transform.position).normalized;
33+
34+
// Íàïðàâëåíèå îò îáúåêòà A ê îáúåêòó C (îñü Y)
35+
Vector3 directionToC = (objectC.position - transform.position).normalized;
36+
37+
// Âû÷èñëÿåì ïåðïåíäèêóëÿðíîå íàïðàâëåíèå äëÿ îñè X
38+
Vector3 right = Vector3.Cross(directionToC, directionToB).normalized;
39+
40+
// Êîððåêòèðóåì íàïðàâëåíèå îñè Y, ÷òîáû îíî áûëî ïåðïåíäèêóëÿðíî îñè Z è X
41+
Vector3 correctedUp = Vector3.Cross(directionToB, right).normalized;
42+
43+
// Ñîçäàåì ïîâîðîò íà îñíîâå íàïðàâëåíèÿ âïåðåä (ê îáúåêòó B) è íàïðàâëåíèÿ ââåðõ (ê îáúåêòó C)
44+
transform.rotation = Quaternion.LookRotation(directionToB, correctedUp) * Quaternion.Euler(rotationOffset);
3445
}
3546
if ((!space._RgrabbingActive && !left))
3647
{
37-
Vector3 pos = (head.position + offset) - transform.position;
38-
transform.rotation = Quaternion.LookRotation(pos);
48+
// Íàïðàâëåíèå îò îáúåêòà A ê îáúåêòó B (îñü Z)
49+
Vector3 directionToB = (objectB.position - transform.position).normalized;
50+
51+
// Íàïðàâëåíèå îò îáúåêòà A ê îáúåêòó C (îñü Y)
52+
Vector3 directionToC = (objectC.position - transform.position).normalized;
53+
54+
// Âû÷èñëÿåì ïåðïåíäèêóëÿðíîå íàïðàâëåíèå äëÿ îñè X
55+
Vector3 right = Vector3.Cross(directionToC, directionToB).normalized;
56+
57+
// Êîððåêòèðóåì íàïðàâëåíèå îñè Y, ÷òîáû îíî áûëî ïåðïåíäèêóëÿðíî îñè Z è X
58+
Vector3 correctedUp = Vector3.Cross(directionToB, right).normalized;
59+
60+
// Ñîçäàåì ïîâîðîò íà îñíîâå íàïðàâëåíèÿ âïåðåä (ê îáúåêòó B) è íàïðàâëåíèÿ ââåðõ (ê îáúåêòó C)
61+
transform.rotation = Quaternion.LookRotation(directionToB, correctedUp) * Quaternion.Euler(rotationOffset);
3962
}
4063
}
4164
else
@@ -55,12 +78,6 @@ void Update()
5578
// Ñîçäàåì ïîâîðîò íà îñíîâå íàïðàâëåíèÿ âïåðåä (ê îáúåêòó B) è íàïðàâëåíèÿ ââåðõ (ê îáúåêòó C)
5679
transform.rotation = Quaternion.LookRotation(directionToB, correctedUp) * Quaternion.Euler(rotationOffset);
5780

58-
/*Vector3 pos = (head.position + offset) - transform.position;
59-
transform.rotation = Quaternion.LookRotation(pos) * Quaternion.Euler(rotationOffset);
60-
61-
transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, targetZAngle);*/
62-
63-
6481
}
6582

6683
}

void-nexus/Assets/IK Haptic/Materials.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

void-nexus/Assets/IK Haptic/Materials/Hands.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!21 &2100000
4+
Material:
5+
serializedVersion: 8
6+
m_ObjectHideFlags: 0
7+
m_CorrespondingSourceObject: {fileID: 0}
8+
m_PrefabInstance: {fileID: 0}
9+
m_PrefabAsset: {fileID: 0}
10+
m_Name: Black
11+
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
12+
m_Parent: {fileID: 0}
13+
m_ModifiedSerializedProperties: 0
14+
m_ValidKeywords:
15+
- _METALLICGLOSSMAP
16+
- _NORMALMAP
17+
- _SPECGLOSSMAP
18+
m_InvalidKeywords: []
19+
m_LightmapFlags: 4
20+
m_EnableInstancingVariants: 0
21+
m_DoubleSidedGI: 0
22+
m_CustomRenderQueue: -1
23+
stringTagMap: {}
24+
disabledShaderPasses: []
25+
m_LockedProperties:
26+
m_SavedProperties:
27+
serializedVersion: 3
28+
m_TexEnvs:
29+
- _BumpMap:
30+
m_Texture: {fileID: 2800000, guid: 1e1978a5f4abdf84fb400a4e91425298, type: 3}
31+
m_Scale: {x: 1, y: 1}
32+
m_Offset: {x: 0, y: 0}
33+
- _DetailAlbedoMap:
34+
m_Texture: {fileID: 0}
35+
m_Scale: {x: 1, y: 1}
36+
m_Offset: {x: 0, y: 0}
37+
- _DetailMask:
38+
m_Texture: {fileID: 0}
39+
m_Scale: {x: 1, y: 1}
40+
m_Offset: {x: 0, y: 0}
41+
- _DetailNormalMap:
42+
m_Texture: {fileID: 0}
43+
m_Scale: {x: 1, y: 1}
44+
m_Offset: {x: 0, y: 0}
45+
- _EmissionMap:
46+
m_Texture: {fileID: 0}
47+
m_Scale: {x: 1, y: 1}
48+
m_Offset: {x: 0, y: 0}
49+
- _MainTex:
50+
m_Texture: {fileID: 2800000, guid: 7cb4dcce2ff505d46817ae5b56998b92, type: 3}
51+
m_Scale: {x: 1, y: 1}
52+
m_Offset: {x: 0, y: 0}
53+
- _MetallicGlossMap:
54+
m_Texture: {fileID: 2800000, guid: 38ae186e2f5db8c4ba6db0f08349e3db, type: 3}
55+
m_Scale: {x: 1, y: 1}
56+
m_Offset: {x: 0, y: 0}
57+
- _OcclusionMap:
58+
m_Texture: {fileID: 0}
59+
m_Scale: {x: 1, y: 1}
60+
m_Offset: {x: 0, y: 0}
61+
- _ParallaxMap:
62+
m_Texture: {fileID: 0}
63+
m_Scale: {x: 1, y: 1}
64+
m_Offset: {x: 0, y: 0}
65+
- _SpecGlossMap:
66+
m_Texture: {fileID: 2800000, guid: f2e5061e6f94ef746a09e704d5e8a61a, type: 3}
67+
m_Scale: {x: 1, y: 1}
68+
m_Offset: {x: 0, y: 0}
69+
m_Ints: []
70+
m_Floats:
71+
- _BumpScale: 1
72+
- _Cutoff: 0.5
73+
- _DetailNormalMapScale: 1
74+
- _DstBlend: 0
75+
- _GlossMapScale: 1
76+
- _Glossiness: 0.5
77+
- _GlossyReflections: 1
78+
- _Metallic: 0
79+
- _Mode: 0
80+
- _OcclusionStrength: 1
81+
- _Parallax: 0.02
82+
- _SmoothnessTextureChannel: 0
83+
- _SpecularHighlights: 1
84+
- _SrcBlend: 1
85+
- _UVSec: 0
86+
- _ZWrite: 1
87+
m_Colors:
88+
- _Color: {r: 1, g: 1, b: 1, a: 1}
89+
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
90+
m_BuildTextureStacks: []

void-nexus/Assets/IK Haptic/Materials/Hands/Black.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
343 KB
Loading

void-nexus/Assets/IK Haptic/Materials/Hands/Paint___Metallic__Dark_Grey__AO.jpeg.meta

Lines changed: 153 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
354 KB
Loading

0 commit comments

Comments
 (0)