Skip to content
Snippets Groups Projects
Commit 95a8233b authored by Sylvain Buche's avatar Sylvain Buche
Browse files

First version Scene Management gltf working with arfoundation wrapper (image tracking only)

parent a0677f2d
No related branches found
No related tags found
1 merge request!2Move tracking prefab to package, add export assetbundle capabilities for...
Showing
with 295 additions and 114 deletions
fileFormatVersion: 2
guid: 65b2a81d1c4b9a34da53acd3e09bb82a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: 0b0025a9e37fafc40b9fdcf76dc28181
ModelImporter:
serializedVersion: 21300
internalIDToNameTable: []
externalObjects: {}
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:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e4b7be4c33f68d0418c3b4e1a7053d91, type: 3}
m_Name: ARFWorldStorageServer
m_EditorClassIdentifier:
serverName: 192.168.1.27
company: Orange
basePath: http://192.168.1.27
port: 8080
currentUser: {fileID: 11400000, guid: 220ed7f6ba8f6404e8bee0e9057e2ffd, type: 2}
fileFormatVersion: 2
guid: cc5c5acfb44773a4ba9decc291b718d2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8a1e3e7961eae84468e6ee20d5b09ffd, type: 3}
m_Name: ARFWorldStorageUser
m_EditorClassIdentifier:
userName: Sylvain
company: Orange
UUID: 85a7b6fe-3886-4fb1-8f7d-ae68c5cbf456
fileFormatVersion: 2
guid: 220ed7f6ba8f6404e8bee0e9057e2ffd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -344,100 +344,6 @@ Camera:
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1 &184502760
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 184502762}
- component: {fileID: 184502761}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &184502761
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 184502760}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &184502762
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 184502760}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &236535454
GameObject:
m_ObjectHideFlags: 0
......@@ -467,7 +373,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 02da7adcc65f4694684d71e61d88070b, type: 3}
m_Name:
m_EditorClassIdentifier:
worldStorageServer: {fileID: 0}
worldStorageServer: {fileID: 11400000, guid: cc5c5acfb44773a4ba9decc291b718d2, type: 2}
--- !u!4 &236535456
Transform:
m_ObjectHideFlags: 0
......@@ -481,7 +387,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &334744955
GameObject:
......@@ -531,7 +437,7 @@ Transform:
m_Children:
- {fileID: 789254998}
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &789254997
GameObject:
......@@ -609,7 +515,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1210990015
GameObject:
......@@ -669,7 +575,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1405320275
GameObject:
......@@ -747,5 +653,5 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -19,7 +19,7 @@ public class SceneManagementGLTF : MonoBehaviour
/// <summary>
/// List of trackables and anchors in the AR Scene
/// </summary>
private Dictionary<string, Transform> m_trackablesAndAnchorsInARScene;
private Dictionary<Guid, Transform> m_trackablesAndAnchorsInARScene;
/// <summary>
/// Current world analysis
......@@ -31,16 +31,16 @@ public class SceneManagementGLTF : MonoBehaviour
/// </summary>
protected async void Start()
{
m_trackablesAndAnchorsInARScene = new Dictionary<string, Transform>();
m_trackablesAndAnchorsInARScene = new Dictionary<Guid, Transform>();
await LoadGltfBinaryFromMemory();
Transform loaded = this.transform.GetChild(0);
FindWorldStorageTransform(loaded);
m_worldAnalysis = WorldAnalysisFactory.CreateWorldAnalysis(_WorldAnalysisType, this.gameObject);
//Subscribe
foreach(KeyValuePair<string , Transform> toSubscribe in m_trackablesAndAnchorsInARScene)
foreach(KeyValuePair<Guid , Transform> toSubscribe in m_trackablesAndAnchorsInARScene)
{
int validity = 100000; //10s
string subscriptionUUID;
Guid subscriptionUUID;
// TODO : if only one : subscribeToPose, if multiple subscribetoPoses
m_worldAnalysis.SubscribeToPose(null, toSubscribe.Key, ETSI.ARF.OpenAPI.WorldAnalysis.Mode_WorldAnalysis.DEVICE_TO_TRACKABLES, PoseCallback, ref validity, out subscriptionUUID); //TODO : find a value for the token parameter.
}
......@@ -62,10 +62,10 @@ public class SceneManagementGLTF : MonoBehaviour
if (pose.Value.Type == ETSI.ARF.OpenAPI.WorldAnalysis.PoseValueType.VECTOR_QUATERNION)
{
ETSI.ARF.OpenAPI.WorldAnalysis.VectorQuaternionPoseValue value = (ETSI.ARF.OpenAPI.WorldAnalysis.VectorQuaternionPoseValue)pose.Value;
if (m_trackablesAndAnchorsInARScene.ContainsKey(pose.Uuid.ToString()))
if (m_trackablesAndAnchorsInARScene.ContainsKey(pose.Uuid))
{
m_trackablesAndAnchorsInARScene[pose.Uuid.ToString()].transform.position = WorldAnalysisUnityHelper.ConvertETSIVector3ToUnity(value.Position);
m_trackablesAndAnchorsInARScene[pose.Uuid.ToString()].transform.rotation = WorldAnalysisUnityHelper.ConvertETSIARFQuaternionToUnity(value.Rotation);
m_trackablesAndAnchorsInARScene[pose.Uuid].transform.position = WorldAnalysisUnityHelper.ConvertETSIVector3ToUnity(value.Position);
m_trackablesAndAnchorsInARScene[pose.Uuid].transform.rotation = WorldAnalysisUnityHelper.ConvertETSIARFQuaternionToUnity(value.Rotation);
}
else
{
......@@ -119,7 +119,7 @@ public class SceneManagementGLTF : MonoBehaviour
{
string id = trGLTF.name.Substring(3);
Debug.Log("Add " + id + " " + trGLTF.name);
m_trackablesAndAnchorsInARScene.Add(id, trGLTF);
m_trackablesAndAnchorsInARScene.Add(new Guid(id), trGLTF);
}
foreach(Transform child in trGLTF)
{
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8739186027427055784
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4c3631f5e58749a59194e0cf6baf6d5, type: 3}
m_Name: Android Providers
m_EditorClassIdentifier:
m_RequiresSettingsUpdate: 0
m_AutomaticLoading: 0
m_AutomaticRunning: 0
m_Loaders:
- {fileID: 11400000, guid: f1a4b7bc1f6cd9e4b823c16c8860c0cd, type: 2}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d2dc886499c26824283350fa532d087d, type: 3}
m_Name: XRGeneralSettingsPerBuildTarget
m_EditorClassIdentifier:
Keys: 07000000
Values:
- {fileID: 5732245400625790027}
--- !u!114 &5732245400625790027
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d236b7d11115f2143951f1e14045df39, type: 3}
m_Name: Android Settings
m_EditorClassIdentifier:
m_LoaderManagerInstance: {fileID: -8739186027427055784}
m_InitManagerOnStart: 1
fileFormatVersion: 2
guid: 8f63412dcece46d4d8ff48fb8fc6c31e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -5,6 +5,7 @@
"com.unity.ide.rider": "3.0.20",
"com.unity.ide.visualstudio": "2.0.18",
"com.unity.ide.vscode": "1.2.5",
"com.unity.mobile.android-logcat": "1.3.2",
"com.unity.test-framework": "1.1.31",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.4",
......
......@@ -83,6 +83,13 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.mobile.android-logcat": {
"version": "1.3.2",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.1.0",
"depth": 1,
......
Subproject commit 93634c2f97e4624749f9b036c099f1db4aa8323a
Subproject commit 1a50123932c3760560c3e8fd37d6317317a80ba1
Subproject commit 29a370a8c7bff3ab61e5b526fa0d297840e85ba1
Subproject commit f6d3879af8f5899a23fa67058eb0996bcab3f8fa
Subproject commit a3c8391411e36ec40373cc5a8f4e78b0f181ea34
Subproject commit 2ee773348b3e19392a4a92a88d98f86d7e8f98ac
{
"MonoBehaviour": {
"Version": 4,
"EnableBurstCompilation": true,
"EnableOptimisations": true,
"EnableSafetyChecks": false,
"EnableDebugInAllBuilds": false,
"DebugDataKind": 1,
"EnableArmv9SecurityFeatures": false,
"CpuMinTargetX32": 0,
"CpuMaxTargetX32": 0,
"CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0,
"CpuTargetsArm64": 512,
"OptimizeFor": 0
}
}
{
"MonoBehaviour": {
"Version": 4,
"EnableBurstCompilation": true,
"EnableOptimisations": true,
"EnableSafetyChecks": false,
"EnableDebugInAllBuilds": false,
"DebugDataKind": 1,
"EnableArmv9SecurityFeatures": false,
"CpuMinTargetX32": 0,
"CpuMaxTargetX32": 0,
"CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0,
"CpuTargetsX32": 6,
"CpuTargetsX64": 72,
"OptimizeFor": 0
}
}
{
"MonoBehaviour": {
"Version": 4,
"DisabledWarnings": ""
}
}
......@@ -4,8 +4,12 @@
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 1
path: Assets/Scenes/MainScene.unity
guid: cfb9e37ec495d014eb9ed87251861a32
m_configObjects:
UnityEditor.XR.ARCore.ARCoreSettings: {fileID: 11400000, guid: 60b084f6889b3f643a06cde2d9b5dac6, type: 2}
UnityEditor.XR.ARKit.ARKitSettings: {fileID: 11400000, guid: 1d843ca70dbb1e947809e3f55a8d8831, type: 2}
com.unity.xr.arfoundation.simulation_settings: {fileID: 11400000, guid: 1ef61a6a59edbba4b81751378314e1d3, type: 2}
com.unity.xr.management.loader_settings: {fileID: 11400000, guid: 8f63412dcece46d4d8ff48fb8fc6c31e, type: 2}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment