version 2.5.0

This commit is contained in:
Sean Lu
2025-01-10 17:17:03 +08:00
parent ddc3c4c6d8
commit 2372c9429a
1086 changed files with 290974 additions and 77367 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 54ec593a7497fdc41959fdae3b3516a7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 48975db9205d6304583fcf982c242e32
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 49df4f9d6bb4e564c966f39cd84303c1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,80 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ctrl_Battery
m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 081534a469226b94996f8a2a9c78be61, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 23da0c069ecaa0043a5b34d93901e0af
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,85 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: _DEFAULT_MTL
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 4f95bdb8d6c0a634997aeced88e52640, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.9063317, g: 0.9063317, b: 0.9063317, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1c9d256427720f8449c1ec38a2c1767b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7ea45dcb24599334cb37afc893dae3a8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: 1205485f8d5139f4f9d09bed56cc014d
ModelImporter:
serializedVersion: 21300
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Default_Material
second: {fileID: 2100000, guid: 1c9d256427720f8449c1ec38a2c1767b, type: 2}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 1
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: 4c587de662ad31e458a63282cb358c4f
ModelImporter:
serializedVersion: 21300
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Default_Material
second: {fileID: 2100000, guid: 1c9d256427720f8449c1ec38a2c1767b, type: 2}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 1
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7476d95fa4ccbb44685b5df06546b1b9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

View File

@@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 081534a469226b94996f8a2a9c78be61
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 128
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

View File

@@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 4f95bdb8d6c0a634997aeced88e52640
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,118 @@
// Copyright HTC Corporation All Rights Reserved.
using System.Text;
using UnityEngine;
using UnityEngine.InputSystem;
namespace VIVE.OpenXR.Models
{
public class ControllerModelActions : MonoBehaviour
{
#region Log
const string LOG_TAG = "VIVE.OpenXR.Models.ControllerModelActions";
StringBuilder m_sb = null;
StringBuilder sb {
get {
if (m_sb == null) { m_sb = new StringBuilder(); }
return m_sb;
}
}
void DEBUG(StringBuilder msg) { Debug.LogFormat("{0} {1}", LOG_TAG, msg); }
void ERROR(StringBuilder msg) { Debug.LogErrorFormat("{0} {1}", LOG_TAG, msg); }
#endregion
#region Inspector
public bool isLeft = false;
public GameObject triggerButton = null;
public GameObject gripButton = null;
public GameObject thumbstickButton = null;
public GameObject primaryButton = null;
public GameObject secondaryButton = null;
public InputAction trigger = null;
public InputAction grip = null;
public InputAction thumbstick = null;
public InputAction primaryClick = null;
public InputAction secondaryClick = null;
#endregion
private Quaternion triggerRot = Quaternion.identity;
private Vector3 gripButtonPos = Vector3.zero;
private Vector3 primaryButtonPos = Vector3.zero;
private Vector3 secondaryButtonPos = Vector3.zero;
void Start()
{
if (triggerButton != null) { triggerRot = triggerButton.transform.localRotation; }
if (gripButton != null) { gripButtonPos = gripButton.transform.localPosition; }
if (primaryButton != null) { primaryButtonPos = primaryButton.transform.localPosition; }
if (secondaryButton != null) { secondaryButtonPos = secondaryButton.transform.localPosition; }
if (trigger != null) { trigger.Enable(); }
if (grip != null) { grip.Enable(); }
if (thumbstick != null) { thumbstick.Enable(); }
if (primaryClick != null) { primaryClick.Enable(); }
if (secondaryClick != null) { secondaryClick.Enable(); }
}
void Update()
{
OnTrigger();
OnGrip();
OnThumbstick();
OnPrimaryClick();
OnSecondaryClick();
}
void OnTrigger()
{
if (OpenXRHelper.GetAnalog(trigger, out float value, out string msg))
{
triggerButton.transform.localRotation = Quaternion.Euler(value * 15f, 0, 0);
}
else
{
triggerButton.transform.localRotation = triggerRot;
}
}
void OnGrip()
{
if (OpenXRHelper.GetAnalog(grip, out float value, out string msg))
{
if (isLeft)
gripButton.transform.localPosition = gripButtonPos + Vector3.right * value * -0.002f;
else
gripButton.transform.localPosition = gripButtonPos + Vector3.left * value * -0.002f;
}
}
void OnThumbstick()
{
if (OpenXRHelper.GetVector2(thumbstick, out Vector2 value, out string msg))
{
thumbstickButton.transform.localRotation = Quaternion.Euler(value.y * 25f, 0, value.x * -25f);
}
}
void OnPrimaryClick()
{
if (OpenXRHelper.GetAnalog(primaryClick, out float value, out string msg))
{
primaryButton.transform.localPosition = primaryButtonPos + Vector3.down * (value > 0.5f ? 0.00125f : 0);
}
else
{
primaryButton.transform.localPosition = primaryButtonPos;
}
}
void OnSecondaryClick()
{
if (OpenXRHelper.GetAnalog(secondaryClick, out float value, out string msg))
{
secondaryButton.transform.localPosition = secondaryButtonPos + Vector3.down * (value > 0.5f ? 0.00125f : 0);
}
else
{
secondaryButton.transform.localPosition = secondaryButtonPos;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7b221715b73f1a540b587cae4af7fcb8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a77c8c057fb45da43b3513228731089c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 92041f31dc9416b48a2029c48c6b6ffc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: 55e3f88cac20c634690f1452306eb523
ModelImporter:
serializedVersion: 21300
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Default_Material
second: {fileID: 2100000, guid: dc999998687fce943a2d62982cf3bb17, type: 2}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 1
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bb909cdbffc4cdc40887c53baeb6db76
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Hand
m_Shader: {fileID: 4800000, guid: 1fe62d92a6498bd41994b44944d6b552, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaText:
m_Texture: {fileID: 2800000, guid: 76d4d2bc58547df45ab8ef0ed359a9f4, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Gradient_Blur: 0.2854134
- _Gradient_level: 0.5225084
- _Opacity: 0.45
- _OutlineThickness: 0.001
- __dirty: 1
- _line_opacity: 0.5
m_Colors:
- _ConColorA: {r: 0.1058824, g: 0.6901961, b: 0.9019608, a: 0}
- _ConColorB: {r: 1, g: 1, b: 1, a: 0}
- _ConGraColorA: {r: 1, g: 1, b: 1, a: 0}
- _ConGraColorB: {r: 1, g: 1, b: 1, a: 0}
- _GraColorA: {r: 1, g: 1, b: 1, a: 0}
- _GraColorB: {r: 1, g: 1, b: 1, a: 0}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dc999998687fce943a2d62982cf3bb17
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
fileFormatVersion: 2
guid: 5c9af3a1eed9bfd4884f627bc8417ae6
ModelImporter:
serializedVersion: 21300
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Default_Material
second: {fileID: 2100000, guid: dc999998687fce943a2d62982cf3bb17, type: 2}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 1
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6541b1cca7e65874aa164f80c6f23143
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,116 @@
// Made with Amplify Shader Editor
Shader "Wave/Essence/Hand/Model"
{
Properties
{
[HDR]_GraColorA("GradianColorA", Color) = (0.1058824,0.6901961,0.9019608,0)
[HDR]_GraColorB("GradianColorB", Color) = (1,1,1,0)
[HDR]_ConGraColorA("ContourColorA", Color) = (0.1058824,0.6901961,0.9019608,0)
[HDR]_ConGraColorB("ContourColorB", Color) = (1,1,1,0)
_Gradient_Blur("Gradient_Blur", Range(0 , 1)) = 0.2854134
_Gradient_level("Gradient_level", Range(0 , 1)) = 0.5225084
_Opacity("Opacity", Range(0 , 1)) = 0.45
_line_opacity("line_opacity", Range(0 , 1)) = 0.5
_OutlineThickness("OutlineThickness", Range(0 , 0.002)) = 0.001
_AlphaText("AlphaText", 2D) = "white" {}
[HideInInspector] _texcoord3("", 2D) = "white" {}
[HideInInspector] _texcoord("", 2D) = "white" {}
[HideInInspector] __dirty("", Int) = 1
}
SubShader
{
Pass
{
ColorMask 0
ZWrite On
}
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0"}
Cull Front
CGPROGRAM
#pragma target 3.0
#pragma surface outlineSurf Outline nofog alpha:fade keepalpha noshadow noambient novertexlights nolightmap nodynlightmap nodirlightmap nometa noforwardadd vertex:outlineVertexDataFunc
struct Input
{
float2 uv3_texcoord3;
float2 uv_texcoord;
};
uniform float _OutlineThickness;
uniform float4 _ConGraColorA;
uniform float4 _ConGraColorB;
uniform float _Gradient_level;
uniform float _Gradient_Blur;
uniform float _line_opacity;
uniform sampler2D _AlphaText;
void outlineVertexDataFunc(inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
float outlineVar = _OutlineThickness;
v.vertex.xyz += (v.normal * outlineVar);
}
inline half4 LightingOutline(SurfaceOutput s, half3 lightDir, half atten) { return half4 (0,0,0, s.Alpha); }
void outlineSurf(Input i, inout SurfaceOutput o)
{
float clampResult114 = clamp((_Gradient_level + ((_Gradient_level - i.uv3_texcoord3.y) / _Gradient_Blur)) , 0.0 , 1.0);
float4 lerpResult100 = lerp(_ConGraColorA, _ConGraColorB, clampResult114);
float4 tex2DNode92 = tex2D(_AlphaText, i.uv_texcoord);
o.Emission = lerpResult100.rgb;
o.Alpha = (_line_opacity * tex2DNode92).r;
}
ENDCG
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma target 3.0
#pragma surface surf Unlit keepalpha noshadow vertex:vertexDataFunc
struct Input
{
float2 uv3_texcoord3;
float2 uv_texcoord;
};
uniform float4 _GraColorA;
uniform float4 _GraColorB;
uniform float _Gradient_level;
uniform float _Gradient_Blur;
uniform float _Opacity;
uniform sampler2D _AlphaText;
void vertexDataFunc(inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
v.vertex.xyz += 0;
}
inline half4 LightingUnlit(SurfaceOutput s, half3 lightDir, half atten)
{
return half4 (0, 0, 0, s.Alpha);
}
void surf(Input i , inout SurfaceOutput o)
{
float clampResult114 = clamp((_Gradient_level + ((_Gradient_level - i.uv3_texcoord3.y) / _Gradient_Blur)) , 0.0 , 1.0);
float4 lerpResult100 = lerp(_GraColorA , _GraColorB , clampResult114);
o.Emission = lerpResult100.rgb;
float4 color104 = IsGammaSpace() ? float4(0,0,0,0) : float4(0,0,0,0);
float4 color102 = IsGammaSpace() ? float4(1,1,1,0) : float4(1,1,1,0);
float smoothstepResult103 = smoothstep(-0.05 , 1.0 , i.uv3_texcoord3.y);
float4 lerpResult105 = lerp(color104 , color102 , smoothstepResult103);
float4 tex2DNode92 = tex2D(_AlphaText, i.uv_texcoord);
o.Alpha = (lerpResult105 * _Opacity * tex2DNode92).r;
}
ENDCG
}
CustomEditor "ASEMaterialInspector"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1fe62d92a6498bd41994b44944d6b552
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f4acb42845551fe4b92933e1858633ad
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

View File

@@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 76d4d2bc58547df45ab8ef0ed359a9f4
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 512
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,136 @@
// Copyright HTC Corporation All Rights Reserved.
using System;
using System.Text;
using UnityEngine;
using VIVE.OpenXR.Hand;
namespace VIVE.OpenXR.Models
{
public class HandModelActions : MonoBehaviour
{
#region Log
const string LOG_TAG = "VIVE.OpenXR.Models.HandModelActions";
StringBuilder m_sb = null;
StringBuilder sb
{
get
{
if (m_sb == null) { m_sb = new StringBuilder(); }
return m_sb;
}
}
void DEBUG(StringBuilder msg) { Debug.LogFormat("{0} {1}", LOG_TAG, msg); }
void ERROR(StringBuilder msg) { Debug.LogErrorFormat("{0} {1}", LOG_TAG, msg); }
#endregion
#region Inspector
[SerializeField] private bool m_IsLeft = false;
[SerializeField] private GameObject m_Wrist = null;
[SerializeField] private GameObject m_Palm = null;
[SerializeField] private GameObject m_Thumb_Metacarpal = null;
[SerializeField] private GameObject m_Thumb_Proximal = null;
[SerializeField] private GameObject m_Thumb_Distal = null;
[SerializeField] private GameObject m_Thumb_Tip = null;
[SerializeField] private GameObject m_Index_Metacarpal = null;
[SerializeField] private GameObject m_Index_Proximal = null;
[SerializeField] private GameObject m_Index_Intermediate = null;
[SerializeField] private GameObject m_Index_Distal = null;
[SerializeField] private GameObject m_Index_Tip = null;
[SerializeField] private GameObject m_Middle_Metacarpal = null;
[SerializeField] private GameObject m_Middle_Proximal = null;
[SerializeField] private GameObject m_Middle_Intermediate = null;
[SerializeField] private GameObject m_Middle_Distal = null;
[SerializeField] private GameObject m_Middle_Tip = null;
[SerializeField] private GameObject m_Ring_Metacarpal = null;
[SerializeField] private GameObject m_Ring_Proximal = null;
[SerializeField] private GameObject m_Ring_Intermediate = null;
[SerializeField] private GameObject m_Ring_Distal = null;
[SerializeField] private GameObject m_Ring_Tip = null;
[SerializeField] private GameObject m_Little_Metacarpal = null;
[SerializeField] private GameObject m_Little_Proximal = null;
[SerializeField] private GameObject m_Little_Intermediate = null;
[SerializeField] private GameObject m_Little_Distal = null;
[SerializeField] private GameObject m_Little_Tip = null;
[HideInInspector]
public bool ForceHidden = false;
#endregion
private SkinnedMeshRenderer skinMeshRenderer = null;
private void Awake()
{
skinMeshRenderer = GetComponentInChildren<SkinnedMeshRenderer>();
}
private void Update()
{
if (skinMeshRenderer == null) { return; }
if (!XR_EXT_hand_tracking.Interop.GetJointLocations(m_IsLeft, out XrHandJointLocationEXT[] handJointLocation))
{
skinMeshRenderer.enabled = false;
return;
}
skinMeshRenderer.enabled = !ForceHidden;
UpdateJointPosition(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_WRIST_EXT], ref m_Wrist);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_WRIST_EXT], ref m_Wrist);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_PALM_EXT], ref m_Palm);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_THUMB_METACARPAL_EXT], ref m_Thumb_Metacarpal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_THUMB_PROXIMAL_EXT], ref m_Thumb_Proximal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_THUMB_DISTAL_EXT], ref m_Thumb_Distal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_THUMB_TIP_EXT], ref m_Thumb_Tip);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_INDEX_METACARPAL_EXT], ref m_Index_Metacarpal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_INDEX_PROXIMAL_EXT], ref m_Index_Proximal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT], ref m_Index_Intermediate);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_INDEX_DISTAL_EXT], ref m_Index_Distal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_INDEX_TIP_EXT], ref m_Index_Tip);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_MIDDLE_METACARPAL_EXT], ref m_Middle_Metacarpal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT], ref m_Middle_Proximal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT], ref m_Middle_Intermediate);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_MIDDLE_DISTAL_EXT], ref m_Middle_Distal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_MIDDLE_TIP_EXT], ref m_Middle_Tip);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_RING_METACARPAL_EXT], ref m_Ring_Metacarpal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_RING_PROXIMAL_EXT], ref m_Ring_Proximal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_RING_INTERMEDIATE_EXT], ref m_Ring_Intermediate);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_RING_DISTAL_EXT], ref m_Ring_Distal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_RING_TIP_EXT], ref m_Ring_Tip);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_LITTLE_METACARPAL_EXT], ref m_Little_Metacarpal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_LITTLE_PROXIMAL_EXT], ref m_Little_Proximal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT], ref m_Little_Intermediate);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_LITTLE_DISTAL_EXT], ref m_Little_Distal);
UpdateJointRotation(handJointLocation[(int)XrHandJointEXT.XR_HAND_JOINT_LITTLE_TIP_EXT], ref m_Little_Tip);
}
private void UpdateJointPosition(XrHandJointLocationEXT pose, ref GameObject joint)
{
if (((UInt64)pose.locationFlags & (UInt64)XrSpaceLocationFlags.XR_SPACE_LOCATION_POSITION_TRACKED_BIT) != 0)
{
Vector3 pos = OpenXRHelper.ToUnityVector(pose.pose.position);
m_Wrist.transform.localPosition = pos;
}
}
private void UpdateJointRotation(XrHandJointLocationEXT pose, ref GameObject joint)
{
if (((UInt64)pose.locationFlags & (UInt64)XrSpaceLocationFlags.XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT) != 0)
{
Quaternion rot = OpenXRHelper.ToUnityQuaternion(pose.pose.orientation);
joint.transform.rotation = rot;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 916de3f5e8e977e4bb28c81a7b35921a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: