color cube fixed

This commit is contained in:
spatialfree 2021-12-06 10:51:59 -05:00
parent 7b5d824cc0
commit 80eb666773

View file

@ -340,12 +340,13 @@ public class Mono {
// COLOR CUBE
// reveal when palm up
float reveal = subCon.pose.Right.y * 0.666f;
reveal += (1 - Math.Clamp(Vec3.Dot((subCon.pose.position - Input.Head.position).Normalized, Input.Head.Forward), 0f, 1f)) * 0.666f;
float reveal = subCon.pose.Right.y * 1.666f;
float look = 1 - Math.Clamp((1 - Math.Clamp(Vec3.Dot((subCon.pose.position - Input.Head.position).Normalized, Input.Head.Forward), 0f, 1f)) * 6f, 0f, 1f);
reveal *= look;
colorCube.size = colorCube.ogSize * Math.Clamp(reveal, 0, 1);
colorCube.center = subCon.pose.position + subCon.pose.Right * 0.0666f;
// move with grip
if (reveal > colorCube.thicc) {
if (reveal > colorCube.thicc && !subPlanted) {
if (reveal > 1f && subCon.trigger > 0.5f) {
colorCube.p0 -= (subCon.pose.position - oldSubPos) / colorCube.ogSize * 2;
} else {