Tweaked Invoke time, properly disable Gizmos, added debug lines to CVRAvatar.

Invoke time is now 0f, so toggling and refreshing Gizmos are now instant... oops.
GizmosInstance is now properly disabled when not in use. Also removed the default gizmos line drawing at 0,0,0 that was purely there to clear gizmos queue.

CVRAvatar debugging now has useful lines coming from the viewpoint and mouth positions. Later on might actually parent these gizmos to the head : shrug :
This commit is contained in:
NotAKidoS 2022-09-15 13:12:37 -05:00
parent 65b57db665
commit 821b1efcd8
3 changed files with 12 additions and 6 deletions

View file

@ -1,4 +1,5 @@
using CVRGizmos.GismoTypes;
using Gizmos = Popcron.Gizmos;
using UnityEngine;
namespace CVRGizmos
@ -41,6 +42,7 @@ namespace CVRGizmos
for (int i = 0; i < GizmoTypes.Count(); i++)
{
managed[i].enabled = able;
Gizmos.Enabled = able;
}
RefreshGizmos();
}
@ -49,7 +51,7 @@ namespace CVRGizmos
{
for (int i = 0; i < GizmoTypes.Count(); i++)
{
managed[i].Invoke("CacheGizmos", 1f);
managed[i].Invoke("CacheGizmos", 0f);
}
}
}

View file

@ -37,8 +37,12 @@ namespace CVRGizmos.GismoTypes
Gizmos.Color = Color.green;
Gizmos.Matrix = Matrix4x4.TRS(references[i].transform.position, references[i].transform.rotation, references[i].transform.localScale);
Gizmos.Sphere(references[i].viewPosition, 0.01f);
Gizmos.Line(references[i].viewPosition, references[i].viewPosition + Vector3.forward * 0.05f);
Gizmos.Line(references[i].viewPosition, references[i].viewPosition + Vector3.right * 0.05f);
Gizmos.Color = Color.red;
Gizmos.Sphere(references[i].voicePosition, 0.01f);
Gizmos.Line(references[i].voicePosition, references[i].voicePosition + Vector3.forward * 0.05f);
Gizmos.Line(references[i].voicePosition, references[i].voicePosition + Vector3.right * 0.05f);
}
}
}

View file

@ -329,11 +329,11 @@ namespace Popcron
return false;
}
private void Update()
{
//always render something
Gizmos.Line(default, default);
}
//private void Update()
//{
// //always render something
// Gizmos.Line(default, default);
//}
private void OnRendered(Camera camera)
{