imporve live camera
This commit is contained in:
@@ -444,7 +444,7 @@ Transform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4816052047297315680}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
|
||||
@@ -676,14 +676,16 @@ public class UmaViewerBuilder : MonoBehaviour
|
||||
// Move the GameObject (you attach this in the Inspector) to the newly loaded Scene
|
||||
transferObjs.ForEach(o => SceneManager.MoveGameObjectToScene(o, SceneManager.GetSceneByName("LiveScene")));
|
||||
|
||||
|
||||
characters.ForEach(a =>
|
||||
{
|
||||
if (a.CharaEntry == null || a.CostumeId == "")
|
||||
{
|
||||
a.CharaEntry = Main.Characters[Random.Range(0, Main.Characters.Count/2)];
|
||||
a.CostumeId = "00";
|
||||
a.CostumeId = "0002_00_00";
|
||||
}
|
||||
});//fill empty
|
||||
|
||||
|
||||
LoadLiveUma(characters);
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@ namespace Gallop.Live.Cutt
|
||||
Bones.Add(bone.name, bone);
|
||||
}
|
||||
}
|
||||
HeadHeght = Bones["Position"].InverseTransformPoint(Bones["Head"].position).y;
|
||||
WaistHeght = Bones["Position"].InverseTransformPoint(Bones["Waist"].position).y;
|
||||
ChestHeght = Bones["Position"].InverseTransformPoint(Bones["Chest"].position).y;
|
||||
HeadHeght = (Bones["Position"].InverseTransformPoint(Bones["Head"].position).y + UmaContainer.EyeHeight) * UmaContainer.BodyScale;
|
||||
WaistHeght = Bones["Position"].InverseTransformPoint(Bones["Waist"].position).y * UmaContainer.BodyScale;
|
||||
ChestHeght = Bones["Position"].InverseTransformPoint(Bones["Chest"].position).y * UmaContainer.BodyScale;
|
||||
Debug.Log($"InfoChara {UmaContainer.CharaEntry.Name}: {HeadHeght}, {WaistHeght}, {ChestHeght}");
|
||||
}
|
||||
|
||||
float HeadHeght;
|
||||
@@ -59,19 +60,19 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
public Vector3 liveCharaChestPosition => Bones["Chest"].position;
|
||||
|
||||
public Vector3 liveCharaFootPosition => new Vector3(liveCharaChestPosition.x, 0, liveCharaChestPosition.y);
|
||||
public Vector3 liveCharaFootPosition => new Vector3(liveCharaChestPosition.x, 0, liveCharaChestPosition.z);
|
||||
|
||||
public Vector3 liveCharaConstHeightHeadPosition => new Vector3(liveCharaInitialPosition.x, HeadHeght, liveCharaInitialPosition.y);
|
||||
public Vector3 liveCharaConstHeightHeadPosition => new Vector3(liveCharaInitialPosition.x, HeadHeght, liveCharaInitialPosition.z);
|
||||
|
||||
public Vector3 liveCharaConstHeightWaistPosition => new Vector3(liveCharaInitialPosition.x, WaistHeght, liveCharaInitialPosition.y);
|
||||
public Vector3 liveCharaConstHeightWaistPosition => new Vector3(liveCharaInitialPosition.x, WaistHeght, liveCharaInitialPosition.z);
|
||||
|
||||
public Vector3 liveCharaConstHeightChestPosition => new Vector3(liveCharaInitialPosition.x, ChestHeght, liveCharaInitialPosition.y);
|
||||
public Vector3 liveCharaConstHeightChestPosition => new Vector3(liveCharaInitialPosition.x, ChestHeght, liveCharaInitialPosition.z);
|
||||
|
||||
public Vector3 liveCharaInitialHeightHeadPosition => throw new NotImplementedException();
|
||||
public Vector3 liveCharaInitialHeightHeadPosition => new Vector3(liveCharaInitialPosition.x, HeadHeght, liveCharaInitialPosition.z);
|
||||
|
||||
public Vector3 liveCharaInitialHeightWaistPosition => throw new NotImplementedException();
|
||||
public Vector3 liveCharaInitialHeightWaistPosition => new Vector3(liveCharaInitialPosition.x, WaistHeght, liveCharaInitialPosition.z);
|
||||
|
||||
public Vector3 liveCharaInitialHeightChestPosition => throw new NotImplementedException();
|
||||
public Vector3 liveCharaInitialHeightChestPosition => new Vector3(liveCharaInitialPosition.x, ChestHeght, liveCharaInitialPosition.z);
|
||||
|
||||
public Vector3 liveCharaScale => Bones["Position"].localScale;
|
||||
|
||||
|
||||
@@ -560,6 +560,8 @@ namespace Gallop.Live.Cutt
|
||||
return curKey;
|
||||
}
|
||||
|
||||
//**************************************//
|
||||
|
||||
public MultiCameraManager GetMultiCameraManager()
|
||||
{
|
||||
return _multiCameraManager;
|
||||
@@ -588,7 +590,7 @@ namespace Gallop.Live.Cutt
|
||||
return liveCharactorLocators[(int)position].liveCharaHeightValue;
|
||||
}
|
||||
|
||||
public Vector3 GetPositionWithCharacters(LiveCharaPositionFlag posFlags, LiveCameraCharaParts parts, Vector3 cameraOffset)
|
||||
public Vector3 GetPositionWithCharacters(LiveCharaPositionFlag posFlags, LiveCameraCharaParts parts, Vector3 charaPos, Vector3 cameraOffset)
|
||||
{
|
||||
Vector3 retPos = Vector3.zero;
|
||||
Vector3 tmpPos = Vector3.zero;
|
||||
@@ -714,6 +716,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaConstHeightHeadPosition;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
@@ -727,6 +730,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaConstHeightWaistPosition;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
@@ -740,6 +744,21 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaConstHeightChestPosition;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LiveCameraCharaParts.ConstFootHeight:
|
||||
{
|
||||
for (int i = 0; i < liveCharaPositionMax; i++)
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaFootPosition;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
@@ -751,12 +770,18 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
/*
|
||||
retPos += liveCharactorLocators[i].liveCharaHeadPosition;
|
||||
tmpPos += liveCharactorLocators[i].liveCharaConstHeightHeadPosition;
|
||||
Vector3 vector3 = cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += vector3;
|
||||
tmpPos += vector3;
|
||||
num++;
|
||||
*/
|
||||
|
||||
retPos += liveCharactorLocators[i].liveCharaInitialHeightHeadPosition;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -767,12 +792,18 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
/*
|
||||
retPos += liveCharactorLocators[i].liveCharaChestPosition;
|
||||
tmpPos += liveCharactorLocators[i].liveCharaConstHeightChestPosition;
|
||||
Vector3 vector2 = cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += vector2;
|
||||
tmpPos += vector2;
|
||||
num++;
|
||||
*/
|
||||
|
||||
retPos += liveCharactorLocators[i].liveCharaInitialHeightChestPosition;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -783,12 +814,18 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
/*
|
||||
retPos += liveCharactorLocators[i].liveCharaWaistPosition;
|
||||
tmpPos += liveCharactorLocators[i].liveCharaConstHeightWaistPosition;
|
||||
Vector3 vector = cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += vector;
|
||||
tmpPos += vector;
|
||||
num++;
|
||||
*/
|
||||
|
||||
retPos += liveCharactorLocators[i].liveCharaInitialHeightWaistPosition;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
num++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -799,6 +836,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
retPos /= (float)num;
|
||||
}
|
||||
/*
|
||||
if ((uint)(parts - 11) <= 2u)
|
||||
{
|
||||
if (flag)
|
||||
@@ -807,13 +845,14 @@ namespace Gallop.Live.Cutt
|
||||
}
|
||||
retPos.y = tmpPos.y;
|
||||
}
|
||||
*/
|
||||
}
|
||||
return retPos;
|
||||
}
|
||||
|
||||
public Vector3 GetPositionWithCharacters(LiveCharaPositionFlag posFlags, LiveCameraCharaParts parts)
|
||||
public Vector3 GetPositionWithCharacters(LiveCharaPositionFlag posFlags, LiveCameraCharaParts parts, Vector3 charaPos)
|
||||
{
|
||||
return GetPositionWithCharacters(posFlags, parts, _cameraLayerOffset);
|
||||
return GetPositionWithCharacters(posFlags, parts, charaPos, _cameraLayerOffset);
|
||||
}
|
||||
|
||||
public static float CalculateInterpolationValue(LiveTimelineKey curKey, LiveTimelineKeyWithInterpolate nextKey, int frame)
|
||||
@@ -931,6 +970,10 @@ namespace Gallop.Live.Cutt
|
||||
if (CalculateCameraPos(out var pos, sheet, curKey, nextKey, currentFrame))
|
||||
{
|
||||
camera.cacheTransform.position = pos;
|
||||
|
||||
|
||||
//
|
||||
/*
|
||||
int num = liveTimelineKeyCameraPositionData.GetCullingMask();
|
||||
if (num == 0)
|
||||
{
|
||||
@@ -944,6 +987,7 @@ namespace Gallop.Live.Cutt
|
||||
updateInfo.characterLODMask = (int)liveTimelineKeyCameraPositionData.characterLODMask;
|
||||
OnUpdateCameraPos(ref updateInfo);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1448,8 +1492,11 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
return new Color(a.r + (b.r - a.r) * t, a.g + (b.g - a.g) * t, a.b + (b.b - a.b) * t, a.a + (b.a - a.a) * t);
|
||||
}
|
||||
|
||||
|
||||
//**************************************//
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -87,16 +87,16 @@ namespace Gallop.Live.Cutt
|
||||
|
||||
protected virtual Vector3 GetValue(LiveTimelineControl timelineControl, LiveCameraLookAtType type, Vector3 camPos, bool containOffset)
|
||||
{
|
||||
Vector3 vector = Vector3.zero;
|
||||
Vector3 vector = position;
|
||||
switch (type)
|
||||
{
|
||||
case LiveCameraLookAtType.Character:
|
||||
vector += timelineControl.GetPositionWithCharacters(lookAtCharaPos, lookAtCharaParts);
|
||||
vector += timelineControl.GetPositionWithCharacters(lookAtCharaPos, lookAtCharaParts, charaPos);
|
||||
break;
|
||||
case LiveCameraLookAtType.Direct:
|
||||
{
|
||||
Vector3 vector2 = Quaternion.Euler(rotation) * Vector3.forward * eyeLength;
|
||||
vector = camPos + vector2;
|
||||
//Vector3 vector2 = Quaternion.Euler(rotation) * Vector3.forward * eyeLength;
|
||||
//vector = camPos + vector2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ namespace Gallop.Live.Cutt
|
||||
vector += posDirect;
|
||||
break;
|
||||
case LiveCameraPositionType.Character:
|
||||
vector += timelineControl.GetPositionWithCharacters(charaRelativeBase, charaRelativeParts);
|
||||
vector += timelineControl.GetPositionWithCharacters(charaRelativeBase, charaRelativeParts, charaPos);
|
||||
break;
|
||||
}
|
||||
if (!containOffset)
|
||||
|
||||
@@ -380,7 +380,7 @@ namespace Gallop.Live
|
||||
Debug.Log(string.Format(CUTT_PATH, live.MusicId));
|
||||
Debug.Log(live.BackGroundId);
|
||||
Builder.LoadAssetPath(string.Format(CUTT_PATH, live.MusicId), this.gameObject.transform);
|
||||
//Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), this.gameObject.transform);
|
||||
Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), this.gameObject.transform);
|
||||
|
||||
//Make CharacterObject
|
||||
|
||||
@@ -674,7 +674,7 @@ namespace Gallop.Live
|
||||
|
||||
UI.ProgressBar.value = _liveCurrentTime / totalTime;
|
||||
//Debug.Log((float)liveMusic.time / 1000);
|
||||
//Debug.Log(_liveCurrentTime * 60);
|
||||
Debug.Log(_liveCurrentTime * 60);
|
||||
OnTimelineUpdate(_liveCurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user