Compare commits

...

6 Commits

Author SHA1 Message Date
Axel Galand
a9084d3389 e 2023-01-18 16:31:04 +01:00
Axel Galand
53543caeca Merge branch 'Scripting' of https://git.k0rb4k.net/VR-Sexe/Phillipes_Fablab into Scripting 2023-01-18 16:30:55 +01:00
Axel Galand
4b5b691e6b + 2023-01-18 16:23:15 +01:00
Axel Galand
002e7278a1 try furniture movement but not working 2023-01-18 16:22:23 +01:00
Axel Galand
518e6d2137 Merge remote-tracking branch 'origin/Scripting' into Assets 2023-01-18 16:10:23 +01:00
Axel Galand
3612d56e04 few change idk 2023-01-18 16:07:08 +01:00
26 changed files with 492 additions and 41 deletions

View File

@ -1,14 +1,9 @@
fileFormatVersion: 2
guid: 3815b8a7d8081484f9339cf78ca53b25
guid: 2d673329ba8c74f48b4f8f6984ccc9fb
ModelImporter:
serializedVersion: 21300
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Material.001
second: {fileID: 2100000, guid: 6de1a72ff651b264ebb6757e18797524, type: 2}
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 53cb2d1a2f0c7c0468ba87eba075cd9a
guid: c4bc9709ddd4c084bb149cd4b8d93914
ModelImporter:
serializedVersion: 21300
internalIDToNameTable: []
@ -68,8 +68,8 @@ ModelImporter:
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 51
normalImportMode: 1
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0

View File

@ -45,6 +45,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7310167259df75745b825087bf4c8de0, type: 3}
m_Name:
m_EditorClassIdentifier:
combinedBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
wallMount: 1
--- !u!1001 &8069903224663295423
PrefabInstance:
m_ObjectHideFlags: 0

8
Assets/Oculus.meta Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

@ -0,0 +1,52 @@
fileFormatVersion: 2
guid: b04daa6d01896124887375a1bfa9b4bf
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 1
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86_64
DefaultValueInitialized: true
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Oculus/VR.meta Normal file
View File

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

View File

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

View File

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

View File

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

BIN
Assets/Oculus/VR/Plugins/1.79.0/Win64OpenXR/OVRPlugin.dll (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: bfdf91cb91d3f2045bd3714bcd05fd7c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -97,7 +97,7 @@ LightmapSettings:
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 112000000, guid: b0920c1f3a4585c42a14752ac957e6b1, type: 2}
m_LightingDataAsset: {fileID: 112000000, guid: 513619d267b6f204fb3ddc20611ca1ff, type: 2}
m_LightingSettings: {fileID: 4890085278179872738, guid: e0d1b39396743fc4da42f1d1948a6570, type: 2}
--- !u!196 &4
NavMeshSettings:
@ -3369,6 +3369,7 @@ MonoBehaviour:
combinedBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
wallMount: 0
--- !u!1001 &366020801
PrefabInstance:
m_ObjectHideFlags: 0
@ -7544,7 +7545,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5262755222010251265, guid: 481a02167edfebe44883f5868f8a27f9, type: 3}
propertyPath: m_LocalPosition.x
value: 1.6517086
value: 1.682
objectReference: {fileID: 0}
- target: {fileID: 5262755222010251265, guid: 481a02167edfebe44883f5868f8a27f9, type: 3}
propertyPath: m_LocalPosition.y
@ -8296,7 +8297,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalPosition.x
value: 3.34
value: 2.764
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalPosition.y
@ -8304,11 +8305,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalPosition.z
value: 1.16
value: -1.091
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalRotation.w
value: -0.64922154
value: -0.9963591
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalRotation.x
@ -8316,7 +8317,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalRotation.y
value: 0.76059943
value: -0.085256256
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalRotation.z
@ -8328,7 +8329,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -459.034
value: -350.218
objectReference: {fileID: 0}
- target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
@ -8343,7 +8344,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh23932
m_Name: pb_Mesh23940
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
@ -8970,7 +8971,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5262755222010251265, guid: 481a02167edfebe44883f5868f8a27f9, type: 3}
propertyPath: m_LocalPosition.z
value: -0.4088473
value: -0.486
objectReference: {fileID: 0}
- target: {fileID: 5262755222010251265, guid: 481a02167edfebe44883f5868f8a27f9, type: 3}
propertyPath: m_LocalRotation.w
@ -10647,6 +10648,7 @@ MonoBehaviour:
combinedBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
wallMount: 0
--- !u!4 &1889890278 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5262755222010251265, guid: 481a02167edfebe44883f5868f8a27f9, type: 3}
@ -11993,7 +11995,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh23872
m_Name: pb_Mesh23880
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2

View File

@ -101,6 +101,54 @@ TextureImporter:
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
- serializedVersion: 3
buildTarget: iPhone
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: WebGL
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: Windows Store Apps
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: []

View File

@ -175,7 +175,7 @@ public class FurnitureMover : MonoBehaviour
public void GrabFurniture(GameObject furniture)
{
Catalog.Instance.GrabObject(furniture, gameObject.GetComponent<Hand>());
//Catalog.Instance.GrabObject(furniture, gameObject.GetComponent<Hand>());
}
public void ReleaseFurniture(GameObject furniture)

View File

@ -6,6 +6,7 @@ public class MovableFurniture : Furniture
private List<Transform> children;
private List<ObjectOutline> outlines;
private Rigidbody _rigidbody;
public bool wallMount;
// Start is called before the first frame update
new void Start()
@ -69,7 +70,7 @@ public class MovableFurniture : Furniture
}
}
public void SnapTo(Vector3 position, LayerMask layerMask, Vector3 direction)
/*public void SnapTo(Vector3 position, LayerMask layerMask, Vector3 direction)
{
Vector3 displacement = Vector3.zero;
this.transform.position = position + centerOffset;
@ -87,18 +88,62 @@ public class MovableFurniture : Furniture
}
}
/*Ray raycast = new Ray((transform.position - centerOffset) - (new Vector3(0, 0, combinedBounds.extents.z)), (new Vector3(0, 0, combinedBounds.size.z )));
RaycastHit hit;
bool SnapbHit = Physics.Raycast(raycast, out hit, combinedBounds.size.z, layerMask);
if (SnapbHit)
{
Debug.Log("Hit");
//displacement.z -= (0 % 2 == 1 ? -1 : 1) * (2*combinedBounds.size.z - (hit.distance));
displacement.z -= (combinedBounds.size.z - (hit.distance));
}*/
this.transform.Translate(displacement, Space.World);
}
}*/
public void SnapTo(Vector3 position, LayerMask layerMask, Vector3 direction)
{
Vector3 previousPosition = transform.position;
Vector3 offset = Vector3.zero;
if (wallMount)
{
transform.position = position;
Bounds objectBounds;
if (combinedBounds == null)
{
objectBounds = new Bounds();
foreach (Transform child in children)
{
objectBounds.Encapsulate(child.GetComponent<Renderer>().bounds);
}
}
else
{
objectBounds = (Bounds)combinedBounds;
}
Vector3 objectSize = objectBounds.size;
offset = new Vector3(objectSize.x / 2, objectSize.y / 2, objectSize.z / 2);
Collider[] colliders = Physics.OverlapBox(transform.position + offset, offset, transform.rotation, layerMask);
if (colliders.Length > 0)
{
for (int i = 0; i < colliders.Length; i++)
{
offset += colliders[i].bounds.ClosestPoint(transform.position) - transform.position;
}
offset /= colliders.Length;
transform.position += offset;
}
}
else
{
Vector3 newPosition = new Vector3(position.x, transform.position.y, position.z);
transform.position = newPosition;
Bounds objectBounds = GetComponent<Collider>().bounds;
Vector3 objectSize = objectBounds.size;
offset = new Vector3(objectSize.x / 2, objectSize.y / 2, objectSize.z / 2);
Collider[] colliders = Physics.OverlapBox(transform.position + offset, offset, transform.rotation, layerMask);
if (colliders.Length > 0)
{
for (int i = 0; i < colliders.Length; i++)
{
offset += colliders[i].bounds.ClosestPoint(transform.position) - transform.position;
}
offset /= colliders.Length;
transform.position += offset;
}
}
}
void OnDrawGizmos()
{

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 42be5b382f1f98b42b3c72b4424293c9
guid: 482b1529430b52d4a91b24ff348443ed
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@ -101,6 +101,54 @@ TextureImporter:
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
- serializedVersion: 3
buildTarget: iPhone
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: WebGL
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: Windows Store Apps
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: []

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8f303882079a4af40b29743e7616af8d
guid: 131c59877e618bf419d81ff6a977d369
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@ -101,6 +101,54 @@ TextureImporter:
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
- serializedVersion: 3
buildTarget: iPhone
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: WebGL
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: Windows Store Apps
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: []

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: aa303ab914cfce7498ac26155eae9c90
guid: f512a1bb22797484881cfda83c6c5439
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@ -101,6 +101,54 @@ TextureImporter:
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
- serializedVersion: 3
buildTarget: iPhone
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: WebGL
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: Windows Store Apps
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: []

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e1bd55c2f6156464496e0cdacc1f6f7f
guid: 629deea292961e64fac069fd693ca000
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@ -101,6 +101,54 @@ TextureImporter:
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
- serializedVersion: 3
buildTarget: iPhone
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: WebGL
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: Windows Store Apps
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: []