uvIndices) {
+ //invalid face size?
+ if (vertexIndices.Count < 3) {
+ return;
+ }
+
+ //set material
+ if (material != _lastMaterial) {
+ SetMaterial(material);
+ _lastMaterial = material;
+ }
+
+ //remap
+ int[] indexRemap = new int[vertexIndices.Count];
+ for (int i = 0; i < vertexIndices.Count; i++) {
+ int vertexIndex = vertexIndices[i];
+ int normalIndex = normalIndices[i];
+ int uvIndex = uvIndices[i];
+
+ var hashObj = new ObjLoopHash() {
+ vertexIndex = vertexIndex,
+ normalIndex = normalIndex,
+ uvIndex = uvIndex
+ };
+ int remap = -1;
+
+ if (!_globalIndexRemap.TryGetValue(hashObj, out remap)) {
+ //add to dict
+ _globalIndexRemap.Add(hashObj, _vertices.Count);
+ remap = _vertices.Count;
+
+ //add new verts and what not
+ _vertices.Add((vertexIndex >= 0 && vertexIndex < _loader.Vertices.Count) ? _loader.Vertices[vertexIndex] : Vector3.zero);
+ _normals.Add((normalIndex >= 0 && normalIndex < _loader.Normals.Count) ? _loader.Normals[normalIndex] : Vector3.zero);
+ _uvs.Add((uvIndex >= 0 && uvIndex < _loader.UVs.Count) ? _loader.UVs[uvIndex] : Vector2.zero);
+
+ //mark recalc flag
+ if (normalIndex < 0)
+ recalculateNormals = true;
+ }
+
+ indexRemap[i] = remap;
+ }
+
+
+ //add face to our mesh list
+ if (indexRemap.Length == 3) {
+ _currentIndexList.AddRange(new int[] { indexRemap[0], indexRemap[1], indexRemap[2] });
+ } else if (indexRemap.Length == 4) {
+ _currentIndexList.AddRange(new int[] { indexRemap[0], indexRemap[1], indexRemap[2] });
+ _currentIndexList.AddRange(new int[] { indexRemap[2], indexRemap[3], indexRemap[0] });
+ } else if (indexRemap.Length > 4) {
+ for (int i = indexRemap.Length - 1; i >= 2; i--) {
+ _currentIndexList.AddRange(new int[] { indexRemap[0], indexRemap[i - 1], indexRemap[i] });
+ }
+ }
+
+ PushedFaceCount++;
+ }
+
+ public OBJObjectBuilder(string name, OBJLoader loader) {
+ _name = name;
+ _loader = loader;
+ }
+}
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs.meta
new file mode 100644
index 00000000..7e0d5b8e
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8242329223027ef40a531fc4dc2efd1c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML
new file mode 100644
index 00000000..0ae5c5cc
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML
@@ -0,0 +1,26 @@
+
+
+
+
+ Dummiesman OBJ Importer Readme
+
+
+
+ Dummiesman's OBJ Importer
+ Works during runtime*, and in editor! A couple of code samples are provided in the Samples folder.
+
+ *Runtime Import Note
+ You must go to the "Graphics" tab in your project, and add "Standard (Specular Setup)" to the always included shaders. This will make your next build take a while.
+
+ Features
+
+ - Material file loading
+ - Runtime texture library supporting BMP, TGA, JPG, PNG, DDS, and CRN textures.
+ - Decent import speed (~750k triangles in about 10 seconds)
+ - Support for loading obj and mtl from stream, as well as overridable callback for texture loads
+ - Works in editor, and during runtime
+ - Loads triangles, quads, and ngons
+
+
+
+
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML.meta b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML.meta
new file mode 100644
index 00000000..038ce58c
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 127e58e7a0d489046a128e511967dea8
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples.meta
new file mode 100644
index 00000000..7fd13e80
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1e292531b556307479437e7763c8b31f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs
new file mode 100644
index 00000000..53f107e3
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs
@@ -0,0 +1,36 @@
+using Dummiesman;
+using System.IO;
+using UnityEngine;
+
+public class ObjFromFile : MonoBehaviour
+{
+ string objPath = string.Empty;
+ string error = string.Empty;
+ GameObject loadedObject;
+
+ void OnGUI() {
+ objPath = GUI.TextField(new Rect(0, 0, 256, 32), objPath);
+
+ GUI.Label(new Rect(0, 0, 256, 32), "Obj Path:");
+ if(GUI.Button(new Rect(256, 32, 64, 32), "Load File"))
+ {
+ //file path
+ if (!File.Exists(objPath))
+ {
+ error = "File doesn't exist.";
+ }else{
+ if(loadedObject != null)
+ Destroy(loadedObject);
+ loadedObject = new OBJLoader().Load(objPath);
+ error = string.Empty;
+ }
+ }
+
+ if(!string.IsNullOrWhiteSpace(error))
+ {
+ GUI.color = Color.red;
+ GUI.Box(new Rect(0, 64, 256 + 64, 32), error);
+ GUI.color = Color.white;
+ }
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs.meta
new file mode 100644
index 00000000..be79067f
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e668e28abcfb0ae439f4ead584aba85b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity
new file mode 100644
index 00000000..62a52b16
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity
@@ -0,0 +1,298 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+OcclusionCullingSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_OcclusionBakeSettings:
+ smallestOccluder: 5
+ smallestHole: 0.25
+ backfaceThreshold: 100
+ m_SceneGUID: 00000000000000000000000000000000
+ m_OcclusionCullingData: {fileID: 0}
+--- !u!104 &2
+RenderSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 9
+ m_Fog: 0
+ m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+ m_FogMode: 3
+ m_FogDensity: 0.01
+ m_LinearFogStart: 0
+ m_LinearFogEnd: 300
+ m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
+ m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
+ m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
+ m_AmbientIntensity: 1
+ m_AmbientMode: 0
+ m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
+ m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
+ m_HaloStrength: 0.5
+ m_FlareStrength: 1
+ m_FlareFadeSpeed: 3
+ m_HaloTexture: {fileID: 0}
+ m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+ m_DefaultReflectionMode: 0
+ m_DefaultReflectionResolution: 128
+ m_ReflectionBounces: 1
+ 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_UseRadianceAmbientProbe: 0
+--- !u!157 &3
+LightmapSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 11
+ m_GIWorkflowMode: 0
+ m_GISettings:
+ serializedVersion: 2
+ m_BounceScale: 1
+ m_IndirectOutputScale: 1
+ m_AlbedoBoost: 1
+ m_TemporalCoherenceThreshold: 1
+ m_EnvironmentLightingMode: 0
+ m_EnableBakedLightmaps: 1
+ m_EnableRealtimeLightmaps: 1
+ m_LightmapEditorSettings:
+ serializedVersion: 10
+ m_Resolution: 2
+ m_BakeResolution: 40
+ m_AtlasSize: 1024
+ m_AO: 0
+ m_AOMaxDistance: 1
+ m_CompAOExponent: 1
+ m_CompAOExponentDirect: 0
+ m_Padding: 2
+ m_LightmapParameters: {fileID: 0}
+ m_LightmapsBakeMode: 1
+ m_TextureCompression: 1
+ m_FinalGather: 0
+ m_FinalGatherFiltering: 1
+ m_FinalGatherRayCount: 256
+ m_ReflectionCompression: 2
+ m_MixedBakeMode: 2
+ m_BakeBackend: 1
+ m_PVRSampling: 1
+ m_PVRDirectSampleCount: 32
+ m_PVRSampleCount: 500
+ m_PVRBounces: 2
+ m_PVRFilterTypeDirect: 0
+ m_PVRFilterTypeIndirect: 0
+ m_PVRFilterTypeAO: 0
+ m_PVRFilteringMode: 1
+ m_PVRCulling: 1
+ m_PVRFilteringGaussRadiusDirect: 1
+ m_PVRFilteringGaussRadiusIndirect: 5
+ m_PVRFilteringGaussRadiusAO: 2
+ m_PVRFilteringAtrousPositionSigmaDirect: 0.5
+ m_PVRFilteringAtrousPositionSigmaIndirect: 2
+ m_PVRFilteringAtrousPositionSigmaAO: 1
+ m_ShowResolutionOverlay: 1
+ m_LightingDataAsset: {fileID: 0}
+ m_UseShadowmask: 1
+--- !u!196 &4
+NavMeshSettings:
+ serializedVersion: 2
+ m_ObjectHideFlags: 0
+ m_BuildSettings:
+ serializedVersion: 2
+ agentTypeID: 0
+ agentRadius: 0.5
+ agentHeight: 2
+ agentSlope: 45
+ agentClimb: 0.4
+ ledgeDropHeight: 0
+ maxJumpAcrossDistance: 0
+ minRegionArea: 2
+ manualCellSize: 0
+ cellSize: 0.16666667
+ manualTileSize: 0
+ tileSize: 256
+ accuratePlacement: 0
+ debug:
+ m_Flags: 0
+ m_NavMeshData: {fileID: 0}
+--- !u!1 &1373862594
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1373862596}
+ - component: {fileID: 1373862595}
+ 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 &1373862595
+Light:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1373862594}
+ m_Enabled: 1
+ serializedVersion: 8
+ m_Type: 1
+ m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
+ m_Intensity: 1
+ m_Range: 10
+ m_SpotAngle: 30
+ 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_Cookie: {fileID: 0}
+ m_DrawHalo: 0
+ m_Flare: {fileID: 0}
+ m_RenderMode: 0
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_Lightmapping: 4
+ m_LightShadowCasterMode: 0
+ m_AreaSize: {x: 1, y: 1}
+ m_BounceIntensity: 1
+ m_ColorTemperature: 6570
+ m_UseColorTemperature: 0
+ m_ShadowRadius: 0
+ m_ShadowAngle: 0
+--- !u!4 &1373862596
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1373862594}
+ 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_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 1
+ m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
+--- !u!1 &1374413049
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1374413051}
+ - component: {fileID: 1374413050}
+ m_Layer: 0
+ m_Name: Scripts
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &1374413050
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1374413049}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: e668e28abcfb0ae439f4ead584aba85b, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+--- !u!4 &1374413051
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1374413049}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 2
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1513737669
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1513737672}
+ - component: {fileID: 1513737671}
+ - component: {fileID: 1513737670}
+ m_Layer: 0
+ m_Name: Main Camera
+ m_TagString: MainCamera
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!81 &1513737670
+AudioListener:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1513737669}
+ m_Enabled: 1
+--- !u!20 &1513737671
+Camera:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1513737669}
+ m_Enabled: 1
+ serializedVersion: 2
+ m_ClearFlags: 1
+ m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
+ m_projectionMatrixMode: 1
+ m_SensorSize: {x: 36, y: 24}
+ m_LensShift: {x: 0, y: 0}
+ m_FocalLength: 50
+ m_NormalizedViewPortRect:
+ serializedVersion: 2
+ x: 0
+ y: 0
+ width: 1
+ height: 1
+ near clip plane: 0.3
+ far clip plane: 1000
+ field of view: 60
+ orthographic: 0
+ orthographic size: 5
+ m_Depth: -1
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_RenderingPath: -1
+ m_TargetTexture: {fileID: 0}
+ m_TargetDisplay: 0
+ m_TargetEye: 3
+ m_HDR: 1
+ m_AllowMSAA: 1
+ m_AllowDynamicResolution: 0
+ m_ForceIntoRT: 0
+ m_OcclusionCulling: 1
+ m_StereoConvergence: 10
+ m_StereoSeparation: 0.022
+--- !u!4 &1513737672
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1513737669}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 1, z: -10}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity.meta
new file mode 100644
index 00000000..d03aba45
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: e96535515ee47d04589da7981f6650a2
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs
new file mode 100644
index 00000000..cc87cd13
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs
@@ -0,0 +1,22 @@
+using Dummiesman;
+using System.IO;
+using System.Text;
+using UnityEngine;
+using UnityEngine.Networking;
+
+public class ObjFromStream : MonoBehaviour
+{
+ void Start()
+ {
+ var request = new UnityWebRequest();
+ var webRequest = UnityWebRequest.Get("https://people.sc.fsu.edu/~jburkardt/data/obj/lamp.obj");
+ while (!webRequest.isDone)
+ {
+ System.Threading.Thread.Sleep(1);
+ }
+
+ //create stream and load
+ var textStream = new MemoryStream(Encoding.UTF8.GetBytes(webRequest.downloadHandler.text));
+ var loadedObj = new OBJLoader().Load(textStream);
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs.meta
new file mode 100644
index 00000000..85de4fac
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: daba88a30f38f3f4d8df0d146acfcd08
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity
new file mode 100644
index 00000000..bf75125a
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity
@@ -0,0 +1,298 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+OcclusionCullingSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_OcclusionBakeSettings:
+ smallestOccluder: 5
+ smallestHole: 0.25
+ backfaceThreshold: 100
+ m_SceneGUID: 00000000000000000000000000000000
+ m_OcclusionCullingData: {fileID: 0}
+--- !u!104 &2
+RenderSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 9
+ m_Fog: 0
+ m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+ m_FogMode: 3
+ m_FogDensity: 0.01
+ m_LinearFogStart: 0
+ m_LinearFogEnd: 300
+ m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
+ m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
+ m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
+ m_AmbientIntensity: 1
+ m_AmbientMode: 0
+ m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
+ m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
+ m_HaloStrength: 0.5
+ m_FlareStrength: 1
+ m_FlareFadeSpeed: 3
+ m_HaloTexture: {fileID: 0}
+ m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+ m_DefaultReflectionMode: 0
+ m_DefaultReflectionResolution: 128
+ m_ReflectionBounces: 1
+ 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_UseRadianceAmbientProbe: 0
+--- !u!157 &3
+LightmapSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 11
+ m_GIWorkflowMode: 0
+ m_GISettings:
+ serializedVersion: 2
+ m_BounceScale: 1
+ m_IndirectOutputScale: 1
+ m_AlbedoBoost: 1
+ m_TemporalCoherenceThreshold: 1
+ m_EnvironmentLightingMode: 0
+ m_EnableBakedLightmaps: 1
+ m_EnableRealtimeLightmaps: 1
+ m_LightmapEditorSettings:
+ serializedVersion: 10
+ m_Resolution: 2
+ m_BakeResolution: 40
+ m_AtlasSize: 1024
+ m_AO: 0
+ m_AOMaxDistance: 1
+ m_CompAOExponent: 1
+ m_CompAOExponentDirect: 0
+ m_Padding: 2
+ m_LightmapParameters: {fileID: 0}
+ m_LightmapsBakeMode: 1
+ m_TextureCompression: 1
+ m_FinalGather: 0
+ m_FinalGatherFiltering: 1
+ m_FinalGatherRayCount: 256
+ m_ReflectionCompression: 2
+ m_MixedBakeMode: 2
+ m_BakeBackend: 1
+ m_PVRSampling: 1
+ m_PVRDirectSampleCount: 32
+ m_PVRSampleCount: 500
+ m_PVRBounces: 2
+ m_PVRFilterTypeDirect: 0
+ m_PVRFilterTypeIndirect: 0
+ m_PVRFilterTypeAO: 0
+ m_PVRFilteringMode: 1
+ m_PVRCulling: 1
+ m_PVRFilteringGaussRadiusDirect: 1
+ m_PVRFilteringGaussRadiusIndirect: 5
+ m_PVRFilteringGaussRadiusAO: 2
+ m_PVRFilteringAtrousPositionSigmaDirect: 0.5
+ m_PVRFilteringAtrousPositionSigmaIndirect: 2
+ m_PVRFilteringAtrousPositionSigmaAO: 1
+ m_ShowResolutionOverlay: 1
+ m_LightingDataAsset: {fileID: 0}
+ m_UseShadowmask: 1
+--- !u!196 &4
+NavMeshSettings:
+ serializedVersion: 2
+ m_ObjectHideFlags: 0
+ m_BuildSettings:
+ serializedVersion: 2
+ agentTypeID: 0
+ agentRadius: 0.5
+ agentHeight: 2
+ agentSlope: 45
+ agentClimb: 0.4
+ ledgeDropHeight: 0
+ maxJumpAcrossDistance: 0
+ minRegionArea: 2
+ manualCellSize: 0
+ cellSize: 0.16666667
+ manualTileSize: 0
+ tileSize: 256
+ accuratePlacement: 0
+ debug:
+ m_Flags: 0
+ m_NavMeshData: {fileID: 0}
+--- !u!1 &167273857
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 167273859}
+ - component: {fileID: 167273858}
+ m_Layer: 0
+ m_Name: Scripts
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &167273858
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 167273857}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: daba88a30f38f3f4d8df0d146acfcd08, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+--- !u!4 &167273859
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 167273857}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 2
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &560136681
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 560136683}
+ - component: {fileID: 560136682}
+ 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 &560136682
+Light:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 560136681}
+ m_Enabled: 1
+ serializedVersion: 8
+ m_Type: 1
+ m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
+ m_Intensity: 1
+ m_Range: 10
+ m_SpotAngle: 30
+ 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_Cookie: {fileID: 0}
+ m_DrawHalo: 0
+ m_Flare: {fileID: 0}
+ m_RenderMode: 0
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_Lightmapping: 4
+ m_LightShadowCasterMode: 0
+ m_AreaSize: {x: 1, y: 1}
+ m_BounceIntensity: 1
+ m_ColorTemperature: 6570
+ m_UseColorTemperature: 0
+ m_ShadowRadius: 0
+ m_ShadowAngle: 0
+--- !u!4 &560136683
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 560136681}
+ 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_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 1
+ m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
+--- !u!1 &2142185484
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 2142185487}
+ - component: {fileID: 2142185486}
+ - component: {fileID: 2142185485}
+ m_Layer: 0
+ m_Name: Main Camera
+ m_TagString: MainCamera
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!81 &2142185485
+AudioListener:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2142185484}
+ m_Enabled: 1
+--- !u!20 &2142185486
+Camera:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2142185484}
+ m_Enabled: 1
+ serializedVersion: 2
+ m_ClearFlags: 1
+ m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
+ m_projectionMatrixMode: 1
+ m_SensorSize: {x: 36, y: 24}
+ m_LensShift: {x: 0, y: 0}
+ m_FocalLength: 50
+ m_NormalizedViewPortRect:
+ serializedVersion: 2
+ x: 0
+ y: 0
+ width: 1
+ height: 1
+ near clip plane: 0.3
+ far clip plane: 1000
+ field of view: 60
+ orthographic: 0
+ orthographic size: 5
+ m_Depth: -1
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_RenderingPath: -1
+ m_TargetTexture: {fileID: 0}
+ m_TargetDisplay: 0
+ m_TargetEye: 3
+ m_HDR: 1
+ m_AllowMSAA: 1
+ m_AllowDynamicResolution: 0
+ m_ForceIntoRT: 0
+ m_OcclusionCulling: 1
+ m_StereoConvergence: 10
+ m_StereoSeparation: 0.022
+--- !u!4 &2142185487
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2142185484}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 1, z: -10}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity.meta
new file mode 100644
index 00000000..970029f2
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0f928d9ce1b64b94f9b3d349956f8cd3
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs
new file mode 100644
index 00000000..b137e349
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs
@@ -0,0 +1,13 @@
+namespace Dummiesman
+{
+ public static class StringExtensions
+ {
+ public static string Clean(this string str)
+ {
+ string rstr = str.Replace('\t', ' ');
+ while (rstr.Contains(" "))
+ rstr = rstr.Replace(" ", " ");
+ return rstr.Trim();
+ }
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs.meta
new file mode 100644
index 00000000..edbe614f
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3ef7489c6f646f4448ffe979ea9857da
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader.meta
new file mode 100644
index 00000000..de80f2cb
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ce592b27d670b994b8150b9ddd9fa341
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs
new file mode 100644
index 00000000..ea18980f
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs
@@ -0,0 +1,560 @@
+#region License and Information
+/*****
+*
+* BMPLoader.cs
+*
+* This is a simple implementation of a BMP file loader for Unity3D.
+* Formats it should support are:
+* - 1 bit monochrome indexed
+* - 2-8 bit indexed
+* - 16 / 24 / 32 bit color (including "BI_BITFIELDS")
+* - RLE-4 and RLE-8 support has been added.
+*
+* Unless the type is "BI_ALPHABITFIELDS" the loader does not interpret alpha
+* values by default, however you can set the "ReadPaletteAlpha" setting to
+* true to interpret the 4th (usually "00") value as alpha for indexed images.
+* You can also set "ForceAlphaReadWhenPossible" to true so it will interpret
+* the "left over" bits as alpha if there are any. It will also force to read
+* alpha from a palette if it's an indexed image, just like "ReadPaletteAlpha".
+*
+* It's not tested well to the bone, so there might be some errors somewhere.
+* However I tested it with 4 different images created with MS Paint
+* (1bit, 4bit, 8bit, 24bit) as those are the only formats supported.
+*
+* 2017.02.05 - first version
+* 2017.03.06 - Added RLE4 / RLE8 support
+*
+* Copyright (c) 2017 Markus Göbel (Bunny83)
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to
+* deal in the Software without restriction, including without limitation the
+* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+* sell copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+* IN THE SOFTWARE.
+*
+*****/
+#endregion License and Information
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System;
+
+namespace B83.Image.BMP
+{
+ public enum BMPComressionMode : int
+ {
+ BI_RGB = 0x00,
+ BI_RLE8 = 0x01,
+ BI_RLE4 = 0x02,
+ BI_BITFIELDS = 0x03,
+ BI_JPEG = 0x04,
+ BI_PNG = 0x05,
+ BI_ALPHABITFIELDS = 0x06,
+
+ BI_CMYK = 0x0B,
+ BI_CMYKRLE8 = 0x0C,
+ BI_CMYKRLE4 = 0x0D,
+
+ }
+ public struct BMPFileHeader
+ {
+ public ushort magic; // "BM"
+ public uint filesize;
+ public uint reserved;
+ public uint offset;
+ }
+ public struct BitmapInfoHeader
+ {
+ public uint size;
+ public int width;
+ public int height;
+ public ushort nColorPlanes; // always 1
+ public ushort nBitsPerPixel; // [1,4,8,16,24,32]
+ public BMPComressionMode compressionMethod;
+ public uint rawImageSize; // can be "0"
+ public int xPPM;
+ public int yPPM;
+ public uint nPaletteColors;
+ public uint nImportantColors;
+
+ public int absWidth { get { return Mathf.Abs(width); } }
+ public int absHeight { get { return Mathf.Abs(height); } }
+
+ }
+
+ public class BMPImage
+ {
+ public BMPFileHeader header;
+ public BitmapInfoHeader info;
+ public uint rMask = 0x00FF0000;
+ public uint gMask = 0x0000FF00;
+ public uint bMask = 0x000000FF;
+ public uint aMask = 0x00000000;
+ public List palette;
+ public Color32[] imageData;
+ public Texture2D ToTexture2D()
+ {
+ var tex = new Texture2D(info.absWidth, info.absHeight);
+ tex.SetPixels32(imageData);
+ tex.Apply();
+ return tex;
+ }
+ }
+
+
+ public class BMPLoader
+ {
+ const ushort MAGIC = 0x4D42; // "BM" little endian
+ public bool ReadPaletteAlpha = false;
+ public bool ForceAlphaReadWhenPossible = false;
+
+ public BMPImage LoadBMP(string aFileName)
+ {
+ using (var file = File.OpenRead(aFileName))
+ return LoadBMP(file);
+ }
+ public BMPImage LoadBMP(byte[] aData)
+ {
+ using (var stream = new MemoryStream(aData))
+ return LoadBMP(stream);
+ }
+
+ public BMPImage LoadBMP(Stream aData)
+ {
+ using (var reader = new BinaryReader(aData))
+ return LoadBMP(reader);
+
+ }
+ public BMPImage LoadBMP(BinaryReader aReader)
+ {
+ BMPImage bmp = new BMPImage();
+ if (!ReadFileHeader(aReader, ref bmp.header))
+ {
+ Debug.LogError("Not a BMP file");
+ return null;
+ }
+ if (!ReadInfoHeader(aReader, ref bmp.info))
+ {
+ Debug.LogError("Unsupported header format");
+ return null;
+ }
+ if (bmp.info.compressionMethod != BMPComressionMode.BI_RGB
+ && bmp.info.compressionMethod != BMPComressionMode.BI_BITFIELDS
+ && bmp.info.compressionMethod != BMPComressionMode.BI_ALPHABITFIELDS
+ && bmp.info.compressionMethod != BMPComressionMode.BI_RLE4
+ && bmp.info.compressionMethod != BMPComressionMode.BI_RLE8
+ )
+ {
+ Debug.LogError("Unsupported image format: " + bmp.info.compressionMethod);
+ return null;
+ }
+ long offset = 14 + bmp.info.size;
+ aReader.BaseStream.Seek(offset, SeekOrigin.Begin);
+ if (bmp.info.nBitsPerPixel < 24)
+ {
+ bmp.rMask = 0x00007C00;
+ bmp.gMask = 0x000003E0;
+ bmp.bMask = 0x0000001F;
+ }
+
+ if (bmp.info.compressionMethod == BMPComressionMode.BI_BITFIELDS || bmp.info.compressionMethod == BMPComressionMode.BI_ALPHABITFIELDS)
+ {
+ bmp.rMask = aReader.ReadUInt32();
+ bmp.gMask = aReader.ReadUInt32();
+ bmp.bMask = aReader.ReadUInt32();
+ }
+ if (ForceAlphaReadWhenPossible)
+ bmp.aMask = GetMask(bmp.info.nBitsPerPixel) ^ (bmp.rMask | bmp.gMask | bmp.bMask);
+
+ if (bmp.info.compressionMethod == BMPComressionMode.BI_ALPHABITFIELDS)
+ bmp.aMask = aReader.ReadUInt32();
+
+ if (bmp.info.nPaletteColors > 0 || bmp.info.nBitsPerPixel <= 8)
+ bmp.palette = ReadPalette(aReader, bmp, ReadPaletteAlpha || ForceAlphaReadWhenPossible);
+
+
+ aReader.BaseStream.Seek(bmp.header.offset, SeekOrigin.Begin);
+ bool uncompressed = bmp.info.compressionMethod == BMPComressionMode.BI_RGB ||
+ bmp.info.compressionMethod == BMPComressionMode.BI_BITFIELDS ||
+ bmp.info.compressionMethod == BMPComressionMode.BI_ALPHABITFIELDS;
+ if (bmp.info.nBitsPerPixel == 32 && uncompressed)
+ Read32BitImage(aReader, bmp);
+ else if (bmp.info.nBitsPerPixel == 24 && uncompressed)
+ Read24BitImage(aReader, bmp);
+ else if (bmp.info.nBitsPerPixel == 16 && uncompressed)
+ Read16BitImage(aReader, bmp);
+ else if (bmp.info.compressionMethod == BMPComressionMode.BI_RLE4 && bmp.info.nBitsPerPixel == 4 && bmp.palette != null)
+ ReadIndexedImageRLE4(aReader, bmp);
+ else if (bmp.info.compressionMethod == BMPComressionMode.BI_RLE8 && bmp.info.nBitsPerPixel == 8 && bmp.palette != null)
+ ReadIndexedImageRLE8(aReader, bmp);
+ else if (uncompressed && bmp.info.nBitsPerPixel <= 8 && bmp.palette != null)
+ ReadIndexedImage(aReader, bmp);
+ else
+ {
+ Debug.LogError("Unsupported file format: " + bmp.info.compressionMethod + " BPP: " + bmp.info.nBitsPerPixel);
+ return null;
+ }
+ return bmp;
+ }
+
+
+ private static void Read32BitImage(BinaryReader aReader, BMPImage bmp)
+ {
+ int w = Mathf.Abs(bmp.info.width);
+ int h = Mathf.Abs(bmp.info.height);
+ Color32[] data = bmp.imageData = new Color32[w * h];
+ if (aReader.BaseStream.Position + w * h * 4 > aReader.BaseStream.Length)
+ {
+ Debug.LogError("Unexpected end of file.");
+ return;
+ }
+ int shiftR = GetShiftCount(bmp.rMask);
+ int shiftG = GetShiftCount(bmp.gMask);
+ int shiftB = GetShiftCount(bmp.bMask);
+ int shiftA = GetShiftCount(bmp.aMask);
+ byte a = 255;
+ for (int i = 0; i < data.Length; i++)
+ {
+ uint v = aReader.ReadUInt32();
+ byte r = (byte)((v & bmp.rMask) >> shiftR);
+ byte g = (byte)((v & bmp.gMask) >> shiftG);
+ byte b = (byte)((v & bmp.bMask) >> shiftB);
+ if (bmp.bMask != 0)
+ a = (byte)((v & bmp.aMask) >> shiftA);
+ data[i] = new Color32(r, g, b, a);
+ }
+ }
+
+
+ private static void Read24BitImage(BinaryReader aReader, BMPImage bmp)
+ {
+ int w = Mathf.Abs(bmp.info.width);
+ int h = Mathf.Abs(bmp.info.height);
+ int rowLength = ((24 * w + 31) / 32) * 4;
+ int count = rowLength * h;
+ int pad = rowLength - w * 3;
+ Color32[] data = bmp.imageData = new Color32[w * h];
+ if (aReader.BaseStream.Position + count > aReader.BaseStream.Length)
+ {
+ Debug.LogError("Unexpected end of file. (Have " + (aReader.BaseStream.Position + count) + " bytes, expected " + aReader.BaseStream.Length + " bytes)");
+ return;
+ }
+ int shiftR = GetShiftCount(bmp.rMask);
+ int shiftG = GetShiftCount(bmp.gMask);
+ int shiftB = GetShiftCount(bmp.bMask);
+ for (int y = 0; y < h; y++)
+ {
+ for (int x = 0; x < w; x++)
+ {
+ uint v = aReader.ReadByte() | ((uint)aReader.ReadByte() << 8) | ((uint)aReader.ReadByte() << 16);
+ byte r = (byte)((v & bmp.rMask) >> shiftR);
+ byte g = (byte)((v & bmp.gMask) >> shiftG);
+ byte b = (byte)((v & bmp.bMask) >> shiftB);
+ data[x + y * w] = new Color32(r, g, b, 255);
+ }
+ for (int i = 0; i < pad; i++)
+ aReader.ReadByte();
+ }
+ }
+
+ private static void Read16BitImage(BinaryReader aReader, BMPImage bmp)
+ {
+ int w = Mathf.Abs(bmp.info.width);
+ int h = Mathf.Abs(bmp.info.height);
+ int rowLength = ((16 * w + 31) / 32) * 4;
+ int count = rowLength * h;
+ int pad = rowLength - w * 2;
+ Color32[] data = bmp.imageData = new Color32[w * h];
+ if (aReader.BaseStream.Position + count > aReader.BaseStream.Length)
+ {
+ Debug.LogError("Unexpected end of file. (Have " + (aReader.BaseStream.Position + count) + " bytes, expected " + aReader.BaseStream.Length + " bytes)");
+ return;
+ }
+ int shiftR = GetShiftCount(bmp.rMask);
+ int shiftG = GetShiftCount(bmp.gMask);
+ int shiftB = GetShiftCount(bmp.bMask);
+ int shiftA = GetShiftCount(bmp.aMask);
+ byte a = 255;
+ for (int y = 0; y < h; y++)
+ {
+ for (int x = 0; x < w; x++)
+ {
+ uint v = aReader.ReadByte() | ((uint)aReader.ReadByte() << 8);
+ byte r = (byte)((v & bmp.rMask) >> shiftR);
+ byte g = (byte)((v & bmp.gMask) >> shiftG);
+ byte b = (byte)((v & bmp.bMask) >> shiftB);
+ if (bmp.aMask != 0)
+ a = (byte)((v & bmp.aMask) >> shiftA);
+ data[x + y * w] = new Color32(r, g, b, a);
+ }
+ for (int i = 0; i < pad; i++)
+ aReader.ReadByte();
+ }
+ }
+
+ private static void ReadIndexedImage(BinaryReader aReader, BMPImage bmp)
+ {
+ int w = Mathf.Abs(bmp.info.width);
+ int h = Mathf.Abs(bmp.info.height);
+ int bitCount = bmp.info.nBitsPerPixel;
+ int rowLength = ((bitCount * w + 31) / 32) * 4;
+ int count = rowLength * h;
+ int pad = rowLength - (w * bitCount + 7) / 8;
+ Color32[] data = bmp.imageData = new Color32[w * h];
+ if (aReader.BaseStream.Position + count > aReader.BaseStream.Length)
+ {
+ Debug.LogError("Unexpected end of file. (Have " + (aReader.BaseStream.Position + count) + " bytes, expected " + aReader.BaseStream.Length + " bytes)");
+ return;
+ }
+ BitStreamReader bitReader = new BitStreamReader(aReader);
+ for (int y = 0; y < h; y++)
+ {
+ for (int x = 0; x < w; x++)
+ {
+ int v = (int)bitReader.ReadBits(bitCount);
+ if (v >= bmp.palette.Count)
+ {
+ Debug.LogError("Indexed bitmap has indices greater than it's color palette");
+ return;
+ }
+ data[x + y * w] = bmp.palette[v];
+ }
+ bitReader.Flush();
+ for (int i = 0; i < pad; i++)
+ aReader.ReadByte();
+ }
+ }
+ private static void ReadIndexedImageRLE4(BinaryReader aReader, BMPImage bmp)
+ {
+ int w = Mathf.Abs(bmp.info.width);
+ int h = Mathf.Abs(bmp.info.height);
+ Color32[] data = bmp.imageData = new Color32[w * h];
+ int x = 0;
+ int y = 0;
+ int yOffset = 0;
+ while (aReader.BaseStream.Position < aReader.BaseStream.Length - 1)
+ {
+ int count = (int)aReader.ReadByte();
+ byte d = aReader.ReadByte();
+ if (count > 0)
+ {
+ for (int i = (count / 2); i > 0; i--)
+ {
+ data[x++ + yOffset] = bmp.palette[(d >> 4) & 0x0F];
+ data[x++ + yOffset] = bmp.palette[d & 0x0F];
+ }
+ if ((count & 0x01) > 0)
+ {
+ data[x++ + yOffset] = bmp.palette[(d >> 4) & 0x0F];
+ }
+ }
+ else
+ {
+ if (d == 0)
+ {
+ x = 0;
+ y += 1;
+ yOffset = y * w;
+ }
+ else if (d == 1)
+ {
+ break;
+ }
+ else if (d == 2)
+ {
+ x += aReader.ReadByte();
+ y += aReader.ReadByte();
+ yOffset = y * w;
+ }
+ else
+ {
+ for (int i = (d / 2); i > 0; i--)
+ {
+ byte d2 = aReader.ReadByte();
+ data[x++ + yOffset] = bmp.palette[(d2 >> 4) & 0x0F];
+ data[x++ + yOffset] = bmp.palette[d2 & 0x0F];
+ }
+ if ((d & 0x01) > 0)
+ {
+ data[x++ + yOffset] = bmp.palette[(aReader.ReadByte() >> 4) & 0x0F];
+ }
+ if ((((d - 1) / 2) & 1) == 0)
+ {
+ aReader.ReadByte(); // padding (word alignment)
+ }
+ }
+ }
+ }
+ }
+ private static void ReadIndexedImageRLE8(BinaryReader aReader, BMPImage bmp)
+ {
+ int w = Mathf.Abs(bmp.info.width);
+ int h = Mathf.Abs(bmp.info.height);
+ Color32[] data = bmp.imageData = new Color32[w * h];
+ int x = 0;
+ int y = 0;
+ int yOffset = 0;
+ while (aReader.BaseStream.Position < aReader.BaseStream.Length - 1)
+ {
+ int count = (int)aReader.ReadByte();
+ byte d = aReader.ReadByte();
+ if (count > 0)
+ {
+ for (int i = count; i > 0; i--)
+ {
+ data[x++ + yOffset] = bmp.palette[d];
+ }
+ }
+ else
+ {
+ if (d == 0)
+ {
+ x = 0;
+ y += 1;
+ yOffset = y * w;
+ }
+ else if (d == 1)
+ {
+ break;
+ }
+ else if (d == 2)
+ {
+ x += aReader.ReadByte();
+ y += aReader.ReadByte();
+ yOffset = y * w;
+ }
+ else
+ {
+ for (int i = d; i > 0; i--)
+ {
+ data[x++ + yOffset] = bmp.palette[aReader.ReadByte()];
+ }
+ if ((d & 0x01) > 0)
+ {
+ aReader.ReadByte(); // padding (word alignment)
+ }
+ }
+ }
+ }
+ }
+ private static int GetShiftCount(uint mask)
+ {
+ for (int i = 0; i < 32; i++)
+ {
+ if ((mask & 0x01) > 0)
+ return i;
+ mask >>= 1;
+ }
+ return -1;
+ }
+ private static uint GetMask(int bitCount)
+ {
+ uint mask = 0;
+ for (int i = 0; i < bitCount; i++)
+ {
+ mask <<= 1;
+ mask |= 0x01;
+ }
+ return mask;
+ }
+ private static bool ReadFileHeader(BinaryReader aReader, ref BMPFileHeader aFileHeader)
+ {
+ aFileHeader.magic = aReader.ReadUInt16();
+ if (aFileHeader.magic != MAGIC)
+ return false;
+ aFileHeader.filesize = aReader.ReadUInt32();
+ aFileHeader.reserved = aReader.ReadUInt32();
+ aFileHeader.offset = aReader.ReadUInt32();
+ return true;
+ }
+ private static bool ReadInfoHeader(BinaryReader aReader, ref BitmapInfoHeader aHeader)
+ {
+ aHeader.size = aReader.ReadUInt32();
+ if (aHeader.size < 40)
+ return false;
+ aHeader.width = aReader.ReadInt32();
+ aHeader.height = aReader.ReadInt32();
+ aHeader.nColorPlanes = aReader.ReadUInt16();
+ aHeader.nBitsPerPixel = aReader.ReadUInt16();
+ aHeader.compressionMethod = (BMPComressionMode)aReader.ReadInt32();
+ aHeader.rawImageSize = aReader.ReadUInt32();
+ aHeader.xPPM = aReader.ReadInt32();
+ aHeader.yPPM = aReader.ReadInt32();
+ aHeader.nPaletteColors = aReader.ReadUInt32();
+ aHeader.nImportantColors = aReader.ReadUInt32();
+ int pad = (int)aHeader.size - 40;
+ if (pad > 0)
+ aReader.ReadBytes(pad);
+ return true;
+ }
+ public static List ReadPalette(BinaryReader aReader, BMPImage aBmp, bool aReadAlpha)
+ {
+ uint count = aBmp.info.nPaletteColors;
+ if (count == 0u)
+ count = 1u << aBmp.info.nBitsPerPixel;
+ var palette = new List((int)count);
+ for (int i = 0; i < count; i++)
+ {
+ byte b = aReader.ReadByte();
+ byte g = aReader.ReadByte();
+ byte r = aReader.ReadByte();
+ byte a = aReader.ReadByte();
+ if (!aReadAlpha)
+ a = 255;
+ palette.Add(new Color32(r, g, b, a));
+ }
+ return palette;
+ }
+
+ }
+ public class BitStreamReader
+ {
+ BinaryReader m_Reader;
+ byte m_Data = 0;
+ int m_Bits = 0;
+
+ public BitStreamReader(BinaryReader aReader)
+ {
+ m_Reader = aReader;
+ }
+ public BitStreamReader(Stream aStream) : this(new BinaryReader(aStream)) { }
+
+ public byte ReadBit()
+ {
+ if (m_Bits <= 0)
+ {
+ m_Data = m_Reader.ReadByte();
+ m_Bits = 8;
+ }
+ return (byte)((m_Data >> --m_Bits) & 1);
+ }
+
+ public ulong ReadBits(int aCount)
+ {
+ ulong val = 0UL;
+ if (aCount <= 0 || aCount > 32)
+ throw new System.ArgumentOutOfRangeException("aCount", "aCount must be between 1 and 32 inclusive");
+ for (int i = aCount - 1; i >= 0; i--)
+ val |= ((ulong)ReadBit() << i);
+ return val;
+ }
+ public void Flush()
+ {
+ m_Data = 0;
+ m_Bits = 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs.meta
new file mode 100644
index 00000000..f8c815ce
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 27d41db6b761bbb4a989566820e47137
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs
new file mode 100644
index 00000000..44fc91e7
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs
@@ -0,0 +1,34 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using UnityEngine;
+
+namespace Dummiesman
+{
+ public static class BinaryExtensions
+ {
+ public static Color32 ReadColor32RGBR(this BinaryReader r)
+ {
+ var bytes = r.ReadBytes(4);
+ return new Color32(bytes[0], bytes[1], bytes[2], 255);
+ }
+
+ public static Color32 ReadColor32RGBA(this BinaryReader r)
+ {
+ var bytes = r.ReadBytes(4);
+ return new Color32(bytes[0], bytes[1], bytes[2], bytes[3]);
+ }
+
+ public static Color32 ReadColor32RGB(this BinaryReader r)
+ {
+ var bytes = r.ReadBytes(3);
+ return new Color32(bytes[0], bytes[1], bytes[2], 255);
+ }
+
+ public static Color32 ReadColor32BGR(this BinaryReader r)
+ {
+ var bytes = r.ReadBytes(3);
+ return new Color32(bytes[2], bytes[1], bytes[0], 255);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs.meta
new file mode 100644
index 00000000..0e891010
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5b61b2ce827ad8842a6812f45f25aaa1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs
new file mode 100644
index 00000000..fd0de3a2
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs
@@ -0,0 +1,19 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Dummiesman.Extensions
+{
+ public static class ColorExtensions
+ {
+ public static Color FlipRB(this Color color)
+ {
+ return new Color(color.b, color.g, color.r, color.a);
+ }
+
+ public static Color32 FlipRB(this Color32 color)
+ {
+ return new Color32(color.b, color.g, color.r, color.a);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs.meta
new file mode 100644
index 00000000..6309c284
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8034e4bf991d15a4b88970b534ce4a0f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs
new file mode 100644
index 00000000..3fb04e3d
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using UnityEngine;
+
+namespace Dummiesman
+{
+ public static class DDSLoader
+ {
+ public static Texture2D Load(Stream ddsStream)
+ {
+ byte[] buffer = new byte[ddsStream.Length];
+ ddsStream.Read(buffer, 0, (int)ddsStream.Length);
+ return Load(buffer);
+ }
+
+ public static Texture2D Load(string ddsPath)
+ {
+ return Load(File.ReadAllBytes(ddsPath));
+ }
+
+ public static Texture2D Load(byte[] ddsBytes)
+ {
+ try
+ {
+
+ //do size check
+ byte ddsSizeCheck = ddsBytes[4];
+ if (ddsSizeCheck != 124)
+ throw new System.Exception("Invalid DDS header. Structure length is incrrrect."); //this header byte should be 124 for DDS image files
+
+ //verify we have a readable tex
+ byte DXTType = ddsBytes[87];
+ if (DXTType != 49 && DXTType != 53)
+ throw new System.Exception("Cannot load DDS due to an unsupported pixel format. Needs to be DXT1 or DXT5.");
+
+ int height = ddsBytes[13] * 256 + ddsBytes[12];
+ int width = ddsBytes[17] * 256 + ddsBytes[16];
+ bool mipmaps = ddsBytes[28] > 0;
+ TextureFormat textureFormat = DXTType == 49 ? TextureFormat.DXT1 : TextureFormat.DXT5;
+
+ int DDS_HEADER_SIZE = 128;
+ byte[] dxtBytes = new byte[ddsBytes.Length - DDS_HEADER_SIZE];
+ Buffer.BlockCopy(ddsBytes, DDS_HEADER_SIZE, dxtBytes, 0, ddsBytes.Length - DDS_HEADER_SIZE);
+
+ Texture2D texture = new Texture2D(width, height, textureFormat, mipmaps);
+ texture.LoadRawTextureData(dxtBytes);
+ texture.Apply();
+
+ return texture;
+ }
+ catch (System.Exception ex)
+ {
+ throw new Exception("An error occured while loading DirectDraw Surface: " + ex.Message);
+ }
+ }
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs.meta
new file mode 100644
index 00000000..351c9ab9
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1f9e65e68712e0f41aae633289ab739e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs
new file mode 100644
index 00000000..cf41e651
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs
@@ -0,0 +1,158 @@
+/*
+ * Created by Dummiesman 2013-2019
+ * Thanks to mikezila for improving the initial TGA loading code
+*/
+
+using System;
+using UnityEngine;
+using System.Collections;
+using System.IO;
+using B83.Image.BMP;
+
+namespace Dummiesman
+{
+ public class ImageLoader
+ {
+ ///
+ /// Converts a DirectX normal map to Unitys expected format
+ ///
+ /// Texture to convert
+ public static void SetNormalMap(ref Texture2D tex)
+ {
+ Color[] pixels = tex.GetPixels();
+ for (int i = 0; i < pixels.Length; i++)
+ {
+ Color temp = pixels[i];
+ temp.r = pixels[i].g;
+ temp.a = pixels[i].r;
+ pixels[i] = temp;
+ }
+ tex.SetPixels(pixels);
+ tex.Apply(true);
+ }
+
+ public enum TextureFormat
+ {
+ DDS,
+ TGA,
+ BMP,
+ PNG,
+ JPG,
+ CRN
+ }
+
+
+ ///
+ /// Loads a texture from a stream
+ ///
+ /// The stream
+ /// The format **NOT UNITYENGINE.TEXTUREFORMAT**
+ ///
+ public static Texture2D LoadTexture(Stream stream, TextureFormat format)
+ {
+ if (format == TextureFormat.BMP)
+ {
+ return new BMPLoader().LoadBMP(stream).ToTexture2D();
+ }
+ else if (format == TextureFormat.DDS)
+ {
+ return DDSLoader.Load(stream);
+ }
+ else if (format == TextureFormat.JPG || format == TextureFormat.PNG)
+ {
+ byte[] buffer = new byte[stream.Length];
+ stream.Read(buffer, 0, (int)stream.Length);
+
+ Texture2D texture = new Texture2D(1, 1);
+ texture.LoadImage(buffer);
+ return texture;
+ }
+ else if (format == TextureFormat.TGA)
+ {
+ return TGALoader.Load(stream);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+
+ ///
+ /// Loads a texture from a file
+ ///
+ ///
+ ///
+ ///
+ public static Texture2D LoadTexture(string fn)
+ {
+ if (!File.Exists(fn))
+ return null;
+
+ var textureBytes = File.ReadAllBytes(fn);
+ string ext = Path.GetExtension(fn).ToLower();
+ string name = Path.GetFileName(fn);
+ Texture2D returnTex = null;
+
+ switch (ext)
+ {
+ case ".png":
+ case ".jpg":
+ case ".jpeg":
+ returnTex = new Texture2D(1, 1);
+ returnTex.LoadImage(textureBytes);
+ break;
+ case ".dds":
+ returnTex = DDSLoader.Load(textureBytes);
+ break;
+ case ".tga":
+ returnTex = TGALoader.Load(textureBytes);
+ break;
+ case ".bmp":
+ returnTex = new BMPLoader().LoadBMP(textureBytes).ToTexture2D();
+ break;
+ case ".crn":
+ byte[] crnBytes = textureBytes;
+ ushort crnWidth = System.BitConverter.ToUInt16(new byte[2] { crnBytes[13], crnBytes[12] }, 0);
+ ushort crnHeight = System.BitConverter.ToUInt16(new byte[2] { crnBytes[15], crnBytes[14] }, 0);
+ byte crnFormatByte = crnBytes[18];
+
+ var crnTextureFormat = UnityEngine.TextureFormat.RGB24;
+ if (crnFormatByte == 0)
+ {
+ crnTextureFormat = UnityEngine.TextureFormat.DXT1Crunched;
+ }else if(crnFormatByte == 2)
+ {
+ crnTextureFormat = UnityEngine.TextureFormat.DXT5Crunched;
+ }
+ else if(crnFormatByte == 12)
+ {
+ crnTextureFormat = UnityEngine.TextureFormat.ETC2_RGBA8Crunched;
+ }
+ else
+ {
+ Debug.LogError("Could not load crunched texture " + name + " because its format is not supported (" + crnFormatByte + "): " + fn);
+ break;
+ }
+
+ returnTex = new Texture2D(crnWidth, crnHeight, crnTextureFormat, true);
+ returnTex.LoadRawTextureData(crnBytes);
+ returnTex.Apply(true);
+
+ break;
+ default:
+ Debug.LogError("Could not load texture " + name + " because its format is not supported : " + fn);
+ break;
+ }
+
+ if (returnTex != null)
+ {
+ returnTex = ImageLoaderHelper.VerifyFormat(returnTex);
+ returnTex.name = Path.GetFileNameWithoutExtension(fn);
+ }
+
+ return returnTex;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs.meta
new file mode 100644
index 00000000..7fb46d07
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 075edea996ccdd6489ad5e1197dd3f67
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs
new file mode 100644
index 00000000..01b69e2f
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using UnityEngine;
+
+namespace Dummiesman
+{
+ public class ImageLoaderHelper
+ {
+ ///
+ /// Verifies that a 32bpp texture is actuall 32bpp
+ ///
+ /// The verified texture
+ public static Texture2D VerifyFormat(Texture2D tex)
+ {
+ if (tex.format != UnityEngine.TextureFormat.ARGB32 && tex.format != UnityEngine.TextureFormat.RGBA32 && tex.format != UnityEngine.TextureFormat.DXT5)
+ return tex;
+
+ //get pixels
+ var pixels = tex.GetPixels32();
+ bool validFormat = false;
+
+ //check each pixel alpha
+ foreach(var px in pixels)
+ {
+ if(px.a < 255)
+ {
+ validFormat = true;
+ break;
+ }
+ }
+
+ //if it's not a valid format return a new 24bpp image
+ if (!validFormat)
+ {
+ var tex24 = new Texture2D(tex.width, tex.height, UnityEngine.TextureFormat.RGB24, tex.mipmapCount > 0);
+ tex24.SetPixels32(pixels);
+ tex24.Apply(true);
+ return tex24;
+ }
+
+ //return original if valid
+ return tex;
+ }
+
+ ///
+ /// A cluster for creating arrays of Unity Color
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void FillPixelArray(Color32[] fillArray, byte[] pixelData, int bytesPerPixel, bool bgra = false)
+ {
+ //special case for TGA :(
+ if (bgra)
+ {
+ if (bytesPerPixel == 4)
+ {
+ for (int i = 0; i < fillArray.Length; i++)
+ {
+ int bi = i * bytesPerPixel;
+ fillArray[i] = new Color32(pixelData[bi + 2], pixelData[bi + 1], pixelData[bi], pixelData[bi + 3]);
+ }
+ }
+ else
+ {
+ //24 bit BGR to Color32 (RGBA)
+ //this is faster than safe code
+ for (int i = 0; i < fillArray.Length; i++)
+ {
+ fillArray[i].r = pixelData[(i * 3) + 2];
+ fillArray[i].g = pixelData[(i * 3) + 1];
+ fillArray[i].b = pixelData[(i * 3) + 0];
+ }
+ }
+ }
+ else
+ {
+ if (bytesPerPixel == 4)
+ {
+ for (int i = 0; i < fillArray.Length; i++)
+ {
+ fillArray[i].r = pixelData[i * 4];
+ fillArray[i].g = pixelData[(i * 4) + 1];
+ fillArray[i].b = pixelData[(i * 4) + 2];
+ fillArray[i].a = pixelData[(i * 4) + 3];
+ }
+ }
+ else
+ {
+ //with RGB we can't! :(
+ int bi = 0;
+ for (int i = 0; i < fillArray.Length; i++)
+ {
+ fillArray[i].r = pixelData[bi++];
+ fillArray[i].g = pixelData[bi++];
+ fillArray[i].b = pixelData[bi++];
+ fillArray[i].a = 255;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs.meta
new file mode 100644
index 00000000..c0538673
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b8658e22fc9a3c94ab5d8c6460812b69
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs
new file mode 100644
index 00000000..136d260b
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs
@@ -0,0 +1,35 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Dummiesman
+{
+ public static class ImageUtils
+ {
+ public static Texture2D ConvertToNormalMap(Texture2D tex)
+ {
+ Texture2D returnTex = tex;
+ if(tex.format != TextureFormat.RGBA32 && tex.format != TextureFormat.ARGB32)
+ {
+ returnTex = new Texture2D(tex.width, tex.height, TextureFormat.RGBA32, true);
+ }
+
+ Color[] pixels = tex.GetPixels();
+ for (int i = 0; i < pixels.Length; i++)
+ {
+ Color temp = pixels[i];
+ temp.a = pixels[i].r;
+ temp.r = 0f;
+ temp.g = pixels[i].g;
+ temp.b = 0f;
+ pixels[i] = temp;
+ }
+
+ returnTex.SetPixels(pixels);
+ returnTex.Apply(true);
+ return returnTex;
+ }
+
+ }
+}
+
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs.meta
new file mode 100644
index 00000000..13bbb3db
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 594f0c9c36902bc4aa1e6fd12ae28fd0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs
new file mode 100644
index 00000000..c4d351d4
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs
@@ -0,0 +1,127 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System.IO;
+using System;
+using Dummiesman.Extensions;
+using System.Runtime.InteropServices;
+
+namespace Dummiesman
+{
+ public class TGALoader
+ {
+ private static int GetBits(byte b, int offset, int count)
+ {
+ return (b >> offset) & ((1 << count) - 1);
+ }
+
+ private static Color32[] LoadRawTGAData(BinaryReader r, int bitDepth, int width, int height)
+ {
+ Color32[] pulledColors = new Color32[width * height];
+
+ byte[] colorData = r.ReadBytes(width * height * (bitDepth / 8));
+ ImageLoaderHelper.FillPixelArray(pulledColors, colorData, (bitDepth / 8), true);
+
+ return pulledColors;
+ }
+
+ private static Color32[] LoadRLETGAData(BinaryReader r, int bitDepth, int width, int height)
+ {
+ Color32[] pulledColors = new Color32[width * height];
+ int pulledColorCount = 0;
+
+ while (pulledColorCount < pulledColors.Length)
+ {
+ byte rlePacket = r.ReadByte();
+ int RLEPacketType = GetBits(rlePacket, 7, 1);
+ int RLEPixelCount = GetBits(rlePacket, 0, 7) + 1;
+
+
+ if (RLEPacketType == 0)
+ {
+ //raw packet
+ for (int i = 0; i < RLEPixelCount; i++)
+ {
+ var color = (bitDepth == 32) ? r.ReadColor32RGBA().FlipRB() : r.ReadColor32RGB().FlipRB();
+ pulledColors[i + pulledColorCount] = color;
+ }
+
+ }
+ else
+ {
+ //rle packet
+ var color = (bitDepth == 32) ? r.ReadColor32RGBA().FlipRB() : r.ReadColor32RGB().FlipRB();
+
+ for (int i = 0; i < RLEPixelCount; i++)
+ {
+ pulledColors[i + pulledColorCount] = color;
+ }
+ }
+
+ pulledColorCount += RLEPixelCount;
+ }
+
+ return pulledColors;
+ }
+
+ public static Texture2D Load(string fileName)
+ {
+ using (var imageFile = File.OpenRead(fileName))
+ {
+ return Load(imageFile);
+ }
+ }
+
+ public static Texture2D Load(byte[] bytes)
+ {
+ using (var ms = new MemoryStream(bytes))
+ {
+ return Load(ms);
+ }
+ }
+
+ public static Texture2D Load(Stream TGAStream)
+ {
+
+ using (BinaryReader r = new BinaryReader(TGAStream))
+ {
+ // Skip some header info we don't care about.
+ r.BaseStream.Seek(2, SeekOrigin.Begin);
+
+ byte imageType = r.ReadByte();
+ if (imageType != 10 && imageType != 2)
+ {
+ Debug.LogError($"Unsupported targa image type. ({imageType})");
+ return null;
+ }
+
+ //Skip right to some more data we need
+ r.BaseStream.Seek(12, SeekOrigin.Begin);
+
+ short width = r.ReadInt16();
+ short height = r.ReadInt16();
+ int bitDepth = r.ReadByte();
+
+ if (bitDepth < 24)
+ throw new Exception("Tried to load TGA with unsupported bit depth");
+
+ // Skip a byte of header information we don't care about.
+ r.BaseStream.Seek(1, SeekOrigin.Current);
+
+ Texture2D tex = new Texture2D(width, height, (bitDepth == 24) ? TextureFormat.RGB24 : TextureFormat.ARGB32, true);
+ if (imageType == 2)
+ {
+ tex.SetPixels32(LoadRawTGAData(r, bitDepth, width, height));
+ }
+ else
+ {
+ tex.SetPixels32(LoadRLETGAData(r, bitDepth, width, height));
+ }
+
+ tex.Apply();
+ return tex;
+
+ }
+ }
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs.meta
new file mode 100644
index 00000000..3c90b240
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1b682979498a095418396a690d23c0b0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs
new file mode 100644
index 00000000..004fc338
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs
@@ -0,0 +1,482 @@
+using System;
+using UnityEngine;
+
+/// https://wiki.unity3d.com/index.php/ProceduralPrimitives
+public class ProceduralMesh
+{
+ public static Mesh CreateBox(in float length = 1f, in float width = 1f, in float height = 1f)
+ {
+ Mesh mesh = new Mesh();
+ mesh.Clear();
+ mesh.name = "Box";
+
+ #region Vertices
+ var p0 = new Vector3(-length * .5f, -width * .5f, height * .5f);
+ var p1 = new Vector3(length * .5f, -width * .5f, height * .5f);
+ var p2 = new Vector3(length * .5f, -width * .5f, -height * .5f);
+ var p3 = new Vector3(-length * .5f, -width * .5f, -height * .5f);
+
+ var p4 = new Vector3(-length * .5f, width * .5f, height * .5f);
+ var p5 = new Vector3(length * .5f, width * .5f, height * .5f);
+ var p6 = new Vector3(length * .5f, width * .5f, -height * .5f);
+ var p7 = new Vector3(-length * .5f, width * .5f, -height * .5f);
+
+ Vector3[] vertices = new Vector3[]
+ {
+ p0, p1, p2, p3, // Bottom
+ p7, p4, p0, p3, // Left
+ p4, p5, p1, p0, // Front
+ p6, p7, p3, p2, // Back
+ p5, p6, p2, p1, // Right
+ p7, p6, p5, p4 // Top
+ };
+ #endregion
+
+ #region Normales
+ var up = Vector3.up;
+ var down = Vector3.down;
+ var front = Vector3.forward;
+ var back = Vector3.back;
+ var left = Vector3.left;
+ var right = Vector3.right;
+
+ Vector3[] normales = new Vector3[]
+ {
+ down, down, down, down, // Bottom
+ left, left, left, left, // Left
+ front, front, front, front, // Front
+ back, back, back, back, // Back
+ right, right, right, right, // Right
+ up, up, up, up // Top
+ };
+ #endregion
+
+ #region UVs
+ Vector2 _00 = new Vector2(0f, 0f);
+ Vector2 _10 = new Vector2(1f, 0f);
+ Vector2 _01 = new Vector2(0f, 1f);
+ Vector2 _11 = new Vector2(1f, 1f);
+
+ Vector2[] uvs = new Vector2[]
+ {
+ _11, _01, _00, _10, // Bottom
+ _11, _01, _00, _10, // Left
+ _11, _01, _00, _10, // Front
+ _11, _01, _00, _10, // Back
+ _11, _01, _00, _10, // Right
+ _11, _01, _00, _10, // Top
+ };
+ #endregion
+
+ #region Triangles
+ int[] triangles = new int[]
+ {
+ // Bottom
+ 3, 1, 0,
+ 3, 2, 1,
+
+ // Left
+ 3 + 4 * 1, 1 + 4 * 1, 0 + 4 * 1,
+ 3 + 4 * 1, 2 + 4 * 1, 1 + 4 * 1,
+
+ // Front
+ 3 + 4 * 2, 1 + 4 * 2, 0 + 4 * 2,
+ 3 + 4 * 2, 2 + 4 * 2, 1 + 4 * 2,
+
+ // Back
+ 3 + 4 * 3, 1 + 4 * 3, 0 + 4 * 3,
+ 3 + 4 * 3, 2 + 4 * 3, 1 + 4 * 3,
+
+ // Right
+ 3 + 4 * 4, 1 + 4 * 4, 0 + 4 * 4,
+ 3 + 4 * 4, 2 + 4 * 4, 1 + 4 * 4,
+
+ // Top
+ 3 + 4 * 5, 1 + 4 * 5, 0 + 4 * 5,
+ 3 + 4 * 5, 2 + 4 * 5, 1 + 4 * 5,
+ };
+ #endregion
+
+ mesh.vertices = vertices;
+ mesh.normals = normales;
+ mesh.uv = uvs;
+ mesh.triangles = triangles;
+
+ mesh.RecalculateBounds();
+ mesh.Optimize();
+
+ return mesh;
+ }
+
+ public static Mesh CreateCylinder(in float radius = 1f, in float height = 1f, in int nbSides = 36)
+ {
+ return CreateCone(radius, radius, height, nbSides);
+ }
+
+ public static Mesh CreateCone(in float topRadius = .01f, in float bottomRadius = 0.5f, in float height = 1f, in int nbSides = 18)
+ {
+ Mesh mesh = new Mesh();
+ mesh.Clear();
+ mesh.name = (topRadius.Equals(bottomRadius)) ? "Cylinder" : "Cone";
+
+ float heightHalf = height / 2;
+ const int nbHeightSeg = 1; // Not implemented yet
+
+ int nbVerticesCap = nbSides + 1;
+
+ #region Vertices
+ // bottom + top + sides
+ Vector3[] vertices = new Vector3[nbVerticesCap + nbVerticesCap + nbSides * nbHeightSeg * 2 + 2];
+ int vert = 0;
+ float _2pi = Mathf.PI * 2f;
+
+ // Bottom cap
+ vertices[vert++] = new Vector3(0f, -heightHalf, 0f);
+ while (vert <= nbSides)
+ {
+ float rad = (float)vert / nbSides * _2pi;
+ vertices[vert] = new Vector3(Mathf.Cos(rad) * bottomRadius, -heightHalf, Mathf.Sin(rad) * bottomRadius);
+ vert++;
+ }
+
+ // Top cap
+ vertices[vert++] = new Vector3(0f, heightHalf, 0f);
+ while (vert <= nbSides * 2 + 1)
+ {
+ float rad = (float)(vert - nbSides - 1) / nbSides * _2pi;
+ vertices[vert] = new Vector3(Mathf.Cos(rad) * topRadius, heightHalf, Mathf.Sin(rad) * topRadius);
+ vert++;
+ }
+
+ // Sides
+ int v = 0;
+ while (vert <= vertices.Length - 4)
+ {
+ float rad = (float)v / nbSides * _2pi;
+ vertices[vert] = new Vector3(Mathf.Cos(rad) * topRadius, heightHalf, Mathf.Sin(rad) * topRadius);
+ vertices[vert + 1] = new Vector3(Mathf.Cos(rad) * bottomRadius, -heightHalf, Mathf.Sin(rad) * bottomRadius);
+ vert += 2;
+ v++;
+ }
+ vertices[vert] = vertices[nbSides * 2 + 2];
+ vertices[vert + 1] = vertices[nbSides * 2 + 3];
+ #endregion
+
+ #region Normales
+
+ // bottom + top + sides
+ Vector3[] normales = new Vector3[vertices.Length];
+ vert = 0;
+
+ // Bottom cap
+ while (vert <= nbSides)
+ {
+ normales[vert++] = Vector3.down;
+ }
+
+ // Top cap
+ while (vert <= nbSides * 2 + 1)
+ {
+ normales[vert++] = Vector3.up;
+ }
+
+ // Sides
+ v = 0;
+ while (vert <= vertices.Length - 4)
+ {
+ float rad = (float)v / nbSides * _2pi;
+ float cos = Mathf.Cos(rad);
+ float sin = Mathf.Sin(rad);
+
+ normales[vert] = new Vector3(cos, 0f, sin);
+ normales[vert + 1] = normales[vert];
+
+ vert += 2;
+ v++;
+ }
+ normales[vert] = normales[nbSides * 2 + 2];
+ normales[vert + 1] = normales[nbSides * 2 + 3];
+ #endregion
+
+ #region UVs
+ Vector2[] uvs = new Vector2[vertices.Length];
+
+ // Bottom cap
+ int u = 0;
+ uvs[u++] = new Vector2(0.5f, 0.5f);
+ while (u <= nbSides)
+ {
+ float rad = (float)u / nbSides * _2pi;
+ uvs[u] = new Vector2(Mathf.Cos(rad) * .5f + .5f, Mathf.Sin(rad) * .5f + .5f);
+ u++;
+ }
+
+ // Top cap
+ uvs[u++] = new Vector2(0.5f, 0.5f);
+ while (u <= nbSides * 2 + 1)
+ {
+ float rad = (float)u / nbSides * _2pi;
+ uvs[u] = new Vector2(Mathf.Cos(rad) * .5f + .5f, Mathf.Sin(rad) * .5f + .5f);
+ u++;
+ }
+
+ // Sides
+ int u_sides = 0;
+ while (u <= uvs.Length - 4)
+ {
+ float t = (float)u_sides / nbSides;
+ uvs[u] = new Vector3(t, 1f);
+ uvs[u + 1] = new Vector3(t, 0f);
+ u += 2;
+ u_sides++;
+ }
+ uvs[u] = new Vector2(1f, 1f);
+ uvs[u + 1] = new Vector2(1f, 0f);
+ #endregion
+
+ #region Triangles
+ int nbTriangles = nbSides + nbSides + nbSides * 2;
+ int[] triangles = new int[nbTriangles * 3 + 3];
+
+ // Bottom cap
+ int tri = 0;
+ int i = 0;
+ while (tri < nbSides - 1)
+ {
+ triangles[i] = 0;
+ triangles[i + 1] = tri + 1;
+ triangles[i + 2] = tri + 2;
+ tri++;
+ i += 3;
+ }
+ triangles[i] = 0;
+ triangles[i + 1] = tri + 1;
+ triangles[i + 2] = 1;
+ tri++;
+ i += 3;
+
+ // Top cap
+ //tri++;
+ while (tri < nbSides * 2)
+ {
+ triangles[i] = tri + 2;
+ triangles[i + 1] = tri + 1;
+ triangles[i + 2] = nbVerticesCap;
+ tri++;
+ i += 3;
+ }
+
+ triangles[i] = nbVerticesCap + 1;
+ triangles[i + 1] = tri + 1;
+ triangles[i + 2] = nbVerticesCap;
+ tri++;
+ i += 3;
+ tri++;
+
+ // Sides
+ while (tri <= nbTriangles)
+ {
+ triangles[i] = tri + 2;
+ triangles[i + 1] = tri + 1;
+ triangles[i + 2] = tri + 0;
+ tri++;
+ i += 3;
+
+ triangles[i] = tri + 1;
+ triangles[i + 1] = tri + 2;
+ triangles[i + 2] = tri + 0;
+ tri++;
+ i += 3;
+ }
+ #endregion
+
+ mesh.vertices = vertices;
+ mesh.normals = normales;
+ mesh.uv = uvs;
+ mesh.triangles = triangles;
+
+ mesh.RecalculateTangents();
+ mesh.RecalculateBounds();
+ mesh.RecalculateNormals();
+ mesh.Optimize();
+
+ return mesh;
+ }
+
+
+ // Longitude |||
+ // Latitude ---
+ public static Mesh CreateSphere(in float radius = 1f, int nbLong = 24, int nbLat = 16)
+ {
+ Mesh mesh = new Mesh();
+ mesh.Clear();
+ mesh.name = "Sphere";
+
+ #region Vertices
+ Vector3[] vertices = new Vector3[(nbLong + 1) * nbLat + 2];
+ float _pi = Mathf.PI;
+ float _2pi = _pi * 2f;
+
+ vertices[0] = Vector3.up * radius;
+ for (int lat = 0; lat < nbLat; lat++)
+ {
+ float a1 = _pi * (float)(lat + 1) / (nbLat + 1);
+ float sin1 = Mathf.Sin(a1);
+ float cos1 = Mathf.Cos(a1);
+
+ for (int lon = 0; lon <= nbLong; lon++)
+ {
+ float a2 = _2pi * (float)(lon == nbLong ? 0 : lon) / nbLong;
+ float sin2 = Mathf.Sin(a2);
+ float cos2 = Mathf.Cos(a2);
+
+ vertices[lon + lat * (nbLong + 1) + 1] = new Vector3(sin1 * cos2, cos1, sin1 * sin2) * radius;
+ }
+ }
+ vertices[vertices.Length - 1] = Vector3.up * -radius;
+ #endregion
+
+ #region Normales
+ Vector3[] normales = new Vector3[vertices.Length];
+ for (int n = 0; n < vertices.Length; n++)
+ normales[n] = vertices[n].normalized;
+ #endregion
+
+ #region UVs
+ Vector2[] uvs = new Vector2[vertices.Length];
+ uvs[0] = Vector2.up;
+ uvs[uvs.Length - 1] = Vector2.zero;
+ for (int lat = 0; lat < nbLat; lat++)
+ for (int lon = 0; lon <= nbLong; lon++)
+ uvs[lon + lat * (nbLong + 1) + 1] = new Vector2((float)lon / nbLong, 1f - (float)(lat + 1) / (nbLat + 1));
+ #endregion
+
+ #region Triangles
+ int nbFaces = vertices.Length;
+ int nbTriangles = nbFaces * 2;
+ int nbIndexes = nbTriangles * 3;
+ int[] triangles = new int[nbIndexes];
+
+ //Top Cap
+ int i = 0;
+ for (int lon = 0; lon < nbLong; lon++)
+ {
+ triangles[i++] = lon + 2;
+ triangles[i++] = lon + 1;
+ triangles[i++] = 0;
+ }
+
+ //Middle
+ for (int lat = 0; lat < nbLat - 1; lat++)
+ {
+ for (int lon = 0; lon < nbLong; lon++)
+ {
+ int current = lon + lat * (nbLong + 1) + 1;
+ int next = current + nbLong + 1;
+
+ triangles[i++] = current;
+ triangles[i++] = current + 1;
+ triangles[i++] = next + 1;
+
+ triangles[i++] = current;
+ triangles[i++] = next + 1;
+ triangles[i++] = next;
+ }
+ }
+
+ //Bottom Cap
+ for (int lon = 0; lon < nbLong; lon++)
+ {
+ triangles[i++] = vertices.Length - 1;
+ triangles[i++] = vertices.Length - (lon + 2) - 1;
+ triangles[i++] = vertices.Length - (lon + 1) - 1;
+ }
+ #endregion
+
+ mesh.vertices = vertices;
+ mesh.normals = normales;
+ mesh.uv = uvs;
+ mesh.triangles = triangles;
+
+ mesh.RecalculateBounds();
+ mesh.Optimize();
+
+ return mesh;
+ }
+
+ // 2 minimum
+ public static Mesh CreatePlane(in float length = 1f, in float width = 1f, Vector3 normal = default(Vector3), in int resX = 2, in int resZ = 2)
+ {
+ if (normal.Equals(default(Vector3)))
+ {
+ normal = Vector3.up;
+ }
+
+ Mesh mesh = new Mesh();
+ mesh.Clear();
+ mesh.name = "Plane";
+
+ #region Vertices
+ Vector3[] vertices = new Vector3[resX * resZ];
+ for (int z = 0; z < resZ; z++)
+ {
+ // [ -length / 2, length / 2 ]
+ float zPos = ((float)z / (resZ - 1) - .5f) * length;
+ for (int x = 0; x < resX; x++)
+ {
+ // [ -width / 2, width / 2 ]
+ float xPos = ((float)x / (resX - 1) - .5f) * width;
+ vertices[x + z * resX] = new Vector3(xPos, 0f, zPos);
+ }
+ }
+ #endregion
+
+ #region Normales
+ Vector3[] normales = new Vector3[vertices.Length];
+ for (int n = 0; n < normales.Length; n++)
+ {
+ normales[n] = normal;
+ }
+ #endregion
+
+ #region UVs
+ Vector2[] uvs = new Vector2[vertices.Length];
+ for (int v = 0; v < resZ; v++)
+ {
+ for (int u = 0; u < resX; u++)
+ {
+ uvs[u + v * resX] = new Vector2((float)u / (resX - 1), (float)v / (resZ - 1));
+ }
+ }
+ #endregion
+
+ #region Triangles
+ int nbFaces = (resX - 1) * (resZ - 1);
+ int[] triangles = new int[nbFaces * 6];
+ int t = 0;
+ for (int face = 0; face < nbFaces; face++)
+ {
+ // Retrieve lower left corner from face ind
+ int i = face % (resX - 1) + (face / (resZ - 1) * resX);
+
+ triangles[t++] = i + resX;
+ triangles[t++] = i + 1;
+ triangles[t++] = i;
+
+ triangles[t++] = i + resX;
+ triangles[t++] = i + resX + 1;
+ triangles[t++] = i + 1;
+ }
+ #endregion
+
+ mesh.vertices = vertices;
+ mesh.normals = normales;
+ mesh.uv = uvs;
+ mesh.triangles = triangles;
+
+ mesh.RecalculateBounds();
+ mesh.Optimize();
+
+ return mesh;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs.meta b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs.meta
new file mode 100644
index 00000000..2631f85d
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 68fa5e4aa376d85a0af3e8514de3520f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl.meta b/Assets/Scripts/Tools/Mesh/pb_Stl.meta
new file mode 100644
index 00000000..9c5d87fc
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: beaaceb919c9d2dc38b2515abc839126
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime.meta
new file mode 100644
index 00000000..9b9554e6
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1cccb3810f8a73e46a1b2ce0f80f981c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs
new file mode 100644
index 00000000..4d569a76
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs
@@ -0,0 +1,284 @@
+using UnityEngine;
+using System.Linq;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace Parabox.Stl
+{
+ public static class Exporter
+ {
+ ///
+ /// Export a hierarchy of GameObjects to path with file type.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool Export(string path, GameObject[] gameObjects, FileType type)
+ {
+ Mesh[] meshes = CreateWorldSpaceMeshesWithTransforms(gameObjects.Select(x => x.transform).ToArray());
+ bool success = false;
+
+ if(meshes != null && meshes.Length > 0)
+ {
+ if(!string.IsNullOrEmpty(path))
+ success = Exporter.WriteFile(path, meshes, type);
+ }
+
+ for(int i = 0; meshes != null && i < meshes.Length; i++)
+ Object.DestroyImmediate(meshes[i]);
+
+ return success;
+ }
+
+ /**
+ * Extracts a list of mesh values with their relative transformations intact.
+ */
+ private static Mesh[] CreateWorldSpaceMeshesWithTransforms(IList transforms)
+ {
+ if(transforms == null || transforms.Count < 1)
+ return null;
+
+ // move root node to center of selection
+ Vector3 p = Vector3.zero;
+
+ for(int i = 0; i < transforms.Count; i++)
+ p += transforms[i].position;
+ Vector3 mesh_center = p / (float) transforms.Count;
+
+ GameObject root = new GameObject();
+ root.name = "ROOT";
+ root.transform.position = mesh_center;
+
+ // copy all transforms to new root gameobject
+ foreach(Transform t in transforms)
+ {
+ GameObject go = (GameObject) GameObject.Instantiate(t.gameObject);
+ go.transform.SetParent(t.parent, false);
+ go.transform.SetParent(root.transform, true);
+ }
+
+ // move root to 0,0,0 so mesh transformations are relative to origin
+ root.transform.position = Vector3.zero;
+
+ // create new meshes by iterating the root node and transforming vertex & normal
+ // values (ignoring all other mesh attributes since STL doesn't care about them)
+ List mfs = root.GetComponentsInChildren().Where(x => x.sharedMesh != null).ToList();
+ int meshCount = mfs.Count;
+ Mesh[] meshes = new Mesh[meshCount];
+
+ for(int i = 0; i < meshCount; i++)
+ {
+ Transform t = mfs[i].transform;
+
+ Vector3[] v = mfs[i].sharedMesh.vertices;
+ Vector3[] n = mfs[i].sharedMesh.normals;
+
+ for(int it = 0; it < v.Length; it++)
+ {
+ v[it] = t.TransformPoint(v[it]);
+ n[it] = t.TransformDirection(n[it]);
+ }
+
+ Mesh m = new Mesh();
+
+ m.name = mfs[i].name;
+ m.vertices = v;
+ m.normals = n;
+ m.triangles = mfs[i].sharedMesh.triangles;
+
+ meshes[i] = m;
+ }
+
+ // Cleanup
+ GameObject.DestroyImmediate(root);
+
+ return meshes;
+ }
+
+ ///
+ /// Write a mesh file to STL format.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool WriteFile(string path, Mesh mesh, FileType type = FileType.Ascii, bool convertToRightHandedCoordinates = true)
+ {
+ return WriteFile(path, new Mesh[] { mesh }, type, convertToRightHandedCoordinates);
+ }
+
+ /**
+ * Write a collection of mesh assets to an STL file.
+ * No transformations are performed on meshes in this method.
+ * Eg, if you want to export a set of a meshes in a transform
+ * hierarchy the meshes should be transformed prior to this call.
+ *
+ * string path - Where to write the file.
+ * IList meshes - The mesh assets to write.
+ * FileType type - How to format the file (in ASCII or binary).
+ */
+ public static bool WriteFile(string path, IList meshes, FileType type = FileType.Ascii, bool convertToRightHandedCoordinates = true)
+ {
+ try
+ {
+ switch(type)
+ {
+ case FileType.Binary:
+ {
+ // http://paulbourke.net/dataformats/stl/
+ // http://www.fabbers.com/tech/STL_Format
+ using (BinaryWriter writer = new BinaryWriter(File.Open(path, FileMode.Create), new ASCIIEncoding()))
+ {
+ // 80 byte header
+ writer.Write(new byte[80]);
+
+ uint totalTriangleCount = (uint) (meshes.Sum(x => x.triangles.Length) / 3);
+
+ // unsigned long facet count (4 bytes)
+ writer.Write( totalTriangleCount );
+
+ foreach(Mesh mesh in meshes)
+ {
+ Vector3[] v = mesh.vertices;
+ Vector3[] n = mesh.normals;
+
+ if(convertToRightHandedCoordinates)
+ {
+ for(int i = 0, c = v.Length; i < c; i++)
+ {
+ v[i] = Stl.ToCoordinateSpace(v[i], CoordinateSpace.Right);
+ n[i] = Stl.ToCoordinateSpace(n[i], CoordinateSpace.Right);
+ }
+ }
+
+ int[] t = mesh.triangles;
+ int triangleCount = t.Length;
+ if(convertToRightHandedCoordinates)
+ System.Array.Reverse(t);
+
+ for(int i = 0; i < triangleCount; i += 3)
+ {
+ int a = t[i], b = t[i+1], c = t[i+2];
+
+ Vector3 avg = AvgNrm(n[a], n[b], n[c]);
+
+ writer.Write(avg.x);
+ writer.Write(avg.y);
+ writer.Write(avg.z);
+
+ writer.Write(v[a].x);
+ writer.Write(v[a].y);
+ writer.Write(v[a].z);
+
+ writer.Write(v[b].x);
+ writer.Write(v[b].y);
+ writer.Write(v[b].z);
+
+ writer.Write(v[c].x);
+ writer.Write(v[c].y);
+ writer.Write(v[c].z);
+
+ // specification says attribute byte count should be set to 0.
+ writer.Write( (ushort)0 );
+ }
+ }
+ }
+ }
+ break;
+
+ default:
+ string model = WriteString(meshes);
+ File.WriteAllText(path, model);
+ break;
+ }
+ }
+ catch(System.Exception e)
+ {
+ UnityEngine.Debug.LogError(e.ToString());
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Write a Unity mesh to an ASCII STL string.
+ */
+ public static string WriteString(Mesh mesh, bool convertToRightHandedCoordinates = true)
+ {
+ return WriteString(new Mesh[] { mesh }, convertToRightHandedCoordinates);
+ }
+
+ /**
+ * Write a set of meshes to an ASCII string in STL format.
+ */
+ public static string WriteString(IList meshes, bool convertToRightHandedCoordinates = true)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ string name = meshes.Count == 1 ? meshes[0].name : "Composite Mesh";
+
+ sb.AppendLine(string.Format("solid {0}", name));
+
+ foreach(Mesh mesh in meshes)
+ {
+ Vector3[] v = mesh.vertices;
+ Vector3[] n = mesh.normals;
+ int[] t = mesh.triangles;
+
+ if(convertToRightHandedCoordinates)
+ {
+ for(int i = 0, c = v.Length; i < c; i++)
+ {
+ v[i] = Stl.ToCoordinateSpace(v[i], CoordinateSpace.Right);
+ n[i] = Stl.ToCoordinateSpace(n[i], CoordinateSpace.Right);
+ }
+
+ System.Array.Reverse(t);
+ }
+
+ int triLen = t.Length;
+
+ for(int i = 0; i < triLen; i+=3)
+ {
+ int a = t[i];
+ int b = t[i+1];
+ int c = t[i+2];
+
+ Vector3 nrm = AvgNrm(n[a], n[b], n[c]);
+
+ sb.AppendLine(string.Format("facet normal {0} {1} {2}", nrm.x, nrm.y, nrm.z));
+
+ sb.AppendLine("outer loop");
+
+ sb.AppendLine(string.Format("\tvertex {0} {1} {2}", v[a].x, v[a].y, v[a].z));
+ sb.AppendLine(string.Format("\tvertex {0} {1} {2}", v[b].x, v[b].y, v[b].z));
+ sb.AppendLine(string.Format("\tvertex {0} {1} {2}", v[c].x, v[c].y, v[c].z));
+
+ sb.AppendLine("endloop");
+
+ sb.AppendLine("endfacet");
+ }
+ }
+
+ sb.AppendLine(string.Format("endsolid {0}", name));
+
+ return sb.ToString();
+ }
+
+ /**
+ * Average of 3 vectors.
+ */
+ private static Vector3 AvgNrm(Vector3 a, Vector3 b, Vector3 c)
+ {
+ return new Vector3(
+ (a.x + b.x + c.x) / 3f,
+ (a.y + b.y + c.y) / 3f,
+ (a.z + b.z + c.z) / 3f );
+ }
+
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs.meta
new file mode 100644
index 00000000..2e03424d
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ec710640803d78441963c0f7a8c785e0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs
new file mode 100644
index 00000000..3aef5f55
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs
@@ -0,0 +1,453 @@
+using System;
+using UnityEngine;
+using System.Collections.Generic;
+using System.Linq;
+using System.IO;
+using System.Text;
+using UnityEngine.Rendering;
+
+namespace Parabox.Stl
+{
+ ///
+ /// Import mesh assets from an STL file.
+ ///
+ public static class Importer
+ {
+ const int MaxFacetsPerMesh16 = UInt16.MaxValue / 3;
+ const int MaxFacetsPerMesh32 = int.MaxValue / 3;
+
+ struct Facet
+ {
+ public Vector3 normal;
+ public Vector3 a, b, c;
+
+ public Facet(Vector3 normal, Vector3 a, Vector3 b, Vector3 c)
+ {
+ this.normal = normal;
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ }
+
+ public override string ToString()
+ {
+ return string.Format("{0:F2}: {1:F2}, {2:F2}, {3:F2}", normal, a, b, c);
+ }
+ }
+
+ ///
+ /// Import an STL file.
+ ///
+ /// The path to load STL file from.
+ ///
+ public static Mesh[] Import(string path, CoordinateSpace space = CoordinateSpace.Right, UpAxis axis = UpAxis.Y, bool smooth = false, IndexFormat indexFormat = IndexFormat.UInt16)
+ {
+ IEnumerable facets = null;
+
+ if( IsBinary(path) )
+ {
+ try
+ {
+ facets = ImportBinary(path);
+ }
+ catch(System.Exception e)
+ {
+ UnityEngine.Debug.LogWarning(string.Format("Failed importing mesh at path {0}.\n{1}", path, e.ToString()));
+ return null;
+ }
+ }
+ else
+ {
+ facets = ImportAscii(path);
+ }
+
+ if(smooth)
+ return ImportSmoothNormals(facets, space, axis, indexFormat);
+
+ return ImportHardNormals(facets, space, axis, indexFormat);
+ }
+
+ static IEnumerable ImportBinary(string path)
+ {
+ Facet[] facets;
+
+ using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
+ {
+ using (BinaryReader br = new BinaryReader(fs, new ASCIIEncoding()))
+ {
+ // read header
+ br.ReadBytes(80);
+
+ uint facetCount = br.ReadUInt32();
+ facets = new Facet[facetCount];
+
+ for(uint i = 0; i < facetCount; i++)
+ facets[i] = br.GetFacet();
+ }
+ }
+
+ return facets;
+ }
+
+ static Facet GetFacet(this BinaryReader binaryReader)
+ {
+ Facet facet = new Facet(
+ binaryReader.GetVector3(), // Normal
+ binaryReader.GetVector3(), // A
+ binaryReader.GetVector3(), // B
+ binaryReader.GetVector3() // C
+ );
+
+ binaryReader.ReadUInt16(); // padding
+
+ return facet;
+ }
+
+ static Vector3 GetVector3(this BinaryReader binaryReader)
+ {
+ return new Vector3(
+ binaryReader.ReadSingle(),
+ binaryReader.ReadSingle(),
+ binaryReader.ReadSingle() );
+ }
+
+ const int SOLID = 1;
+ const int FACET = 2;
+ const int OUTER = 3;
+ const int VERTEX = 4;
+ const int ENDLOOP = 5;
+ const int ENDFACET = 6;
+ const int ENDSOLID = 7;
+ const int EMPTY = 0;
+
+ static int ReadState(string line)
+ {
+ if(line.StartsWith("solid"))
+ return SOLID;
+ else if(line.StartsWith("facet"))
+ return FACET;
+ else if(line.StartsWith("outer"))
+ return OUTER;
+ else if(line.StartsWith("vertex"))
+ return VERTEX;
+ else if(line.StartsWith("endloop"))
+ return ENDLOOP;
+ else if(line.StartsWith("endfacet"))
+ return ENDFACET;
+ else if(line.StartsWith("endsolid"))
+ return ENDSOLID;
+ else
+ return EMPTY;
+ }
+
+ static IEnumerable ImportAscii(string path)
+ {
+ List facets = new List();
+
+ using(StreamReader sr = new StreamReader(path))
+ {
+ string line;
+ int state = EMPTY, vertex = 0;
+ Vector3 normal = Vector3.zero;
+ Vector3 a = Vector3.zero, b = Vector3.zero, c = Vector3.zero;
+ bool exit = false;
+
+ while(sr.Peek() > 0 && !exit)
+ {
+ line = sr.ReadLine().Trim();
+ state = ReadState(line);
+
+ switch(state)
+ {
+ case SOLID:
+ continue;
+
+ case FACET:
+ normal = StringToVec3(line.Replace("facet normal ", ""));
+ break;
+
+ case OUTER:
+ vertex = 0;
+ break;
+
+ case VERTEX:
+ // maintain counter-clockwise orientation of vertices:
+ if (vertex == 0)
+ a = StringToVec3(line.Replace("vertex ", ""));
+ else if(vertex == 2)
+ c = StringToVec3(line.Replace("vertex ", ""));
+ else if (vertex == 1)
+ b = StringToVec3(line.Replace("vertex ", ""));
+ vertex++;
+ break;
+
+ case ENDLOOP:
+ break;
+
+ case ENDFACET:
+ facets.Add(new Facet(normal, a, b, c));
+ break;
+
+ case ENDSOLID:
+ exit = true;
+ break;
+
+ case EMPTY:
+ default:
+ break;
+
+ }
+ }
+ }
+
+ return facets;
+ }
+
+ static Vector3 StringToVec3(string str)
+ {
+ string[] split = str.Trim().Split(null);
+ Vector3 v = new Vector3();
+
+ float.TryParse(split[0], out v.x);
+ float.TryParse(split[1], out v.y);
+ float.TryParse(split[2], out v.z);
+
+ return v;
+ }
+
+ ///
+ /// Determine whether this file is a binary stl format or not.
+ ///
+ ///
+ ///
+ static bool IsBinary(string path)
+ {
+ // http://stackoverflow.com/questions/968935/compare-binary-files-in-c-sharp
+ FileInfo file = new FileInfo(path);
+
+ if(file.Length < 130)
+ return false;
+
+ var isBinary = false;
+
+ using(FileStream f0 = file.OpenRead())
+ {
+ using(BufferedStream bs0 = new BufferedStream(f0))
+ {
+ for(long i = 0; i < 80; i++)
+ {
+ var readByte = bs0.ReadByte();
+ if (readByte == 0x0)
+ {
+ isBinary = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (!isBinary)
+ {
+ using (FileStream f0 = file.OpenRead())
+ {
+ using (BufferedStream bs0 = new BufferedStream(f0))
+ {
+ var byteArray = new byte[6];
+
+ for (var i = 0; i < 6; i++)
+ {
+ byteArray[i] = (byte)bs0.ReadByte();
+ }
+
+ var text = Encoding.UTF8.GetString(byteArray);
+ isBinary = text != "solid ";
+ }
+ }
+ }
+
+ return isBinary;
+ }
+
+ static Mesh[] ImportSmoothNormals(IEnumerable faces, CoordinateSpace modelCoordinateSpace, UpAxis modelUpAxis, IndexFormat indexFormat)
+ {
+ var facets = faces as Facet[] ?? faces.ToArray();
+ int maxVertexCount = indexFormat == IndexFormat.UInt32 ? MaxFacetsPerMesh32 * 3 : MaxFacetsPerMesh16 * 3;
+ int triangleCount = facets.Length * 3;
+
+ Dictionary smoothNormals = new Dictionary(triangleCount / 2);
+
+ // In case meshes are split, we need to calculate smooth normals first
+ foreach(var face in faces)
+ {
+ var x = (StlVector3) face.a;
+ var y = (StlVector3) face.b;
+ var z = (StlVector3) face.c;
+ var normal = face.normal;
+
+ if(smoothNormals.ContainsKey(x))
+ smoothNormals[x] += normal;
+ else
+ smoothNormals.Add(x, normal);
+
+ if(smoothNormals.ContainsKey(y))
+ smoothNormals[y] += normal;
+ else
+ smoothNormals.Add(y, normal);
+
+ if(smoothNormals.ContainsKey(z))
+ smoothNormals[z] += normal;
+ else
+ smoothNormals.Add(z, normal);
+ }
+
+ List meshes = new List();
+
+ List pos = new List(Math.Min(maxVertexCount, triangleCount));
+ List nrm = new List(Math.Min(maxVertexCount, triangleCount));
+ List tri = new List(triangleCount);
+ Dictionary map = new Dictionary();
+ int vertex = 0;
+ Vector3[] points = new Vector3[3];
+
+ foreach(var face in facets)
+ {
+ if(vertex + 3 > maxVertexCount)
+ {
+ var mesh = new Mesh
+ {
+ vertices = pos.ToArray(),
+ normals = nrm.ToArray(),
+ indexFormat = indexFormat
+ };
+ if(modelCoordinateSpace == CoordinateSpace.Right)
+ tri.Reverse();
+ mesh.triangles = tri.ToArray();
+ meshes.Add(mesh);
+
+ vertex = 0;
+
+ pos.Clear();
+ nrm.Clear();
+ tri.Clear();
+ map.Clear();
+ }
+
+ points[0] = face.a;
+ points[1] = face.b;
+ points[2] = face.c;
+
+ for(int i = 0; i < 3; i++)
+ {
+ int index = -1;
+ var hash = (StlVector3) points[i];
+
+ if(!map.TryGetValue(hash, out index))
+ {
+ if(modelCoordinateSpace == CoordinateSpace.Right)
+ {
+ pos.Add(Stl.ToCoordinateSpace(points[i], CoordinateSpace.Left));
+ nrm.Add(Stl.ToCoordinateSpace(smoothNormals[hash].normalized, CoordinateSpace.Left));
+ }
+ else
+ {
+ pos.Add(points[i]);
+ nrm.Add(smoothNormals[hash].normalized);
+ }
+
+ tri.Add(vertex);
+ map.Add(hash, vertex++);
+ }
+ else
+ {
+ tri.Add(index);
+ }
+ }
+ }
+
+ if(vertex > 0)
+ {
+ var mesh = new Mesh
+ {
+ vertices = pos.ToArray(),
+ normals = nrm.ToArray(),
+ indexFormat = indexFormat
+ };
+ if(modelCoordinateSpace == CoordinateSpace.Right)
+ tri.Reverse();
+ mesh.triangles = tri.ToArray();
+ meshes.Add(mesh);
+
+ vertex = 0;
+
+ pos.Clear();
+ nrm.Clear();
+ tri.Clear();
+ map.Clear();
+ }
+
+ return meshes.ToArray();
+ }
+
+ static Mesh[] ImportHardNormals(IEnumerable faces, CoordinateSpace modelCoordinateSpace, UpAxis modelUpAxis, IndexFormat indexFormat)
+ {
+ var facets = faces as Facet[] ?? faces.ToArray();
+ int faceCount = facets.Length, f = 0;
+ int maxFacetsPerMesh = indexFormat == IndexFormat.UInt32 ? MaxFacetsPerMesh32 : MaxFacetsPerMesh16;
+ int maxVertexCount = maxFacetsPerMesh * 3;
+ Mesh[] meshes = new Mesh[faceCount / maxFacetsPerMesh + 1];
+
+ for(int meshIndex = 0; meshIndex < meshes.Length; meshIndex++)
+ {
+ int len = System.Math.Min(maxVertexCount, (faceCount - f) * 3);
+ Vector3[] v = new Vector3[len];
+ Vector3[] n = new Vector3[len];
+ int[] t = new int[len];
+
+ for(int it = 0; it < len; it += 3)
+ {
+ v[it ] = facets[f].a;
+ v[it+1] = facets[f].b;
+ v[it+2] = facets[f].c;
+
+ n[it ] = facets[f].normal;
+ n[it+1] = facets[f].normal;
+ n[it+2] = facets[f].normal;
+
+ t[it ] = it+0;
+ t[it+1] = it+1;
+ t[it+2] = it+2;
+
+ f++;
+ }
+
+ if(modelCoordinateSpace == CoordinateSpace.Right)
+ {
+ for(int i = 0; i < len; i+=3)
+ {
+ v[i+0] = Stl.ToCoordinateSpace(v[i+0], CoordinateSpace.Left);
+ v[i+1] = Stl.ToCoordinateSpace(v[i+1], CoordinateSpace.Left);
+ v[i+2] = Stl.ToCoordinateSpace(v[i+2], CoordinateSpace.Left);
+
+ n[i+0] = Stl.ToCoordinateSpace(n[i+0], CoordinateSpace.Left);
+ n[i+1] = Stl.ToCoordinateSpace(n[i+1], CoordinateSpace.Left);
+ n[i+2] = Stl.ToCoordinateSpace(n[i+2], CoordinateSpace.Left);
+
+ var a = t[i+2];
+ t[i+2] = t[i];
+ t[i] = a;
+ }
+ }
+
+ meshes[meshIndex] = new Mesh
+ {
+ vertices = v,
+ normals = n,
+ triangles = t,
+ indexFormat = indexFormat
+ };
+ }
+
+ return meshes;
+ }
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs.meta
new file mode 100644
index 00000000..2dcbd47d
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4efeb3b2f650e5846b8045c87bc926dd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef
new file mode 100644
index 00000000..5becfb83
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef
@@ -0,0 +1,3 @@
+{
+ "name": "Parabox.Stl"
+}
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef.meta
new file mode 100644
index 00000000..72152bcb
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 9b7ce3d640f39a041a869094036c2d6a
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs
new file mode 100644
index 00000000..392e8fbe
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+using UnityEngine;
+using System.Linq;
+
+namespace Parabox.Stl
+{
+ ///
+ /// Describes the file format of an STL file.
+ ///
+ public enum FileType
+ {
+ Ascii,
+ Binary
+ };
+
+ public enum CoordinateSpace
+ {
+ Left,
+ Right
+ }
+
+ public enum UpAxis
+ {
+ X,
+ Y,
+ Z
+ }
+
+ ///
+ /// Export STL files from Unity mesh assets.
+ ///
+ static class Stl
+ {
+ public static Vector3 ToCoordinateSpace(Vector3 point, CoordinateSpace space)
+ {
+ if(space == CoordinateSpace.Left)
+ return new Vector3(-point.y, point.z, point.x);
+
+ return new Vector3(point.z, -point.x, point.y);
+ }
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs.meta
new file mode 100644
index 00000000..33f0bce7
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: a44dcd146114dcc4788da87039761764
+timeCreated: 1464184910
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs
new file mode 100644
index 00000000..7855afa7
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs
@@ -0,0 +1,78 @@
+using System;
+using UnityEngine;
+
+namespace Parabox.Stl
+{
+ struct StlVector3 : IEquatable
+ {
+ const float k_Resolution = 10000f;
+
+ public float x;
+ public float y;
+ public float z;
+
+ public StlVector3(Vector3 v)
+ {
+ x = v.x;
+ y = v.y;
+ z = v.z;
+ }
+
+ public StlVector3(float x, float y, float z)
+ {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ public static explicit operator Vector3(StlVector3 vec)
+ {
+ return new Vector3(vec.x, vec.y, vec.z);
+ }
+
+ public static explicit operator StlVector3(Vector3 vec)
+ {
+ return new StlVector3(vec);
+ }
+
+ public bool Equals(StlVector3 other)
+ {
+ return Mathf.Approximately(x, other.x)
+ && Mathf.Approximately(y, other.y)
+ && Mathf.Approximately(z, other.z);
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj == null || !(obj is StlVector3))
+ return false;
+
+ return Equals((StlVector3) obj);
+ }
+
+ public override int GetHashCode()
+ {
+ // https://stackoverflow.com/questions/720177/default-implementation-for-object-gethashcode/720282#720282
+ unchecked
+ {
+ int hash = 27;
+
+ hash = (13 * hash) + (x * k_Resolution).GetHashCode();
+ hash = (13 * hash) + (y * k_Resolution).GetHashCode();
+ hash = (13 * hash) + (z * k_Resolution).GetHashCode();
+
+ return hash;
+ }
+ }
+
+ public static bool operator == (StlVector3 a, StlVector3 b)
+ {
+ return a.Equals(b);
+ }
+
+ public static bool operator != (StlVector3 a, StlVector3 b)
+ {
+ return ! a.Equals(b);
+ }
+ }
+}
diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs.meta
new file mode 100644
index 00000000..af53d39b
--- /dev/null
+++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1858776d2fc235c47a2df8e4af996d0a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages.meta b/Assets/Scripts/Tools/ProtobufMessages.meta
new file mode 100644
index 00000000..d083cb4d
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 466f9501a55259cfdaebc32bb070d52a
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs
new file mode 100644
index 00000000..50857c71
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs
@@ -0,0 +1,34 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: altimeter.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Altimeter : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)]
+ public Time Time { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"vertical_position", IsRequired = true)]
+ public double VerticalPosition { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"vertical_velocity", IsRequired = true)]
+ public double VerticalVelocity { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"vertical_reference", IsRequired = true)]
+ public double VerticalReference { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs.meta
new file mode 100644
index 00000000..860b12d5
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fbed1cf2816a07c398e84ab38eeb516a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/any.cs b/Assets/Scripts/Tools/ProtobufMessages/any.cs
new file mode 100644
index 00000000..1534cd55
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/any.cs
@@ -0,0 +1,106 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: any.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Any : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"type", IsRequired = true)]
+ public ValueType Type { get; set; } = ValueType.None;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"double_value")]
+ public double DoubleValue
+ {
+ get { return __pbn__DoubleValue.GetValueOrDefault(); }
+ set { __pbn__DoubleValue = value; }
+ }
+ public bool ShouldSerializeDoubleValue() => __pbn__DoubleValue != null;
+ public void ResetDoubleValue() => __pbn__DoubleValue = null;
+ private double? __pbn__DoubleValue;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"int_value")]
+ public int IntValue
+ {
+ get { return __pbn__IntValue.GetValueOrDefault(); }
+ set { __pbn__IntValue = value; }
+ }
+ public bool ShouldSerializeIntValue() => __pbn__IntValue != null;
+ public void ResetIntValue() => __pbn__IntValue = null;
+ private int? __pbn__IntValue;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"string_value")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string StringValue
+ {
+ get { return __pbn__StringValue ?? ""; }
+ set { __pbn__StringValue = value; }
+ }
+ public bool ShouldSerializeStringValue() => __pbn__StringValue != null;
+ public void ResetStringValue() => __pbn__StringValue = null;
+ private string __pbn__StringValue;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"bool_value")]
+ public bool BoolValue
+ {
+ get { return __pbn__BoolValue.GetValueOrDefault(); }
+ set { __pbn__BoolValue = value; }
+ }
+ public bool ShouldSerializeBoolValue() => __pbn__BoolValue != null;
+ public void ResetBoolValue() => __pbn__BoolValue = null;
+ private bool? __pbn__BoolValue;
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"vector3d_value")]
+ public Vector3d Vector3dValue { get; set; }
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"color_value")]
+ public Color ColorValue { get; set; }
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"pose3d_value")]
+ public Pose Pose3dValue { get; set; }
+
+ [global::ProtoBuf.ProtoMember(9, Name = @"quaternion_value")]
+ public Quaternion QuaternionValue { get; set; }
+
+ [global::ProtoBuf.ProtoMember(10, Name = @"time_value")]
+ public Time TimeValue { get; set; }
+
+ [global::ProtoBuf.ProtoContract()]
+ public enum ValueType
+ {
+ [global::ProtoBuf.ProtoEnum(Name = @"NONE")]
+ None = 1,
+ [global::ProtoBuf.ProtoEnum(Name = @"DOUBLE")]
+ Double = 2,
+ [global::ProtoBuf.ProtoEnum(Name = @"INT32")]
+ Int32 = 3,
+ [global::ProtoBuf.ProtoEnum(Name = @"STRING")]
+ String = 4,
+ [global::ProtoBuf.ProtoEnum(Name = @"BOOLEAN")]
+ Boolean = 5,
+ [global::ProtoBuf.ProtoEnum(Name = @"VECTOR3D")]
+ Vector3d = 6,
+ [global::ProtoBuf.ProtoEnum(Name = @"COLOR")]
+ Color = 7,
+ [global::ProtoBuf.ProtoEnum(Name = @"POSE3D")]
+ Pose3d = 8,
+ [global::ProtoBuf.ProtoEnum(Name = @"QUATERNIOND")]
+ Quaterniond = 9,
+ [global::ProtoBuf.ProtoEnum(Name = @"TIME")]
+ Time = 10,
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/any.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/any.cs.meta
new file mode 100644
index 00000000..12a82c16
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/any.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3b8b0078d2e89fe3dbf96312d878fda2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs
new file mode 100644
index 00000000..0f5aa78c
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs
@@ -0,0 +1,80 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: atmosphere.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Atmosphere : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1)]
+ [global::System.ComponentModel.DefaultValue(Type.Adiabatic)]
+ public Type type
+ {
+ get { return __pbn__type ?? Type.Adiabatic; }
+ set { __pbn__type = value; }
+ }
+ public bool ShouldSerializetype() => __pbn__type != null;
+ public void Resettype() => __pbn__type = null;
+ private Type? __pbn__type;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"temperature")]
+ public double Temperature
+ {
+ get { return __pbn__Temperature.GetValueOrDefault(); }
+ set { __pbn__Temperature = value; }
+ }
+ public bool ShouldSerializeTemperature() => __pbn__Temperature != null;
+ public void ResetTemperature() => __pbn__Temperature = null;
+ private double? __pbn__Temperature;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"pressure")]
+ public double Pressure
+ {
+ get { return __pbn__Pressure.GetValueOrDefault(); }
+ set { __pbn__Pressure = value; }
+ }
+ public bool ShouldSerializePressure() => __pbn__Pressure != null;
+ public void ResetPressure() => __pbn__Pressure = null;
+ private double? __pbn__Pressure;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"mass_density")]
+ public double MassDensity
+ {
+ get { return __pbn__MassDensity.GetValueOrDefault(); }
+ set { __pbn__MassDensity = value; }
+ }
+ public bool ShouldSerializeMassDensity() => __pbn__MassDensity != null;
+ public void ResetMassDensity() => __pbn__MassDensity = null;
+ private double? __pbn__MassDensity;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"enable_atmosphere")]
+ public bool EnableAtmosphere
+ {
+ get { return __pbn__EnableAtmosphere.GetValueOrDefault(); }
+ set { __pbn__EnableAtmosphere = value; }
+ }
+ public bool ShouldSerializeEnableAtmosphere() => __pbn__EnableAtmosphere != null;
+ public void ResetEnableAtmosphere() => __pbn__EnableAtmosphere = null;
+ private bool? __pbn__EnableAtmosphere;
+
+ [global::ProtoBuf.ProtoContract()]
+ public enum Type
+ {
+ [global::ProtoBuf.ProtoEnum(Name = @"ADIABATIC")]
+ Adiabatic = 1,
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs.meta
new file mode 100644
index 00000000..289ba5d6
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5476898ad9c12ea5b8bacbfce9eb9891
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/axis.cs b/Assets/Scripts/Tools/ProtobufMessages/axis.cs
new file mode 100644
index 00000000..f5e1df35
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/axis.cs
@@ -0,0 +1,46 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: axis.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Axis : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"xyz", IsRequired = true)]
+ public Vector3d Xyz { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"limit_lower", IsRequired = true)]
+ public double LimitLower { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"limit_upper", IsRequired = true)]
+ public double LimitUpper { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"limit_effort", IsRequired = true)]
+ public double LimitEffort { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"limit_velocity", IsRequired = true)]
+ public double LimitVelocity { get; set; }
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"damping", IsRequired = true)]
+ public double Damping { get; set; }
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"friction", IsRequired = true)]
+ public double Friction { get; set; }
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"use_parent_model_frame", IsRequired = true)]
+ public bool UseParentModelFrame { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/axis.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/axis.cs.meta
new file mode 100644
index 00000000..ac4214b0
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/axis.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5a05042748cac083dbcb2c215fd8be64
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/battery.cs b/Assets/Scripts/Tools/ProtobufMessages/battery.cs
new file mode 100644
index 00000000..5af66685
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/battery.cs
@@ -0,0 +1,28 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: battery.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Battery : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)]
+ public string Name { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"voltage", IsRequired = true)]
+ public double Voltage { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/battery.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/battery.cs.meta
new file mode 100644
index 00000000..0b1bf40a
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/battery.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5f83e56363adb6b62b2ad4c6b2e03d67
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs
new file mode 100644
index 00000000..50353728
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs
@@ -0,0 +1,25 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: boxgeom.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class BoxGeom : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"size", IsRequired = true)]
+ public Vector3d Size { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs.meta
new file mode 100644
index 00000000..2f4b819e
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4990d81b9ffc20489b3bd558fe7511b6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs
new file mode 100644
index 00000000..fdc7fa37
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs
@@ -0,0 +1,33 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: camera_cmd.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class CameraCmd : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"follow_model")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string FollowModel
+ {
+ get { return __pbn__FollowModel ?? ""; }
+ set { __pbn__FollowModel = value; }
+ }
+ public bool ShouldSerializeFollowModel() => __pbn__FollowModel != null;
+ public void ResetFollowModel() => __pbn__FollowModel = null;
+ private string __pbn__FollowModel;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs.meta
new file mode 100644
index 00000000..e6797762
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0b23902bf0e56e02195ea48489d6509a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs
new file mode 100644
index 00000000..facadc03
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs
@@ -0,0 +1,116 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: camera_lens.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class CameraLens : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"type", IsRequired = true)]
+ public string Type { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"c1")]
+ public double C1
+ {
+ get { return __pbn__C1.GetValueOrDefault(); }
+ set { __pbn__C1 = value; }
+ }
+ public bool ShouldSerializeC1() => __pbn__C1 != null;
+ public void ResetC1() => __pbn__C1 = null;
+ private double? __pbn__C1;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"c2")]
+ public double C2
+ {
+ get { return __pbn__C2.GetValueOrDefault(); }
+ set { __pbn__C2 = value; }
+ }
+ public bool ShouldSerializeC2() => __pbn__C2 != null;
+ public void ResetC2() => __pbn__C2 = null;
+ private double? __pbn__C2;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"c3")]
+ public double C3
+ {
+ get { return __pbn__C3.GetValueOrDefault(); }
+ set { __pbn__C3 = value; }
+ }
+ public bool ShouldSerializeC3() => __pbn__C3 != null;
+ public void ResetC3() => __pbn__C3 = null;
+ private double? __pbn__C3;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"f")]
+ public double F
+ {
+ get { return __pbn__F.GetValueOrDefault(); }
+ set { __pbn__F = value; }
+ }
+ public bool ShouldSerializeF() => __pbn__F != null;
+ public void ResetF() => __pbn__F = null;
+ private double? __pbn__F;
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"fun")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string Fun
+ {
+ get { return __pbn__Fun ?? ""; }
+ set { __pbn__Fun = value; }
+ }
+ public bool ShouldSerializeFun() => __pbn__Fun != null;
+ public void ResetFun() => __pbn__Fun = null;
+ private string __pbn__Fun;
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"scale_to_hfov")]
+ public bool ScaleToHfov
+ {
+ get { return __pbn__ScaleToHfov.GetValueOrDefault(); }
+ set { __pbn__ScaleToHfov = value; }
+ }
+ public bool ShouldSerializeScaleToHfov() => __pbn__ScaleToHfov != null;
+ public void ResetScaleToHfov() => __pbn__ScaleToHfov = null;
+ private bool? __pbn__ScaleToHfov;
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"cutoff_angle")]
+ public double CutoffAngle
+ {
+ get { return __pbn__CutoffAngle.GetValueOrDefault(); }
+ set { __pbn__CutoffAngle = value; }
+ }
+ public bool ShouldSerializeCutoffAngle() => __pbn__CutoffAngle != null;
+ public void ResetCutoffAngle() => __pbn__CutoffAngle = null;
+ private double? __pbn__CutoffAngle;
+
+ [global::ProtoBuf.ProtoMember(9, Name = @"hfov")]
+ public double Hfov
+ {
+ get { return __pbn__Hfov.GetValueOrDefault(); }
+ set { __pbn__Hfov = value; }
+ }
+ public bool ShouldSerializeHfov() => __pbn__Hfov != null;
+ public void ResetHfov() => __pbn__Hfov = null;
+ private double? __pbn__Hfov;
+
+ [global::ProtoBuf.ProtoMember(10, Name = @"env_texture_size")]
+ public int EnvTextureSize
+ {
+ get { return __pbn__EnvTextureSize.GetValueOrDefault(); }
+ set { __pbn__EnvTextureSize = value; }
+ }
+ public bool ShouldSerializeEnvTextureSize() => __pbn__EnvTextureSize != null;
+ public void ResetEnvTextureSize() => __pbn__EnvTextureSize = null;
+ private int? __pbn__EnvTextureSize;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs.meta
new file mode 100644
index 00000000..c3b618c8
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ab652625fdc66604fa9691f5936a2fdd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs
new file mode 100644
index 00000000..796fea9a
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs
@@ -0,0 +1,90 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: camerasensor.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class CameraSensor : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"horizontal_fov")]
+ public double HorizontalFov
+ {
+ get { return __pbn__HorizontalFov.GetValueOrDefault(); }
+ set { __pbn__HorizontalFov = value; }
+ }
+ public bool ShouldSerializeHorizontalFov() => __pbn__HorizontalFov != null;
+ public void ResetHorizontalFov() => __pbn__HorizontalFov = null;
+ private double? __pbn__HorizontalFov;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"image_size")]
+ public Vector2d ImageSize { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"image_format")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string ImageFormat
+ {
+ get { return __pbn__ImageFormat ?? ""; }
+ set { __pbn__ImageFormat = value; }
+ }
+ public bool ShouldSerializeImageFormat() => __pbn__ImageFormat != null;
+ public void ResetImageFormat() => __pbn__ImageFormat = null;
+ private string __pbn__ImageFormat;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"near_clip")]
+ public double NearClip
+ {
+ get { return __pbn__NearClip.GetValueOrDefault(); }
+ set { __pbn__NearClip = value; }
+ }
+ public bool ShouldSerializeNearClip() => __pbn__NearClip != null;
+ public void ResetNearClip() => __pbn__NearClip = null;
+ private double? __pbn__NearClip;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"far_clip")]
+ public double FarClip
+ {
+ get { return __pbn__FarClip.GetValueOrDefault(); }
+ set { __pbn__FarClip = value; }
+ }
+ public bool ShouldSerializeFarClip() => __pbn__FarClip != null;
+ public void ResetFarClip() => __pbn__FarClip = null;
+ private double? __pbn__FarClip;
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"save_enabled")]
+ public bool SaveEnabled
+ {
+ get { return __pbn__SaveEnabled.GetValueOrDefault(); }
+ set { __pbn__SaveEnabled = value; }
+ }
+ public bool ShouldSerializeSaveEnabled() => __pbn__SaveEnabled != null;
+ public void ResetSaveEnabled() => __pbn__SaveEnabled = null;
+ private bool? __pbn__SaveEnabled;
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"save_path")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string SavePath
+ {
+ get { return __pbn__SavePath ?? ""; }
+ set { __pbn__SavePath = value; }
+ }
+ public bool ShouldSerializeSavePath() => __pbn__SavePath != null;
+ public void ResetSavePath() => __pbn__SavePath = null;
+ private string __pbn__SavePath;
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"distortion")]
+ public Distortion Distortion { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs.meta
new file mode 100644
index 00000000..9c2de6db
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bbce56d9c5b661ee0a134da7d639f523
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/cessna.cs b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs
new file mode 100644
index 00000000..8a8065c3
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs
@@ -0,0 +1,162 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: cessna.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Cessna : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"propeller_speed")]
+ public float PropellerSpeed
+ {
+ get { return __pbn__PropellerSpeed.GetValueOrDefault(); }
+ set { __pbn__PropellerSpeed = value; }
+ }
+ public bool ShouldSerializePropellerSpeed() => __pbn__PropellerSpeed != null;
+ public void ResetPropellerSpeed() => __pbn__PropellerSpeed = null;
+ private float? __pbn__PropellerSpeed;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"left_aileron")]
+ public float LeftAileron
+ {
+ get { return __pbn__LeftAileron.GetValueOrDefault(); }
+ set { __pbn__LeftAileron = value; }
+ }
+ public bool ShouldSerializeLeftAileron() => __pbn__LeftAileron != null;
+ public void ResetLeftAileron() => __pbn__LeftAileron = null;
+ private float? __pbn__LeftAileron;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"left_flap")]
+ public float LeftFlap
+ {
+ get { return __pbn__LeftFlap.GetValueOrDefault(); }
+ set { __pbn__LeftFlap = value; }
+ }
+ public bool ShouldSerializeLeftFlap() => __pbn__LeftFlap != null;
+ public void ResetLeftFlap() => __pbn__LeftFlap = null;
+ private float? __pbn__LeftFlap;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"right_aileron")]
+ public float RightAileron
+ {
+ get { return __pbn__RightAileron.GetValueOrDefault(); }
+ set { __pbn__RightAileron = value; }
+ }
+ public bool ShouldSerializeRightAileron() => __pbn__RightAileron != null;
+ public void ResetRightAileron() => __pbn__RightAileron = null;
+ private float? __pbn__RightAileron;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"right_flap")]
+ public float RightFlap
+ {
+ get { return __pbn__RightFlap.GetValueOrDefault(); }
+ set { __pbn__RightFlap = value; }
+ }
+ public bool ShouldSerializeRightFlap() => __pbn__RightFlap != null;
+ public void ResetRightFlap() => __pbn__RightFlap = null;
+ private float? __pbn__RightFlap;
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"elevators")]
+ public float Elevators
+ {
+ get { return __pbn__Elevators.GetValueOrDefault(); }
+ set { __pbn__Elevators = value; }
+ }
+ public bool ShouldSerializeElevators() => __pbn__Elevators != null;
+ public void ResetElevators() => __pbn__Elevators = null;
+ private float? __pbn__Elevators;
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"rudder")]
+ public float Rudder
+ {
+ get { return __pbn__Rudder.GetValueOrDefault(); }
+ set { __pbn__Rudder = value; }
+ }
+ public bool ShouldSerializeRudder() => __pbn__Rudder != null;
+ public void ResetRudder() => __pbn__Rudder = null;
+ private float? __pbn__Rudder;
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"cmd_propeller_speed")]
+ public float CmdPropellerSpeed
+ {
+ get { return __pbn__CmdPropellerSpeed.GetValueOrDefault(); }
+ set { __pbn__CmdPropellerSpeed = value; }
+ }
+ public bool ShouldSerializeCmdPropellerSpeed() => __pbn__CmdPropellerSpeed != null;
+ public void ResetCmdPropellerSpeed() => __pbn__CmdPropellerSpeed = null;
+ private float? __pbn__CmdPropellerSpeed;
+
+ [global::ProtoBuf.ProtoMember(9, Name = @"cmd_left_aileron")]
+ public float CmdLeftAileron
+ {
+ get { return __pbn__CmdLeftAileron.GetValueOrDefault(); }
+ set { __pbn__CmdLeftAileron = value; }
+ }
+ public bool ShouldSerializeCmdLeftAileron() => __pbn__CmdLeftAileron != null;
+ public void ResetCmdLeftAileron() => __pbn__CmdLeftAileron = null;
+ private float? __pbn__CmdLeftAileron;
+
+ [global::ProtoBuf.ProtoMember(10, Name = @"cmd_left_flap")]
+ public float CmdLeftFlap
+ {
+ get { return __pbn__CmdLeftFlap.GetValueOrDefault(); }
+ set { __pbn__CmdLeftFlap = value; }
+ }
+ public bool ShouldSerializeCmdLeftFlap() => __pbn__CmdLeftFlap != null;
+ public void ResetCmdLeftFlap() => __pbn__CmdLeftFlap = null;
+ private float? __pbn__CmdLeftFlap;
+
+ [global::ProtoBuf.ProtoMember(11, Name = @"cmd_right_aileron")]
+ public float CmdRightAileron
+ {
+ get { return __pbn__CmdRightAileron.GetValueOrDefault(); }
+ set { __pbn__CmdRightAileron = value; }
+ }
+ public bool ShouldSerializeCmdRightAileron() => __pbn__CmdRightAileron != null;
+ public void ResetCmdRightAileron() => __pbn__CmdRightAileron = null;
+ private float? __pbn__CmdRightAileron;
+
+ [global::ProtoBuf.ProtoMember(12, Name = @"cmd_right_flap")]
+ public float CmdRightFlap
+ {
+ get { return __pbn__CmdRightFlap.GetValueOrDefault(); }
+ set { __pbn__CmdRightFlap = value; }
+ }
+ public bool ShouldSerializeCmdRightFlap() => __pbn__CmdRightFlap != null;
+ public void ResetCmdRightFlap() => __pbn__CmdRightFlap = null;
+ private float? __pbn__CmdRightFlap;
+
+ [global::ProtoBuf.ProtoMember(13, Name = @"cmd_elevators")]
+ public float CmdElevators
+ {
+ get { return __pbn__CmdElevators.GetValueOrDefault(); }
+ set { __pbn__CmdElevators = value; }
+ }
+ public bool ShouldSerializeCmdElevators() => __pbn__CmdElevators != null;
+ public void ResetCmdElevators() => __pbn__CmdElevators = null;
+ private float? __pbn__CmdElevators;
+
+ [global::ProtoBuf.ProtoMember(14, Name = @"cmd_rudder")]
+ public float CmdRudder
+ {
+ get { return __pbn__CmdRudder.GetValueOrDefault(); }
+ set { __pbn__CmdRudder = value; }
+ }
+ public bool ShouldSerializeCmdRudder() => __pbn__CmdRudder != null;
+ public void ResetCmdRudder() => __pbn__CmdRudder = null;
+ private float? __pbn__CmdRudder;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/cessna.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs.meta
new file mode 100644
index 00000000..bc07b8f7
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9a1ade083667cfddd83087604dc3278c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/collision.cs b/Assets/Scripts/Tools/ProtobufMessages/collision.cs
new file mode 100644
index 00000000..03621b12
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/collision.cs
@@ -0,0 +1,60 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: collision.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Collision : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"id", IsRequired = true)]
+ public uint Id { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"name", IsRequired = true)]
+ public string Name { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"laser_retro")]
+ public double LaserRetro
+ {
+ get { return __pbn__LaserRetro.GetValueOrDefault(); }
+ set { __pbn__LaserRetro = value; }
+ }
+ public bool ShouldSerializeLaserRetro() => __pbn__LaserRetro != null;
+ public void ResetLaserRetro() => __pbn__LaserRetro = null;
+ private double? __pbn__LaserRetro;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"max_contacts")]
+ public double MaxContacts
+ {
+ get { return __pbn__MaxContacts.GetValueOrDefault(); }
+ set { __pbn__MaxContacts = value; }
+ }
+ public bool ShouldSerializeMaxContacts() => __pbn__MaxContacts != null;
+ public void ResetMaxContacts() => __pbn__MaxContacts = null;
+ private double? __pbn__MaxContacts;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"pose")]
+ public Pose Pose { get; set; }
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"geometry")]
+ public Geometry Geometry { get; set; }
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"surface")]
+ public Surface Surface { get; set; }
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"visual")]
+ public global::System.Collections.Generic.List Visuals { get; } = new global::System.Collections.Generic.List();
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/collision.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/collision.cs.meta
new file mode 100644
index 00000000..190eaf8b
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/collision.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a9c2f7528390e0b1fb50cadd24611648
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/color.cs b/Assets/Scripts/Tools/ProtobufMessages/color.cs
new file mode 100644
index 00000000..0d776894
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/color.cs
@@ -0,0 +1,42 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: color.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Color : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"r", IsRequired = true)]
+ public float R { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"g", IsRequired = true)]
+ public float G { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"b", IsRequired = true)]
+ public float B { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"a")]
+ [global::System.ComponentModel.DefaultValue(1)]
+ public float A
+ {
+ get { return __pbn__A ?? 1; }
+ set { __pbn__A = value; }
+ }
+ public bool ShouldSerializeA() => __pbn__A != null;
+ public void ResetA() => __pbn__A = null;
+ private float? __pbn__A;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/color.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/color.cs.meta
new file mode 100644
index 00000000..1fb6ac92
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/color.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8a1e6a85d446a833ebe16be8cead9e20
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/contact.cs b/Assets/Scripts/Tools/ProtobufMessages/contact.cs
new file mode 100644
index 00000000..f96f597c
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/contact.cs
@@ -0,0 +1,46 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: contact.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Contact : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"collision1", IsRequired = true)]
+ public string Collision1 { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"collision2", IsRequired = true)]
+ public string Collision2 { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"position")]
+ public global::System.Collections.Generic.List Positions { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"normal")]
+ public global::System.Collections.Generic.List Normals { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"depth")]
+ public double[] Depths { get; set; }
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"wrench")]
+ public global::System.Collections.Generic.List Wrenchs { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"time", IsRequired = true)]
+ public Time Time { get; set; }
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"world", IsRequired = true)]
+ public string World { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/contact.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/contact.cs.meta
new file mode 100644
index 00000000..8a991209
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/contact.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8b0dd2d6c5975ed00b3de9335515cef7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/contacts.cs b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs
new file mode 100644
index 00000000..f28f1b22
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs
@@ -0,0 +1,28 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: contacts.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Contacts : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1)]
+ public global::System.Collections.Generic.List contact { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"time", IsRequired = true)]
+ public Time Time { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/contacts.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs.meta
new file mode 100644
index 00000000..a93aa0f6
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 006e74c7d4f5e4a57a20e8f9a7e85f28
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs
new file mode 100644
index 00000000..61189d17
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs
@@ -0,0 +1,33 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: contactsensor.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class ContactSensor : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"collision_name")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string CollisionName
+ {
+ get { return __pbn__CollisionName ?? ""; }
+ set { __pbn__CollisionName = value; }
+ }
+ public bool ShouldSerializeCollisionName() => __pbn__CollisionName != null;
+ public void ResetCollisionName() => __pbn__CollisionName = null;
+ private string __pbn__CollisionName;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs.meta
new file mode 100644
index 00000000..73db51e3
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2cf01c1c0849d59e6bc2d260754f5882
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs
new file mode 100644
index 00000000..8571aeda
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs
@@ -0,0 +1,28 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: cylindergeom.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class CylinderGeom : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"radius", IsRequired = true)]
+ public double Radius { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"length", IsRequired = true)]
+ public double Length { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs.meta
new file mode 100644
index 00000000..4794fbf4
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a9153f1e0b02f04eb98e82b8562980c8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/density.cs b/Assets/Scripts/Tools/ProtobufMessages/density.cs
new file mode 100644
index 00000000..52d49e6e
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/density.cs
@@ -0,0 +1,25 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: density.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Density : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true)]
+ public double density { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/density.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/density.cs.meta
new file mode 100644
index 00000000..2bc97833
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/density.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ffd7c07fe09cb9a66bc9f36ae69ac6e6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs
new file mode 100644
index 00000000..6f7d6c58
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs
@@ -0,0 +1,52 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: diagnostics.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Diagnostics : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"time")]
+ public global::System.Collections.Generic.List Times { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"real_time", IsRequired = true)]
+ public Time RealTime { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"sim_time", IsRequired = true)]
+ public Time SimTime { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"real_time_factor", IsRequired = true)]
+ public double RealTimeFactor { get; set; }
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class DiagTime : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)]
+ public string Name { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"elapsed", IsRequired = true)]
+ public Time Elapsed { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"wall", IsRequired = true)]
+ public Time Wall { get; set; }
+
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs.meta
new file mode 100644
index 00000000..5581b06d
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9d2cb1afd27bc7e48be4af41092b6df1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/distortion.cs b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs
new file mode 100644
index 00000000..0eb93dbb
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs
@@ -0,0 +1,75 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: distortion.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Distortion : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"center")]
+ public Vector2d Center { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"k1")]
+ public double K1
+ {
+ get { return __pbn__K1.GetValueOrDefault(); }
+ set { __pbn__K1 = value; }
+ }
+ public bool ShouldSerializeK1() => __pbn__K1 != null;
+ public void ResetK1() => __pbn__K1 = null;
+ private double? __pbn__K1;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"k2")]
+ public double K2
+ {
+ get { return __pbn__K2.GetValueOrDefault(); }
+ set { __pbn__K2 = value; }
+ }
+ public bool ShouldSerializeK2() => __pbn__K2 != null;
+ public void ResetK2() => __pbn__K2 = null;
+ private double? __pbn__K2;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"k3")]
+ public double K3
+ {
+ get { return __pbn__K3.GetValueOrDefault(); }
+ set { __pbn__K3 = value; }
+ }
+ public bool ShouldSerializeK3() => __pbn__K3 != null;
+ public void ResetK3() => __pbn__K3 = null;
+ private double? __pbn__K3;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"p1")]
+ public double P1
+ {
+ get { return __pbn__P1.GetValueOrDefault(); }
+ set { __pbn__P1 = value; }
+ }
+ public bool ShouldSerializeP1() => __pbn__P1 != null;
+ public void ResetP1() => __pbn__P1 = null;
+ private double? __pbn__P1;
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"p2")]
+ public double P2
+ {
+ get { return __pbn__P2.GetValueOrDefault(); }
+ set { __pbn__P2 = value; }
+ }
+ public bool ShouldSerializeP2() => __pbn__P2 != null;
+ public void ResetP2() => __pbn__P2 = null;
+ private double? __pbn__P2;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/distortion.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs.meta
new file mode 100644
index 00000000..01b14123
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9b6bffb343ba1909098b8d65962c03cf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/empty.cs b/Assets/Scripts/Tools/ProtobufMessages/empty.cs
new file mode 100644
index 00000000..0474ffd5
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/empty.cs
@@ -0,0 +1,32 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: empty.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Empty : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"unused")]
+ public bool Unused
+ {
+ get { return __pbn__Unused.GetValueOrDefault(); }
+ set { __pbn__Unused = value; }
+ }
+ public bool ShouldSerializeUnused() => __pbn__Unused != null;
+ public void ResetUnused() => __pbn__Unused = null;
+ private bool? __pbn__Unused;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/empty.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/empty.cs.meta
new file mode 100644
index 00000000..ef5a7b1d
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/empty.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 829ecba304d2967258902e4baf6bbbec
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/factory.cs b/Assets/Scripts/Tools/ProtobufMessages/factory.cs
new file mode 100644
index 00000000..2c16c1b8
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/factory.cs
@@ -0,0 +1,80 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: factory.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Factory : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"sdf")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string Sdf
+ {
+ get { return __pbn__Sdf ?? ""; }
+ set { __pbn__Sdf = value; }
+ }
+ public bool ShouldSerializeSdf() => __pbn__Sdf != null;
+ public void ResetSdf() => __pbn__Sdf = null;
+ private string __pbn__Sdf;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"sdf_filename")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string SdfFilename
+ {
+ get { return __pbn__SdfFilename ?? ""; }
+ set { __pbn__SdfFilename = value; }
+ }
+ public bool ShouldSerializeSdfFilename() => __pbn__SdfFilename != null;
+ public void ResetSdfFilename() => __pbn__SdfFilename = null;
+ private string __pbn__SdfFilename;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"pose")]
+ public Pose Pose { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"edit_name")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string EditName
+ {
+ get { return __pbn__EditName ?? ""; }
+ set { __pbn__EditName = value; }
+ }
+ public bool ShouldSerializeEditName() => __pbn__EditName != null;
+ public void ResetEditName() => __pbn__EditName = null;
+ private string __pbn__EditName;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"clone_model_name")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string CloneModelName
+ {
+ get { return __pbn__CloneModelName ?? ""; }
+ set { __pbn__CloneModelName = value; }
+ }
+ public bool ShouldSerializeCloneModelName() => __pbn__CloneModelName != null;
+ public void ResetCloneModelName() => __pbn__CloneModelName = null;
+ private string __pbn__CloneModelName;
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"allow_renaming")]
+ [global::System.ComponentModel.DefaultValue(true)]
+ public bool AllowRenaming
+ {
+ get { return __pbn__AllowRenaming ?? true; }
+ set { __pbn__AllowRenaming = value; }
+ }
+ public bool ShouldSerializeAllowRenaming() => __pbn__AllowRenaming != null;
+ public void ResetAllowRenaming() => __pbn__AllowRenaming = null;
+ private bool? __pbn__AllowRenaming;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/factory.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/factory.cs.meta
new file mode 100644
index 00000000..abf86222
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/factory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ca3f39313bfdefd78af54f9da0e2beac
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/fluid.cs b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs
new file mode 100644
index 00000000..48c64410
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs
@@ -0,0 +1,28 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: fluid.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Fluid : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)]
+ public string Name { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"position")]
+ public global::System.Collections.Generic.List Positions { get; } = new global::System.Collections.Generic.List();
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/fluid.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs.meta
new file mode 100644
index 00000000..8ec2c68d
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 86aa9664156e1edca99e396bcfa1b952
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/fog.cs b/Assets/Scripts/Tools/ProtobufMessages/fog.cs
new file mode 100644
index 00000000..0ef92021
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/fog.cs
@@ -0,0 +1,79 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: fog.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Fog : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"type")]
+ [global::System.ComponentModel.DefaultValue(FogType.None)]
+ public FogType Type
+ {
+ get { return __pbn__Type ?? FogType.None; }
+ set { __pbn__Type = value; }
+ }
+ public bool ShouldSerializeType() => __pbn__Type != null;
+ public void ResetType() => __pbn__Type = null;
+ private FogType? __pbn__Type;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"color")]
+ public Color Color { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"density")]
+ public float Density
+ {
+ get { return __pbn__Density.GetValueOrDefault(); }
+ set { __pbn__Density = value; }
+ }
+ public bool ShouldSerializeDensity() => __pbn__Density != null;
+ public void ResetDensity() => __pbn__Density = null;
+ private float? __pbn__Density;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"start")]
+ public float Start
+ {
+ get { return __pbn__Start.GetValueOrDefault(); }
+ set { __pbn__Start = value; }
+ }
+ public bool ShouldSerializeStart() => __pbn__Start != null;
+ public void ResetStart() => __pbn__Start = null;
+ private float? __pbn__Start;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"end")]
+ public float End
+ {
+ get { return __pbn__End.GetValueOrDefault(); }
+ set { __pbn__End = value; }
+ }
+ public bool ShouldSerializeEnd() => __pbn__End != null;
+ public void ResetEnd() => __pbn__End = null;
+ private float? __pbn__End;
+
+ [global::ProtoBuf.ProtoContract()]
+ public enum FogType
+ {
+ [global::ProtoBuf.ProtoEnum(Name = @"NONE")]
+ None = 1,
+ [global::ProtoBuf.ProtoEnum(Name = @"LINEAR")]
+ Linear = 2,
+ [global::ProtoBuf.ProtoEnum(Name = @"EXPONENTIAL")]
+ Exponential = 3,
+ [global::ProtoBuf.ProtoEnum(Name = @"EXPONENTIAL2")]
+ Exponential2 = 4,
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/fog.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/fog.cs.meta
new file mode 100644
index 00000000..39536773
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/fog.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dcecaae27267bbce39b8b45cc752af83
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/friction.cs b/Assets/Scripts/Tools/ProtobufMessages/friction.cs
new file mode 100644
index 00000000..63ec3639
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/friction.cs
@@ -0,0 +1,139 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: friction.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Friction : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"mu")]
+ public double Mu
+ {
+ get { return __pbn__Mu.GetValueOrDefault(); }
+ set { __pbn__Mu = value; }
+ }
+ public bool ShouldSerializeMu() => __pbn__Mu != null;
+ public void ResetMu() => __pbn__Mu = null;
+ private double? __pbn__Mu;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"mu2")]
+ public double Mu2
+ {
+ get { return __pbn__Mu2.GetValueOrDefault(); }
+ set { __pbn__Mu2 = value; }
+ }
+ public bool ShouldSerializeMu2() => __pbn__Mu2 != null;
+ public void ResetMu2() => __pbn__Mu2 = null;
+ private double? __pbn__Mu2;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"fdir1")]
+ public Vector3d Fdir1 { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"slip1")]
+ public double Slip1
+ {
+ get { return __pbn__Slip1.GetValueOrDefault(); }
+ set { __pbn__Slip1 = value; }
+ }
+ public bool ShouldSerializeSlip1() => __pbn__Slip1 != null;
+ public void ResetSlip1() => __pbn__Slip1 = null;
+ private double? __pbn__Slip1;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"slip2")]
+ public double Slip2
+ {
+ get { return __pbn__Slip2.GetValueOrDefault(); }
+ set { __pbn__Slip2 = value; }
+ }
+ public bool ShouldSerializeSlip2() => __pbn__Slip2 != null;
+ public void ResetSlip2() => __pbn__Slip2 = null;
+ private double? __pbn__Slip2;
+
+ [global::ProtoBuf.ProtoMember(6)]
+ public Torsional torsional { get; set; }
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Torsional : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"coefficient")]
+ public double Coefficient
+ {
+ get { return __pbn__Coefficient.GetValueOrDefault(); }
+ set { __pbn__Coefficient = value; }
+ }
+ public bool ShouldSerializeCoefficient() => __pbn__Coefficient != null;
+ public void ResetCoefficient() => __pbn__Coefficient = null;
+ private double? __pbn__Coefficient;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"use_patch_radius")]
+ public bool UsePatchRadius
+ {
+ get { return __pbn__UsePatchRadius.GetValueOrDefault(); }
+ set { __pbn__UsePatchRadius = value; }
+ }
+ public bool ShouldSerializeUsePatchRadius() => __pbn__UsePatchRadius != null;
+ public void ResetUsePatchRadius() => __pbn__UsePatchRadius = null;
+ private bool? __pbn__UsePatchRadius;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"patch_radius")]
+ public double PatchRadius
+ {
+ get { return __pbn__PatchRadius.GetValueOrDefault(); }
+ set { __pbn__PatchRadius = value; }
+ }
+ public bool ShouldSerializePatchRadius() => __pbn__PatchRadius != null;
+ public void ResetPatchRadius() => __pbn__PatchRadius = null;
+ private double? __pbn__PatchRadius;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"surface_radius")]
+ public double SurfaceRadius
+ {
+ get { return __pbn__SurfaceRadius.GetValueOrDefault(); }
+ set { __pbn__SurfaceRadius = value; }
+ }
+ public bool ShouldSerializeSurfaceRadius() => __pbn__SurfaceRadius != null;
+ public void ResetSurfaceRadius() => __pbn__SurfaceRadius = null;
+ private double? __pbn__SurfaceRadius;
+
+ [global::ProtoBuf.ProtoMember(5)]
+ public Ode ode { get; set; }
+
+ [global::ProtoBuf.ProtoContract(Name = @"ODE")]
+ public partial class Ode : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"slip")]
+ public double Slip
+ {
+ get { return __pbn__Slip.GetValueOrDefault(); }
+ set { __pbn__Slip = value; }
+ }
+ public bool ShouldSerializeSlip() => __pbn__Slip != null;
+ public void ResetSlip() => __pbn__Slip = null;
+ private double? __pbn__Slip;
+
+ }
+
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/friction.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/friction.cs.meta
new file mode 100644
index 00000000..7a4be6ae
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/friction.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8085e504a641367768c1feee22517d70
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/geometry.cs b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs
new file mode 100644
index 00000000..eb14747c
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs
@@ -0,0 +1,87 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: geometry.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Geometry : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1)]
+ [global::System.ComponentModel.DefaultValue(Type.Box)]
+ public Type type
+ {
+ get { return __pbn__type ?? Type.Box; }
+ set { __pbn__type = value; }
+ }
+ public bool ShouldSerializetype() => __pbn__type != null;
+ public void Resettype() => __pbn__type = null;
+ private Type? __pbn__type;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"box")]
+ public BoxGeom Box { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"cylinder")]
+ public CylinderGeom Cylinder { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"plane")]
+ public PlaneGeom Plane { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"sphere")]
+ public SphereGeom Sphere { get; set; }
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"image")]
+ public ImageGeom Image { get; set; }
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"heightmap")]
+ public HeightmapGeom Heightmap { get; set; }
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"mesh")]
+ public MeshGeom Mesh { get; set; }
+
+ [global::ProtoBuf.ProtoMember(9, Name = @"points")]
+ public global::System.Collections.Generic.List Points { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(10, Name = @"polyline")]
+ public global::System.Collections.Generic.List Polylines { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoContract()]
+ public enum Type
+ {
+ [global::ProtoBuf.ProtoEnum(Name = @"BOX")]
+ Box = 1,
+ [global::ProtoBuf.ProtoEnum(Name = @"CYLINDER")]
+ Cylinder = 2,
+ [global::ProtoBuf.ProtoEnum(Name = @"SPHERE")]
+ Sphere = 3,
+ [global::ProtoBuf.ProtoEnum(Name = @"PLANE")]
+ Plane = 4,
+ [global::ProtoBuf.ProtoEnum(Name = @"IMAGE")]
+ Image = 5,
+ [global::ProtoBuf.ProtoEnum(Name = @"HEIGHTMAP")]
+ Heightmap = 6,
+ [global::ProtoBuf.ProtoEnum(Name = @"MESH")]
+ Mesh = 7,
+ [global::ProtoBuf.ProtoEnum(Name = @"TRIANGLE_FAN")]
+ TriangleFan = 8,
+ [global::ProtoBuf.ProtoEnum(Name = @"LINE_STRIP")]
+ LineStrip = 9,
+ [global::ProtoBuf.ProtoEnum(Name = @"POLYLINE")]
+ Polyline = 10,
+ [global::ProtoBuf.ProtoEnum(Name = @"EMPTY")]
+ Empty = 11,
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/geometry.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs.meta
new file mode 100644
index 00000000..44655a39
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8c39bf5b951045ad9bb3fcc47c94e03f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps.cs b/Assets/Scripts/Tools/ProtobufMessages/gps.cs
new file mode 100644
index 00000000..6187eb15
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gps.cs
@@ -0,0 +1,67 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: gps.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract(Name = @"GPS")]
+ public partial class Gps : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)]
+ public Time Time { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"link_name", IsRequired = true)]
+ public string LinkName { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"latitude_deg", IsRequired = true)]
+ public double LatitudeDeg { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"longitude_deg", IsRequired = true)]
+ public double LongitudeDeg { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"altitude", IsRequired = true)]
+ public double Altitude { get; set; }
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"velocity_east")]
+ public double VelocityEast
+ {
+ get { return __pbn__VelocityEast.GetValueOrDefault(); }
+ set { __pbn__VelocityEast = value; }
+ }
+ public bool ShouldSerializeVelocityEast() => __pbn__VelocityEast != null;
+ public void ResetVelocityEast() => __pbn__VelocityEast = null;
+ private double? __pbn__VelocityEast;
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"velocity_north")]
+ public double VelocityNorth
+ {
+ get { return __pbn__VelocityNorth.GetValueOrDefault(); }
+ set { __pbn__VelocityNorth = value; }
+ }
+ public bool ShouldSerializeVelocityNorth() => __pbn__VelocityNorth != null;
+ public void ResetVelocityNorth() => __pbn__VelocityNorth = null;
+ private double? __pbn__VelocityNorth;
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"velocity_up")]
+ public double VelocityUp
+ {
+ get { return __pbn__VelocityUp.GetValueOrDefault(); }
+ set { __pbn__VelocityUp = value; }
+ }
+ public bool ShouldSerializeVelocityUp() => __pbn__VelocityUp != null;
+ public void ResetVelocityUp() => __pbn__VelocityUp = null;
+ private double? __pbn__VelocityUp;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gps.cs.meta
new file mode 100644
index 00000000..e4925da1
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gps.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: db1e20a9d656620e3ae9705d5f5b6c45
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs
new file mode 100644
index 00000000..92c72ff0
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs
@@ -0,0 +1,43 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: gps_sensor.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class GPSSensor : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"position")]
+ public Sensing Position { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"velocity")]
+ public Sensing Velocity { get; set; }
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Sensing : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"horizontal_noise")]
+ public SensorNoise HorizontalNoise { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"vertical_noise")]
+ public SensorNoise VerticalNoise { get; set; }
+
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs.meta
new file mode 100644
index 00000000..29170036
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9d9b449d192aa9a07a5d383ef3dbb828
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui.cs b/Assets/Scripts/Tools/ProtobufMessages/gui.cs
new file mode 100644
index 00000000..1e866ebe
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gui.cs
@@ -0,0 +1,38 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: gui.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract(Name = @"GUI")]
+ public partial class Gui : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"fullscreen")]
+ public bool Fullscreen
+ {
+ get { return __pbn__Fullscreen.GetValueOrDefault(); }
+ set { __pbn__Fullscreen = value; }
+ }
+ public bool ShouldSerializeFullscreen() => __pbn__Fullscreen != null;
+ public void ResetFullscreen() => __pbn__Fullscreen = null;
+ private bool? __pbn__Fullscreen;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"camera")]
+ public GUICamera Camera { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"plugin")]
+ public global::System.Collections.Generic.List Plugins { get; } = new global::System.Collections.Generic.List();
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gui.cs.meta
new file mode 100644
index 00000000..d5f80b6b
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gui.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6c65dfe72adfca1ad9a2f7c582602c38
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs
new file mode 100644
index 00000000..5c5418af
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs
@@ -0,0 +1,53 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: gui_camera.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class GUICamera : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)]
+ public string Name { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"view_controller")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string ViewController
+ {
+ get { return __pbn__ViewController ?? ""; }
+ set { __pbn__ViewController = value; }
+ }
+ public bool ShouldSerializeViewController() => __pbn__ViewController != null;
+ public void ResetViewController() => __pbn__ViewController = null;
+ private string __pbn__ViewController;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"pose")]
+ public Pose Pose { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"track")]
+ public TrackVisual Track { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"projection_type")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string ProjectionType
+ {
+ get { return __pbn__ProjectionType ?? ""; }
+ set { __pbn__ProjectionType = value; }
+ }
+ public bool ShouldSerializeProjectionType() => __pbn__ProjectionType != null;
+ public void ResetProjectionType() => __pbn__ProjectionType = null;
+ private string __pbn__ProjectionType;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs.meta
new file mode 100644
index 00000000..64ae4580
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0fb3d171c559a91d0b466147c9fd677e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs
new file mode 100644
index 00000000..cbce2233
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs
@@ -0,0 +1,25 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: gz_string.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class GzString : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"data", IsRequired = true)]
+ public string Data { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs.meta
new file mode 100644
index 00000000..b398853b
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 93aba49193cff7c12ae2d8bd0f0865a8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs
new file mode 100644
index 00000000..0d11b652
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs
@@ -0,0 +1,25 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: gz_string_v.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract(Name = @"GzString_V")]
+ public partial class GzStringV : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"data")]
+ public global::System.Collections.Generic.List Datas { get; } = new global::System.Collections.Generic.List();
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs.meta
new file mode 100644
index 00000000..31f287af
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1f87186cc2accf52f8c02b7998f4dd9a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/header.cs b/Assets/Scripts/Tools/ProtobufMessages/header.cs
new file mode 100644
index 00000000..41d6f659
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/header.cs
@@ -0,0 +1,46 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: header.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Header : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"str_id")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string StrId
+ {
+ get { return __pbn__StrId ?? ""; }
+ set { __pbn__StrId = value; }
+ }
+ public bool ShouldSerializeStrId() => __pbn__StrId != null;
+ public void ResetStrId() => __pbn__StrId = null;
+ private string __pbn__StrId;
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"stamp")]
+ public Time Stamp { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"index")]
+ public int Index
+ {
+ get { return __pbn__Index.GetValueOrDefault(); }
+ set { __pbn__Index = value; }
+ }
+ public bool ShouldSerializeIndex() => __pbn__Index != null;
+ public void ResetIndex() => __pbn__Index = null;
+ private int? __pbn__Index;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/header.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/header.cs.meta
new file mode 100644
index 00000000..cbfc0a2f
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/header.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3bce6546fb7e837a3a159e0a033eb03e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs
new file mode 100644
index 00000000..088cd694
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs
@@ -0,0 +1,124 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: heightmapgeom.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class HeightmapGeom : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"image")]
+ public Image Image { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"size", IsRequired = true)]
+ public Vector3d Size { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"origin")]
+ public Vector3d Origin { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"heights")]
+ public float[] Heights { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"width")]
+ public int Width
+ {
+ get { return __pbn__Width.GetValueOrDefault(); }
+ set { __pbn__Width = value; }
+ }
+ public bool ShouldSerializeWidth() => __pbn__Width != null;
+ public void ResetWidth() => __pbn__Width = null;
+ private int? __pbn__Width;
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"height")]
+ public int Height
+ {
+ get { return __pbn__Height.GetValueOrDefault(); }
+ set { __pbn__Height = value; }
+ }
+ public bool ShouldSerializeHeight() => __pbn__Height != null;
+ public void ResetHeight() => __pbn__Height = null;
+ private int? __pbn__Height;
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"texture")]
+ public global::System.Collections.Generic.List Textures { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"blend")]
+ public global::System.Collections.Generic.List Blends { get; } = new global::System.Collections.Generic.List();
+
+ [global::ProtoBuf.ProtoMember(9, Name = @"use_terrain_paging")]
+ public bool UseTerrainPaging
+ {
+ get { return __pbn__UseTerrainPaging.GetValueOrDefault(); }
+ set { __pbn__UseTerrainPaging = value; }
+ }
+ public bool ShouldSerializeUseTerrainPaging() => __pbn__UseTerrainPaging != null;
+ public void ResetUseTerrainPaging() => __pbn__UseTerrainPaging = null;
+ private bool? __pbn__UseTerrainPaging;
+
+ [global::ProtoBuf.ProtoMember(10, Name = @"filename")]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string Filename
+ {
+ get { return __pbn__Filename ?? ""; }
+ set { __pbn__Filename = value; }
+ }
+ public bool ShouldSerializeFilename() => __pbn__Filename != null;
+ public void ResetFilename() => __pbn__Filename = null;
+ private string __pbn__Filename;
+
+ [global::ProtoBuf.ProtoMember(11, Name = @"sampling")]
+ public uint Sampling
+ {
+ get { return __pbn__Sampling.GetValueOrDefault(); }
+ set { __pbn__Sampling = value; }
+ }
+ public bool ShouldSerializeSampling() => __pbn__Sampling != null;
+ public void ResetSampling() => __pbn__Sampling = null;
+ private uint? __pbn__Sampling;
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Texture : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"diffuse", IsRequired = true)]
+ public string Diffuse { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"normal", IsRequired = true)]
+ public string Normal { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"size", IsRequired = true)]
+ public double Size { get; set; }
+
+ }
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Blend : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"min_height", IsRequired = true)]
+ public double MinHeight { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"fade_dist", IsRequired = true)]
+ public double FadeDist { get; set; }
+
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs.meta
new file mode 100644
index 00000000..3f239d31
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 698bbe03b24ae805093800ab3c5eea60
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/hydra.cs b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs
new file mode 100644
index 00000000..221e433f
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs
@@ -0,0 +1,70 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: hydra.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Hydra : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"right", IsRequired = true)]
+ public Paddle Right { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"left", IsRequired = true)]
+ public Paddle Left { get; set; }
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Paddle : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"pose", IsRequired = true)]
+ public Pose Pose { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"button_bumper", IsRequired = true)]
+ public bool ButtonBumper { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"button_1", IsRequired = true)]
+ public bool Button1 { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"button_2", IsRequired = true)]
+ public bool Button2 { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"button_3", IsRequired = true)]
+ public bool Button3 { get; set; }
+
+ [global::ProtoBuf.ProtoMember(6, Name = @"button_4", IsRequired = true)]
+ public bool Button4 { get; set; }
+
+ [global::ProtoBuf.ProtoMember(7, Name = @"button_joy", IsRequired = true)]
+ public bool ButtonJoy { get; set; }
+
+ [global::ProtoBuf.ProtoMember(8, Name = @"button_center", IsRequired = true)]
+ public bool ButtonCenter { get; set; }
+
+ [global::ProtoBuf.ProtoMember(9, Name = @"joy_x", IsRequired = true)]
+ public double JoyX { get; set; }
+
+ [global::ProtoBuf.ProtoMember(10, Name = @"joy_y", IsRequired = true)]
+ public double JoyY { get; set; }
+
+ [global::ProtoBuf.ProtoMember(11, Name = @"trigger", IsRequired = true)]
+ public double Trigger { get; set; }
+
+ }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/hydra.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs.meta
new file mode 100644
index 00000000..6a19d97c
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 882cceb622c966e4db886c0fb1be7318
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/image.cs b/Assets/Scripts/Tools/ProtobufMessages/image.cs
new file mode 100644
index 00000000..70250156
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/image.cs
@@ -0,0 +1,37 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: image.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class Image : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"width", IsRequired = true)]
+ public uint Width { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"height", IsRequired = true)]
+ public uint Height { get; set; }
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"pixel_format", IsRequired = true)]
+ public uint PixelFormat { get; set; }
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"step", IsRequired = true)]
+ public uint Step { get; set; }
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"data", IsRequired = true)]
+ public byte[] Data { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/image.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/image.cs.meta
new file mode 100644
index 00000000..8467fb45
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/image.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 73182cc810b9f36fb926c723cf83d2c0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs
new file mode 100644
index 00000000..53056a68
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs
@@ -0,0 +1,28 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: image_stamped.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class ImageStamped : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)]
+ public Time Time { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"image", IsRequired = true)]
+ public Image Image { get; set; }
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs.meta
new file mode 100644
index 00000000..45f9a3bf
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 77bce749a6da39e999c6a2f485755aa2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs
new file mode 100644
index 00000000..59746137
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs
@@ -0,0 +1,66 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: imagegeom.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class ImageGeom : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"uri", IsRequired = true)]
+ public string Uri { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"scale")]
+ public double Scale
+ {
+ get { return __pbn__Scale.GetValueOrDefault(); }
+ set { __pbn__Scale = value; }
+ }
+ public bool ShouldSerializeScale() => __pbn__Scale != null;
+ public void ResetScale() => __pbn__Scale = null;
+ private double? __pbn__Scale;
+
+ [global::ProtoBuf.ProtoMember(3, Name = @"threshold")]
+ [global::System.ComponentModel.DefaultValue(255)]
+ public int Threshold
+ {
+ get { return __pbn__Threshold ?? 255; }
+ set { __pbn__Threshold = value; }
+ }
+ public bool ShouldSerializeThreshold() => __pbn__Threshold != null;
+ public void ResetThreshold() => __pbn__Threshold = null;
+ private int? __pbn__Threshold;
+
+ [global::ProtoBuf.ProtoMember(4, Name = @"height")]
+ public double Height
+ {
+ get { return __pbn__Height.GetValueOrDefault(); }
+ set { __pbn__Height = value; }
+ }
+ public bool ShouldSerializeHeight() => __pbn__Height != null;
+ public void ResetHeight() => __pbn__Height = null;
+ private double? __pbn__Height;
+
+ [global::ProtoBuf.ProtoMember(5, Name = @"granularity")]
+ public int Granularity
+ {
+ get { return __pbn__Granularity.GetValueOrDefault(); }
+ set { __pbn__Granularity = value; }
+ }
+ public bool ShouldSerializeGranularity() => __pbn__Granularity != null;
+ public void ResetGranularity() => __pbn__Granularity = null;
+ private int? __pbn__Granularity;
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs.meta
new file mode 100644
index 00000000..36431a10
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 80402e84388091b4d9beb475bf964575
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs
new file mode 100644
index 00000000..a3db8b79
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs
@@ -0,0 +1,28 @@
+//
+// This file was generated by a tool; you should avoid making direct changes.
+// Consider using 'partial classes' to extend these types
+// Input: images_stamped.proto
+//
+
+#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
+namespace gazebo.msgs
+{
+
+ [global::ProtoBuf.ProtoContract()]
+ public partial class ImagesStamped : global::ProtoBuf.IExtensible
+ {
+ private global::ProtoBuf.IExtension __pbn__extensionData;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing);
+
+ [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)]
+ public Time Time { get; set; }
+
+ [global::ProtoBuf.ProtoMember(2, Name = @"image")]
+ public global::System.Collections.Generic.List Images { get; } = new global::System.Collections.Generic.List();
+
+ }
+
+}
+
+#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192
diff --git a/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs.meta
new file mode 100644
index 00000000..1357d55e
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d55eecf0739a01c8baead0480a412e07
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Tools/ProtobufMessages/imu.cs b/Assets/Scripts/Tools/ProtobufMessages/imu.cs
new file mode 100644
index 00000000..666a2f29
--- /dev/null
+++ b/Assets/Scripts/Tools/ProtobufMessages/imu.cs
@@ -0,0 +1,37 @@
+//