stephenguanqi / unity-arkit-plugin Goto Github PK
View Code? Open in Web Editor NEWModified plugin source and Add custom ARKit projects implement on Unity
License: GNU General Public License v3.0
Modified plugin source and Add custom ARKit projects implement on Unity
License: GNU General Public License v3.0
it's really awesome, can you share your ARSessionNative.mm, UnityARSessionNativeInterface, and ARFrameHandler.
Hi there,
I'm getting the following errors after installing the plugin:
Assets/UnityARKitPlugin/ARKitRemote/SerializableObjects.cs(146,10): error CS0246: The type or namespace name `UnityVideoParams' could not be found. Are you missing an assembly reference?
Assets/UnityARKitPlugin/ARKitRemote/SerializableObjects.cs(147,10): error CS0246: The type or namespace name `UnityARLightEstimate' could not be found. Are you missing an assembly reference?
Assets/UnityARKitPlugin/ARKitRemote/SerializableObjects.cs(288,70): error CS0246: The type or namespace name `ARKitWorldTrackingSessionConfiguration' could not be found. Are you missing an assembly reference?
Any idea what's wrong?
I'm using Unity 2017.1.1p4 and the latest Unity-ARKit-Plugin (official)
I'd love a feature to create multiple objects and be able to move them independently of each other.
example:
I have two UI buttons, one for a cube and one for a sphere.
I can click the cube button and create a cube at the position of the plane I touched. I can then touch another position to move the cube to this new position.
I can then do the same for the sphere after clicking it's corresponding button.
Would something like that be possible?
changing transform doesn't work. Do you have any idea?
Move my gameObject up from existing position in AR world but none of it works.
I'm trying to do transform.DOMove(....)
to move the gameObject up AR World. I also tried changing the localposition
But none of that works. Object ie. prefab stays at same position.
How do we move the object that's instantiated in AR World?
I have commented the code in which I'm also directly modifying the transform but doesn't work either.
DOTween is free Tweening package to Tween an Object
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.iOS;
using DG.Tweening;
using UnityEngine.UI;
public class TestHitControl : MonoBehaviour {
public GameObject obj;
private UnityARSessionNativeInterface m_session;
// Use this for initialization
void Start () {
DOTween.Init(false, true, LogBehaviour.ErrorsOnly);
m_session = UnityARSessionNativeInterface.GetARSessionNativeInterface ();
}
// Update is called once per frame
void Update () {
if (Input.touchCount > 0) {
if (Input.GetTouch (0).phase == TouchPhase.Began) {
createGameObject ();
}
}
}
void createGameObject(){
Vector3 screenPos = Camera.main.ScreenToViewportPoint (Input.GetTouch (0).position);
ARPoint point = new ARPoint{ x= screenPos.x,y=screenPos.y };
ARHitTestResultType[] resultTypes = {
ARHitTestResultType.ARHitTestResultTypeExistingPlaneUsingExtent,
// if you want to use infinite planes use this:
//ARHitTestResultType.ARHitTestResultTypeExistingPlane,
ARHitTestResultType.ARHitTestResultTypeHorizontalPlane,
ARHitTestResultType.ARHitTestResultTypeFeaturePoint
};
foreach (ARHitTestResultType resultType in resultTypes)
{
List<ARHitTestResult> hitResults = m_session.HitTest (point, resultType);
if (hitResults.Count > 0) {
GameObject currentObj = GameObject.Instantiate (obj);
currentObj.transform.position = UnityARMatrixOps.GetPosition (hitResults [0].worldTransform);
currentObj.transform.rotation = UnityARMatrixOps.GetRotation (hitResults [0].worldTransform);
currentObj.transform.LookAt (new Vector3(Camera.main.transform.position.x, currentObj.transform.position.y, Camera.main.transform.position.z));
myText.text = currentObj.transform.position.ToString();
StartCoroutine(SlideUp(currentObj));
//new WaitForSeconds(10f);
//obj.transform.DOMove(currentObj.transform.position + (Vector3.up * 100), 10);
}
}
}
IEnumerator SlideUp(GameObject currentObj) {
yield return new WaitForSeconds(1f);
obj.transform.DOMove(currentObj.transform.position + (Vector3.up * 100), 10);
}
}
Hi,
Can I get the CVbuffer data directly inside Unity, like the IntPtr of the Yplane and CbCr?
It will be very usefull to feed another plugin with the YUV buffer for processing.
Your plugin can do that?
Thanks
hi
Can you use this for a video playback?
like this
https://www.youtube.com/watch?v=rN2Nmimzvwc
thank you for help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.