Inheritance: IDisposable
 public NyARUnityPSEye(PSEyeTexture i_ptx)
     : base(new NyARIntSize(i_ptx.Width,i_ptx.Height))
 {
     this._raster = new NyARUnityRaster(i_ptx.Width,i_ptx.Height,true);
     base.update(this._raster);
     this._ptx = i_ptx;
 }
Esempio n. 2
0
    void Awake()
    {
        // Check PS Eye number
        try {
            int psEyeCount = PSEyeTexture.CLEyeGetCameraCount();
            switch (psEyeCount)
            {
            case 0:
                Debug.LogError("No PS Eye found");
                return;

            case 1:
                Debug.LogError("Only one PS Eye found");
                return;
            }
        } catch (Exception e) {
            Debug.LogError("Oops..., Failed at loading CLEyeMulticam.dll. Please relaunch Unity!");
            Debug.LogError(e.ToString());
            return;
        }

        // Make PS Eye texture
        var PsEyeTexture = new PSEyeTexture(PsEyeId, FrameRate, true);

        psEye_ = new NyARUnityPSEye(PsEyeTexture);

        // Marker system
        var config = new NyARMarkerSystemConfig(PsEyeTexture.Width, PsEyeTexture.Height);

        markerSystem_ = new NyARUnityMarkerSystem(config);

        // Load marker from texture
        var markerTexture = (Texture2D)(Resources.Load(MarkerName, typeof(Texture2D)));

        markerId_ = markerSystem_.addARMarker(markerTexture, 16, 25, 80);

        // Marker layer
        MarkerObject.layer = Layer;
        for (int i = 0; i < MarkerObject.transform.GetChildCount(); ++i)
        {
            MarkerObject.transform.GetChild(i).gameObject.layer = Layer;
        }

        // Set camera background
        Background.renderer.material.mainTexture = PsEyeTexture.Texture;
        Background.layer      = Layer;
        ARCamera.cullingMask &= ~(1 << HiddenLayer);
        markerSystem_.setARBackgroundTransform(Background.transform);
        markerSystem_.setARCameraProjection(ARCamera);
    }
    void Awake()
    {
        // Check PS Eye number
        try {
            int psEyeCount = PSEyeTexture.CLEyeGetCameraCount();
            switch (psEyeCount) {
                case 0:
                    Debug.LogError("No PS Eye found");
                    return;
                case 1:
                    Debug.LogError("Only one PS Eye found");
                    return;
            }
        } catch (Exception e) {
            Debug.LogError("Oops..., Failed at loading CLEyeMulticam.dll. Please relaunch Unity!");
            Debug.LogError(e.ToString());
            return;
        }

        // Make PS Eye texture
        var PsEyeTexture = new PSEyeTexture(PsEyeId, FrameRate, true);
        psEye_ = new NyARUnityPSEye(PsEyeTexture);

        // Marker system
        var config     = new NyARMarkerSystemConfig(PsEyeTexture.Width, PsEyeTexture.Height);
        markerSystem_  = new NyARUnityMarkerSystem(config);

        // Load marker from texture
        var markerTexture = (Texture2D)(Resources.Load(MarkerName, typeof(Texture2D)));
        markerId_ = markerSystem_.addARMarker(markerTexture, 16, 25, 80);

        // Marker layer
        MarkerObject.layer = Layer;
        for (int i = 0; i < MarkerObject.transform.GetChildCount(); ++i) {
            MarkerObject.transform.GetChild(i).gameObject.layer = Layer;
        }

        // Set camera background
        Background.renderer.material.mainTexture = PsEyeTexture.Texture;
        Background.layer = Layer;
        ARCamera.cullingMask &= ~(1 << HiddenLayer);
        markerSystem_.setARBackgroundTransform(Background.transform);
        markerSystem_.setARCameraProjection(ARCamera);
    }
 public NyARUnityPSEye(PSEyeTexture i_ptx) : base(new NyARIntSize(i_ptx.Width, i_ptx.Height))
 {
     this._raster = new NyARUnityRaster(i_ptx.Width, i_ptx.Height, true);
     base.update(this._raster);
     this._ptx = i_ptx;
 }
 public void updateByPSEyeTexture(PSEyeTexture i_ptx)
 {
     i_ptx.GetPixels32((Color32[])this._buf);
     //this._rgb_pixel_driver.switchRaster(this);//バッファを上書きするからいらない。
     return;
 }
 public void updateByPSEyeTexture(PSEyeTexture i_ptx)
 {
     i_ptx.GetPixels32((Color32[])this._buf);
     //this._rgb_pixel_driver.switchRaster(this);//バッファを上書きするからいらない。
     return;
 }