Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion documentation/docs/05-changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## CHANGELOG
### v.1.4.0
### v.1.4.1
*??/??/2018*

#####
- Add two new modules, KdTreeCollection and AddToCollection Gameobject modifier.
- Add Collider option for vector features.
- Fix to make filter values case insensitive.
- Fix issue where position vector features was not being set.
- Fix `Range Property` extrusion option for vector features.
- Add scale factor for extrusion value derived from feature property.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 82ed8ed837e25084bbe8a37d53c5b77b, type: 3}
m_Name: BuildingCollection
m_EditorClassIdentifier:
Count: 2406

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
namespace Mapbox.Examples
{
using KDTree;
using UnityEngine;
using Mapbox.Unity.MeshGeneration;
using Mapbox.Unity.MeshGeneration.Data;

public class HighlightBuildings : MonoBehaviour
{
public KdTreeCollection Collection;
public int MaxCount = 100;
public float Range = 10;
Ray ray;
Plane groundPlane = new Plane(Vector3.up, Vector3.zero);
Vector3 pos;
float rayDistance;
private NearestNeighbour<VectorEntity> pIter;

void Update()
{
if (Input.GetMouseButton(0))
{
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (groundPlane.Raycast(ray, out rayDistance))
{
pos = ray.GetPoint(rayDistance);
pIter = Collection.NearestNeighbors(new double[] { pos.x, pos.z }, MaxCount, Range);
while (pIter.MoveNext())
{
pIter.Current.Transform.localScale = Vector3.zero;
}
}
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,13 @@ MonoBehaviour:
colorPallete: {fileID: 11400000, guid: e1b79d6caac0144adada0c548ef06705,
type: 2}
buildingsWithUniqueIds: 0
moveFeaturePositionTo: 0
moveFeaturePositionTo: 2
MeshModifiers: []
GoModifiers:
- {fileID: 11400000, guid: b7b664c5d0b1dfd4ea8bf239a71912ef, type: 2}
- {fileID: 11400000, guid: 14ec972a1cec2dc429f5eca7d22b572f, type: 2}
- {fileID: 11400000, guid: aa354e89f869a4db0a6c3ceb3c79d0be, type: 2}
- {fileID: 11400000, guid: d534c6a861f735c4dab3990ac3c05158, type: 2}
- coreOptions:
isActive: 1
sublayerName: Parks
Expand Down Expand Up @@ -1524,6 +1525,7 @@ GameObject:
- component: {fileID: 1351042190}
- component: {fileID: 1351042187}
- component: {fileID: 1351042188}
- component: {fileID: 1351042189}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
Expand Down Expand Up @@ -1557,6 +1559,20 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
ShadowDistance: 1000
--- !u!114 &1351042189
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1351042186}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f64621ccb8a60114c83bbd39e5fdc145, type: 3}
m_Name:
m_EditorClassIdentifier:
Collection: {fileID: 11400000, guid: f11fd5ce183f93846858df725d8eab7b, type: 2}
MaxCount: 100
Range: 10
--- !u!81 &1351042190
AudioListener:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1793,7 +1809,7 @@ Prefab:
- target: {fileID: 224907993215804030, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
propertyPath: m_AnchorMin.y
value: 0
value: 0.000000059604645
objectReference: {fileID: 0}
- target: {fileID: 224907993215804030, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
Expand Down Expand Up @@ -1823,7 +1839,7 @@ Prefab:
- target: {fileID: 224835413515161394, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
propertyPath: m_AnchoredPosition.y
value: -68.92136
value: -70.363434
objectReference: {fileID: 0}
- target: {fileID: 224835413515161394, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
Expand All @@ -1833,12 +1849,12 @@ Prefab:
- target: {fileID: 224835413515161394, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
propertyPath: m_SizeDelta.y
value: 117.84271
value: 120.72687
objectReference: {fileID: 0}
- target: {fileID: 224857786874416376, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
propertyPath: m_SizeDelta.y
value: 137.84271
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224907856650798614, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
Expand Down Expand Up @@ -1889,7 +1905,7 @@ Prefab:
- target: {fileID: 224857786874416376, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
propertyPath: m_AnchoredPosition.y
value: 0.000015258789
value: -0.000015258789
objectReference: {fileID: 0}
- target: {fileID: 114731470950229392, guid: 98be219873e6d4dffb5949746f515a33,
type: 2}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4538b91da572dfa41adf689573eaba4b, type: 3}
m_Name: AddToTreeCollectionModifier
m_EditorClassIdentifier:
Active: 1
_collection: {fileID: 11400000, guid: f11fd5ce183f93846858df725d8eab7b, type: 2}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ MonoBehaviour:
MeshModifiers:
- {fileID: 11400000, guid: 4fe5c136889ae0347af431be7e59e489, type: 2}
- {fileID: 11400000, guid: b432bf85b0df280468dcfdaf5a9b90d0, type: 2}
- {fileID: 11400000, guid: 97f59348b2a022d4eb425de65a1f8ce5, type: 2}
- {fileID: 11400000, guid: c1c619f43a2cb5b4a8cbc80e9e814804, type: 2}
- {fileID: 11400000, guid: a49403503b2b1534f832833cbd477437, type: 2}
GoModifiers:
- {fileID: 11400000, guid: 85d7acaaafb33410dbbc83cfad604f86, type: 2}
- {fileID: 11400000, guid: af0e85fdc76cf4bceb25d8ad0bfa2ace, type: 2}
- {fileID: 11400000, guid: f79ee57901cdf483e87c86d4ce3e7247, type: 2}
- {fileID: 11400000, guid: d534c6a861f735c4dab3990ac3c05158, type: 2}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace Mapbox.Unity.MeshGeneration
{
using Mapbox.Unity.MeshGeneration.Data;
using UnityEngine;

public class FeatureCollectionBase : ScriptableObject
{
public virtual void Initialize()
{

}

public virtual void AddFeature(double[] position, VectorEntity ve)
{

}

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sdkproject/Assets/Mapbox/Unity/MeshGeneration/Data/KdTree.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KDTree
{
/// <summary>
/// An interface which enables flexible distance functions.
/// </summary>
public interface DistanceFunctions
{
/// <summary>
/// Compute a distance between two n-dimensional points.
/// </summary>
/// <param name="p1">The first point.</param>
/// <param name="p2">The second point.</param>
/// <returns>The n-dimensional distance.</returns>
double Distance(double[] p1, double[] p2);

/// <summary>
/// Find the shortest distance from a point to an axis aligned rectangle in n-dimensional space.
/// </summary>
/// <param name="point">The point of interest.</param>
/// <param name="min">The minimum coordinate of the rectangle.</param>
/// <param name="max">The maximum coorindate of the rectangle.</param>
/// <returns>The shortest n-dimensional distance between the point and rectangle.</returns>
double DistanceToRectangle(double[] point, double[] min, double[] max);
}

/// <summary>
/// A distance function for our KD-Tree which returns squared euclidean distances.
/// </summary>
public class SquareEuclideanDistanceFunction : DistanceFunctions
{
/// <summary>
/// Find the squared distance between two n-dimensional points.
/// </summary>
/// <param name="p1">The first point.</param>
/// <param name="p2">The second point.</param>
/// <returns>The n-dimensional squared distance.</returns>
public double Distance(double[] p1, double[] p2)
{
double fSum = 0;
for (int i = 0; i < p1.Length; i++)
{
double fDifference = (p1[i] - p2[i]);
fSum += fDifference * fDifference;
}
return fSum;
}

/// <summary>
/// Find the shortest distance from a point to an axis aligned rectangle in n-dimensional space.
/// </summary>
/// <param name="point">The point of interest.</param>
/// <param name="min">The minimum coordinate of the rectangle.</param>
/// <param name="max">The maximum coorindate of the rectangle.</param>
/// <returns>The shortest squared n-dimensional squared distance between the point and rectangle.</returns>
public double DistanceToRectangle(double[] point, double[] min, double[] max)
{
double fSum = 0;
double fDifference = 0;
for (int i = 0; i < point.Length; ++i)
{
fDifference = 0;
if (point[i] > max[i])
fDifference = (point[i] - max[i]);
else if (point[i] < min[i])
fDifference = (point[i] - min[i]);
fSum += fDifference * fDifference;
}
return fSum;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading