示例#1
0
        protected static ReadOnlyUrl Get(ReadOnlyUrl baseUrl, DetailLevel detailLevel)
        {
            var url = baseUrl.AsNonReadOnly();

            url.QueryString.Add("DetailLevel", detailLevel.ToString());
            return(url);
        }
示例#2
0
文件: Mesh.cs 项目: jhurliman/simian
        public void StoreRenderingMesh(ulong meshKey, DetailLevel lod, RenderingMesh mesh)
        {
            UUID   dataID      = new UUID(meshKey);
            string contentType = RENDER_MESH_BASE_CONTENT_TYPE + "-" + lod.ToString().ToLower();

            byte[] data = mesh.Serialize();

            m_dataStore.AddOrUpdateAsset(dataID, contentType, data, true);
        }
示例#3
0
文件: Mesh.cs 项目: jhurliman/simian
        public void StoreConvexHullSet(ulong meshKey, DetailLevel lod, ConvexHullSet hullSet)
        {
            UUID   dataID      = new UUID(meshKey);
            string contentType = CONVEX_HULL_BASE_CONTENT_TYPE + "-" + lod.ToString().ToLower();

            byte[] data = hullSet.Serialize();

            m_dataStore.AddOrUpdateAsset(dataID, contentType, data, true);
        }
    void DrawDetailLevelEntry(SerializedProperty prop, DetailLevel detail, int min, Func <SerializedProperty, int> triCount)
    {
        bool isInt2 = prop.propertyType == SerializedPropertyType.Vector2Int;

        using (ShapesUI.Horizontal) {
            using (ShapesUI.TempLabelWidth(100)) {
                using (var chChk = new EditorGUI.ChangeCheckScope()) {
                    if (isInt2)
                    {
                        SerializedProperty x = prop.FindPropertyRelative("x");
                        SerializedProperty y = prop.FindPropertyRelative("y");
                        EditorGUILayout.PrefixLabel(new GUIContent(detail.ToString(), "Minor & major axis divisions"));
                        using (new EditorGUI.IndentLevelScope(-2)) {
                            EditorGUILayout.PropertyField(x, GUIContent.none, GUILayout.Width(32));
                            EditorGUILayout.PropertyField(y, GUIContent.none, GUILayout.Width(32));
                        }
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(prop, new GUIContent(detail.ToString()), GUILayout.Width(150));
                    }


                    if (chChk.changed)
                    {
                        // clamp
                        if (isInt2)
                        {
                            prop.vector2IntValue = new Vector2Int(Mathf.Max(min, prop.vector2IntValue.x), Mathf.Max(min, prop.vector2IntValue.y));
                        }
                        else
                        {
                            prop.intValue = Mathf.Max(min, prop.intValue);
                        }
                    }
                }
            }

            GUILayout.Label($"{triCount( prop )} tris");
        }
    }
示例#5
0
        public bool TryGetRenderingMesh(ulong meshKey, DetailLevel lod, out RenderingMesh mesh)
        {
            UUID dataID = new UUID(meshKey);
            string contentType = MESH_BASE_CONTENT_TYPE + "-" + lod.ToString().ToLower();

            mesh = null;

            byte[] meshData;
            if (m_dataStore.TryGetAsset(dataID, contentType, out meshData))
            {
                try
                {
                    mesh = RenderingMesh.Deserialize(meshData);
                }
                catch (Exception ex)
                {
                    m_log.WarnFormat("Failed to deserialize mesh {0} ({1}): {2}", dataID, contentType, ex.Message);
                }
            }

            return (mesh != null);
        }
示例#6
0
        public void StoreRenderingMesh(ulong meshKey, DetailLevel lod, RenderingMesh mesh)
        {
            UUID dataID = new UUID(meshKey);
            string contentType = MESH_BASE_CONTENT_TYPE + "-" + lod.ToString().ToLower();
            byte[] data = mesh.Serialize();

            m_dataStore.AddOrUpdateAsset(dataID, contentType, data, true);
        }
示例#7
0
文件: Mesh.cs 项目: thoys/simian
        public void StoreConvexHullSet(ulong meshKey, DetailLevel lod, ConvexHullSet hullSet)
        {
            UUID dataID = new UUID(meshKey);
            string contentType = CONVEX_HULL_BASE_CONTENT_TYPE + "-" + lod.ToString().ToLower();
            byte[] data = hullSet.Serialize();

            m_dataStore.AddOrUpdateAsset(dataID, contentType, data, true);
        }