public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { vec3i obj = (vec3i)fieldInfo.GetValue(property.serializedObject.targetObject); Rect contentPosition = EditorGUI.PrefixLabel(position, label); contentPosition.width *= .25f; EditorGUIUtility.labelWidth = 14f; EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("x"), new GUIContent("X")); contentPosition.x += contentPosition.width; EditorGUIUtility.labelWidth = 14f; EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("y"), new GUIContent("Y")); contentPosition.x += contentPosition.width; EditorGUIUtility.labelWidth = 14f; EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("z"), new GUIContent("Z")); contentPosition.x += contentPosition.width; EditorGUI.SelectableLabel(contentPosition, "l: " + obj.length.ToString()); }
public Index3i[] GetTrianglesInRange(int nObjectID, int nTriangleIDStart, int nCount) { StoredCommands sc = new StoredCommands(); uint[] keys = new uint[nCount]; for (int k = 0; k < nCount; ++k) { keys[k] = sc.AppendSceneCommand_GetTriangleIndices(nObjectID, nTriangleIDStart + k); } ExecuteCommands(sc); Index3i[] vTriangles = new Index3i[nCount]; for (int k = 0; k < nCount; ++k) { vec3i v = new vec3i(); bool bOK = sc.GetSceneCommandResult_GetTriangleIndices(keys[k], v); vTriangles[k] = (bOK) ? g3Extensions.ToIndex3i(v) : Index3i.Max; } return(vTriangles); }
public aabb3i(vec3i a, vec3i b) { this.a = a; this.b = b; }
public static Index3i ToIndex3i(vec3i ijk) { return(new Index3i(ijk.i, ijk.j, ijk.k)); }