浏览代码

Update README.md

WIP, meshing readme update
/main
GitHub 5 年前
当前提交
769e054a
共有 1 个文件被更改,包括 20 次插入1 次删除
  1. 21
      README.md

21
README.md


3. You will need to do this for every platform you are building for. (Once for Android and once for iOS).
## Mesh Placement
# Mesh Placement
An example scene for using [ARKit meshing](https://docs.unity3d.com/Packages/com.unity.xr.arkit@4.0/manual/arkit-meshing.html) feature with the available surface [classifications](https://developer.apple.com/documentation/arkit/armeshclassification) to place unique objects on surfaces. This demo adds some additional functionality for use cases helpful outside of this demo such as a placement reticle and the [DOTween tweening library](http://dotween.demigiant.com/).
## Mesh Classificatons
Classifying the surfaces is managed by the [MeshClassificationManager.cs](https://github.com/Unity-Technologies/arfoundation-demos/blob/master/Assets/Meshing/Scripts/MeshClassificationManager.cs) which maintains a [Dictionary](https://github.com/Unity-Technologies/arfoundation-demos/blob/master/Assets/Meshing/Scripts/MeshClassificationManager.cs#L49) of TrackableID's and a native array of ARMeshClassifications. By subscribing to the meshesChanged event on the AR Mesh Manager we maintain the dictionary of added, updated and removed meshes based on trackable ID's of the meshes generated.
> there is currently an issue with the trackable ID's on the meshes found so we use the string name is order to properly extract and store the correct trackable ID of the meshes
Once we have an up to date dictionary we can query it based on a trackable ID as the key and a triangle index as the index in our native array. This returns an ARMeshClassification enum.
To update the label at the top of the demo we use a physics raycast to raycast against the megamesh generated by the ARMeshManager to get the correct triangle index and parse the current classification for a more readable string label.
> to generate a mesh collider for physics raycast our megamesh must contain a mesh collider component on it
## Placement Reticle
## Mesh Key
## DOTween is available on the Unity Asset store [here](https://assetstore.unity.com/packages/tools/animation/dotween-hotween-v2-27676)
For this demo it is used to scaling up the placed objects as they appear.
It was developed by Daniele Giardini - Demigiant and is Copyright (c) 2014. Full License for DOTween available [here](http://dotween.demigiant.com/license.php)
正在加载...
取消
保存