[RESOLVIDO] Vuforia bug
2 participantes
SchultzGames :: UNITY 3D :: Resolvidos
Página 1 de 1
[RESOLVIDO] Vuforia bug
Boa noite brothers
Estou usando Vuforia mais depois de atualizar a Unity esta aparecendo esse erro?
Estou usando Vuforia mais depois de atualizar a Unity esta aparecendo esse erro?
- Código:
Assets/Vuforia/Editor/Scripts/Unzipper/SharpZipLibUnzipper.cs(31,20): error CS0103: The name `Unzipe' does not exist in the current context
- Código:
import System.IO.File;
import System.IO.Stream;
import ICSharpCode.SharpZipLib.Core;
import ICSharpCode.SharpZipLib.Zip;
// this script unzips a container at a given path and returns a input stream to a given file in this container
public static function Unzip(path : String, fileName : String)
{
var fileStream = OpenRead(path);
var zipFile = new ZipFile(fileStream);
for (var zipEntry : ZipEntry in zipFile)
{
if (zipEntry.Name == fileName)
{
return zipFile.GetInputStream(zipEntry);
}
}
return;
}
- Código:
/*==============================================================================
Copyright (c) 2013-2014 Qualcomm Connected Experiences, Inc.
All Rights Reserved.
Confidential and Proprietary - Protected under copyright and other laws.
==============================================================================*/
using System.IO;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
namespace Vuforia.EditorClasses
{
/// <summary>
/// class wrapping a JS functionality to unzip a file, registers itself at the Unzipper Singleton to provide the functionality.
/// </summary>
[InitializeOnLoad]
public class SharpZipLibUnzipper : IUnzipper
{
/// <summary>
/// register an instance of this class at the singleton immediately
/// </summary>
static SharpZipLibUnzipper()
{
Unzipper.Instance = new SharpZipLibUnzipper();
}
public Stream UnzipFile(string path, string fileNameinZip)
{
#if !EXCLUDE_JAVASCRIPT
return Unzipe.Unzip(path, fileNameinZip);
#else
return null;
#endif
}
}
}
Última edição por dstaroski em Dom Jan 13, 2019 9:45 am, editado 2 vez(es) (Motivo da edição : Resolvido)
Re: [RESOLVIDO] Vuforia bug
Atualizei a unity e esses erros pararam
Mais agora nao copila
Mostra esses
Desse script
Mais agora nao copila
Mostra esses
- Código:
Assets/Vuforia/Scripts/Utilities/VRIntegrationHelper.cs(101,29): error CS1061: Type `UnityEngine.Camera' does not contain a definition for `SetStereoProjectionMatrices' and no extension method `SetStereoProjectionMatrices' of type `UnityEngine.Camera' could be found. Are you missing an assembly reference?
Assets/Vuforia/Scripts/Utilities/VRIntegrationHelper.cs(102,30): error CS1061: Type `UnityEngine.Camera' does not contain a definition for `SetStereoProjectionMatrices' and no extension method `SetStereoProjectionMatrices' of type `UnityEngine.Camera' could be found. Are you missing an assembly reference?
Error building Player because scripts had compiler errors
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Desse script
- Código:
using System;
using UnityEngine;
using Vuforia;
public class VRIntegrationHelper : MonoBehaviour
{
private static Matrix4x4 mLeftCameraMatrixOriginal;
private static Matrix4x4 mRightCameraMatrixOriginal;
private static Camera mLeftCamera;
private static Camera mRightCamera;
private static HideExcessAreaAbstractBehaviour mLeftExcessAreaBehaviour;
private static HideExcessAreaAbstractBehaviour mRightExcessAreaBehaviour;
private static Rect mLeftCameraPixelRect;
private static Rect mRightCameraPixelRect;
private static bool mLeftCameraDataAcquired = false;
private static bool mRightCameraDataAcquired = false;
public bool IsLeft;
public Transform TrackableParent;
void Awake()
{
GetComponent<Camera>().fieldOfView = 90f;
mLeftCamera = GetComponent<Camera>();
mRightCamera = GetComponent<Camera>();
}
void Start()
{
VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);
}
void OnVuforiaStarted()
{
mLeftCamera = DigitalEyewearARController.Instance.PrimaryCamera;
mRightCamera = DigitalEyewearARController.Instance.SecondaryCamera;
mLeftExcessAreaBehaviour = mLeftCamera.GetComponent<HideExcessAreaAbstractBehaviour>();
mRightExcessAreaBehaviour = mRightCamera.GetComponent<HideExcessAreaAbstractBehaviour>();
}
void LateUpdate()
{
// to this only once per frame, not for both cameras
if (IsLeft)
{
if (mLeftCameraDataAcquired && mRightCameraDataAcquired)
{
// make sure the central anchor point is set to the latest head tracking pose:
DigitalEyewearARController.Instance.CentralAnchorPoint.localRotation = mLeftCamera.transform.localRotation;
DigitalEyewearARController.Instance.CentralAnchorPoint.localPosition = mLeftCamera.transform.localPosition;
// temporarily set the primary and secondary cameras to their offset position and set the pixelrect they will have for rendering
Vector3 localPosLeftCam = mLeftCamera.transform.localPosition;
Rect leftCamPixelRect = mLeftCamera.pixelRect;
Vector3 leftCamOffset = mLeftCamera.transform.right.normalized * mLeftCamera.stereoSeparation * -0.5f;
mLeftCamera.transform.position = mLeftCamera.transform.position + leftCamOffset;
mLeftCamera.pixelRect = mLeftCameraPixelRect;
Vector3 localPosRightCam = mRightCamera.transform.localPosition;
Rect rightCamPixelRect = mRightCamera.pixelRect;
Vector3 rightCamOffset = mRightCamera.transform.right.normalized * mRightCamera.stereoSeparation * 0.5f;
mRightCamera.transform.position = mRightCamera.transform.position + rightCamOffset;
mRightCamera.pixelRect = mRightCameraPixelRect;
BackgroundPlaneBehaviour bgPlane = mLeftCamera.GetComponentInChildren<BackgroundPlaneBehaviour>();
bgPlane.BackgroundOffset = mLeftCamera.transform.position - DigitalEyewearARController.Instance.CentralAnchorPoint.position;
mLeftExcessAreaBehaviour.PlaneOffset = mLeftCamera.transform.position - DigitalEyewearARController.Instance.CentralAnchorPoint.position;
mRightExcessAreaBehaviour.PlaneOffset = mRightCamera.transform.position - DigitalEyewearARController.Instance.CentralAnchorPoint.position;
if (TrackableParent != null)
TrackableParent.localPosition = Vector3.zero;
// update Vuforia explicitly
VuforiaARController.Instance.UpdateState(false, true);
if (TrackableParent != null)
TrackableParent.position += bgPlane.BackgroundOffset;
// set the projection matrices for skewing
VuforiaARController.Instance.ApplyCorrectedProjectionMatrix(mLeftCameraMatrixOriginal, true);
VuforiaARController.Instance.ApplyCorrectedProjectionMatrix(mRightCameraMatrixOriginal, false);
// read back the projection matrices set by Vuforia and set them to the stereo cameras
// not sure if the matrices would automatically propagate between the left and right, so setting it explicitly twice
mLeftCamera.SetStereoProjectionMatrices(mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
mRightCamera.SetStereoProjectionMatrices(mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
// reset the left camera
mLeftCamera.transform.localPosition = localPosLeftCam;
mLeftCamera.pixelRect = leftCamPixelRect;
// reset the position of the right camera
mRightCamera.transform.localPosition = localPosRightCam;
mRightCamera.pixelRect = rightCamPixelRect;
}
}
}
// OnPreRender is called once per camera each frame
void OnPreRender()
{
// on pre render is where projection matrix and pixel rect are set up correctly (for each camera individually)
// so we use this to acquire this data.
if (IsLeft && !mLeftCameraDataAcquired)
{
// at start matrix can be undefined
if (!VuforiaRuntimeUtilities.MatrixIsNaN(mLeftCamera.projectionMatrix))
{
mLeftCameraMatrixOriginal = mLeftCamera.projectionMatrix;
mLeftCameraPixelRect = mLeftCamera.pixelRect;
mLeftCameraDataAcquired = true;
}
}
else if (!mRightCameraDataAcquired)
{
// at start matrix can be undefined
if (!VuforiaRuntimeUtilities.MatrixIsNaN(mRightCamera.projectionMatrix))
{
mRightCameraMatrixOriginal = mRightCamera.projectionMatrix;
mRightCameraPixelRect = mRightCamera.pixelRect;
mRightCameraDataAcquired = true;
}
}
}
}
Re: [RESOLVIDO] Vuforia bug
Bom dia. Comente as linhas 93 e 94 do seu código. O erro deve resolver.
NKKF- ProgramadorMaster
- PONTOS : 4821
REPUTAÇÃO : 574
Idade : 20
Áreas de atuação : Desenvolvedor na Unity, NodeJS, React, ReactJS, React Native, MongoDB e Firebase.
Respeito as regras :
Re: [RESOLVIDO] Vuforia bug
Comente as linhas 93 e 94 do seu código. O erro deve resolver.
?
Nao entedi brother
?
Nao entedi brother
Re: [RESOLVIDO] Vuforia bug
Coloque os "//" para deixar o código em comentário:
Compreende?
Ou apenas as remova.
- Código:
//mLeftCamera.SetStereoProjectionMatrices(mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
http://mRightCamera.SetStereoProjectionMatrices(mLeftCamera.projectionMatrix, mRightCamera.projectionMatrix);
Compreende?
Ou apenas as remova.
NKKF- ProgramadorMaster
- PONTOS : 4821
REPUTAÇÃO : 574
Idade : 20
Áreas de atuação : Desenvolvedor na Unity, NodeJS, React, ReactJS, React Native, MongoDB e Firebase.
Respeito as regras :
Tópicos semelhantes
» [RESOLVIDO] Verificar se um texto é um email [RESOLVIDO]
» [TUTORIAL] AI Enemy ( Jogos de terror )
» [RESOLVIDO] De me uma luz
» [RESOLVIDO] Fps em C#
» [RESOLVIDO]O que faz o Transform.TransformDirection
» [TUTORIAL] AI Enemy ( Jogos de terror )
» [RESOLVIDO] De me uma luz
» [RESOLVIDO] Fps em C#
» [RESOLVIDO]O que faz o Transform.TransformDirection
SchultzGames :: UNITY 3D :: Resolvidos
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos