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