Духи урн: в покое руки скрещены на груди (necrogenie cross); метка коллайдера урны рабочего
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9a4a86b441
commit
0dad901b64
@@ -54,6 +54,11 @@ namespace NecromancerTome
|
|||||||
public static float ArmOut = 12f;
|
public static float ArmOut = 12f;
|
||||||
public static float ArmFwd = 15f;
|
public static float ArmFwd = 15f;
|
||||||
public static float Elbow = 35f;
|
public static float Elbow = 35f;
|
||||||
|
/// <summary>Покой (17.10: «в покое руки нужно скрестить на груди»): плечо вниз-вперёд на CrossFwd, предплечье поперёк
|
||||||
|
/// груди к другому боку, одно на CrossLift выше другого, чтобы не проходили друг сквозь друга. Жест - из этой позы и назад.</summary>
|
||||||
|
public static bool Cross = true;
|
||||||
|
public static float CrossFwd = 25f;
|
||||||
|
public static float CrossLift = 0.12f;
|
||||||
|
|
||||||
static GameObject _prefab;
|
static GameObject _prefab;
|
||||||
static bool _tried;
|
static bool _tried;
|
||||||
@@ -272,10 +277,11 @@ namespace NecromancerTome
|
|||||||
/// поворот - от текущего направления кости к нужному, так что оси самих костей значения не имеют.</summary>
|
/// поворот - от текущего направления кости к нужному, так что оси самих костей значения не имеют.</summary>
|
||||||
public void Pose()
|
public void Pose()
|
||||||
{
|
{
|
||||||
Pose(CinerariumGenie.ArmFwd, CinerariumGenie.Elbow, CinerariumGenie.Elbow);
|
Pose(CinerariumGenie.ArmFwd, CinerariumGenie.Elbow, CinerariumGenie.Elbow, CinerariumGenie.Cross ? 1f : 0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pose(float _fwd, float _elbowL, float _elbowR)
|
/// <summary>_cross - доля скрещённой позы (1 - руки на груди, 0 - опущены/жест), направления смешиваются.</summary>
|
||||||
|
void Pose(float _fwd, float _elbowL, float _elbowR, float _cross)
|
||||||
{
|
{
|
||||||
if (_arm == null)
|
if (_arm == null)
|
||||||
{
|
{
|
||||||
@@ -322,6 +328,14 @@ namespace NecromancerTome
|
|||||||
float o = CinerariumGenie.ArmOut * Mathf.Deg2Rad, f = _fwd * Mathf.Deg2Rad;
|
float o = CinerariumGenie.ArmOut * Mathf.Deg2Rad, f = _fwd * Mathf.Deg2Rad;
|
||||||
Vector3 upDir = new Vector3(sign * Mathf.Sin(o), -Mathf.Cos(o) * Mathf.Cos(f), Mathf.Sin(f)).normalized;
|
Vector3 upDir = new Vector3(sign * Mathf.Sin(o), -Mathf.Cos(o) * Mathf.Cos(f), Mathf.Sin(f)).normalized;
|
||||||
Vector3 foreDir = Vector3.RotateTowards(upDir, Vector3.forward, (side == 0 ? _elbowL : _elbowR) * Mathf.Deg2Rad, 0f);
|
Vector3 foreDir = Vector3.RotateTowards(upDir, Vector3.forward, (side == 0 ? _elbowL : _elbowR) * Mathf.Deg2Rad, 0f);
|
||||||
|
if (_cross > 0f)
|
||||||
|
{
|
||||||
|
float cf = CinerariumGenie.CrossFwd * Mathf.Deg2Rad;
|
||||||
|
Vector3 crossUp = new Vector3(sign * 0.12f, -Mathf.Cos(cf), Mathf.Sin(cf)).normalized;
|
||||||
|
Vector3 crossFore = new Vector3(-sign * 0.85f, side == 0 ? CinerariumGenie.CrossLift : -CinerariumGenie.CrossLift, 0.45f).normalized;
|
||||||
|
upDir = Vector3.Slerp(upDir, crossUp, _cross);
|
||||||
|
foreDir = Vector3.Slerp(foreDir, crossFore, _cross);
|
||||||
|
}
|
||||||
up.rotation = Quaternion.FromToRotation(fore.position - up.position, transform.TransformDirection(upDir)) * up.rotation;
|
up.rotation = Quaternion.FromToRotation(fore.position - up.position, transform.TransformDirection(upDir)) * up.rotation;
|
||||||
fore.rotation = Quaternion.FromToRotation(hand.position - fore.position, transform.TransformDirection(foreDir)) * fore.rotation;
|
fore.rotation = Quaternion.FromToRotation(hand.position - fore.position, transform.TransformDirection(foreDir)) * fore.rotation;
|
||||||
}
|
}
|
||||||
@@ -379,7 +393,8 @@ namespace NecromancerTome
|
|||||||
if (_w > 0f)
|
if (_w > 0f)
|
||||||
{
|
{
|
||||||
float wave = Mathf.Sin(_t * Mathf.PI * 2f * 1.5f) * GestureWave * _w;
|
float wave = Mathf.Sin(_t * Mathf.PI * 2f * 1.5f) * GestureWave * _w;
|
||||||
Pose(Mathf.Lerp(CinerariumGenie.ArmFwd, GestureFwd, _w), CinerariumGenie.Elbow + 15f * _w + wave, CinerariumGenie.Elbow + 15f * _w - wave);
|
Pose(Mathf.Lerp(CinerariumGenie.ArmFwd, GestureFwd, _w), CinerariumGenie.Elbow + 15f * _w + wave, CinerariumGenie.Elbow + 15f * _w - wave,
|
||||||
|
CinerariumGenie.Cross ? 1f - _w : 0f);
|
||||||
_gesturing = true;
|
_gesturing = true;
|
||||||
}
|
}
|
||||||
else if (_gesturing)
|
else if (_gesturing)
|
||||||
@@ -545,6 +560,7 @@ namespace NecromancerTome
|
|||||||
"necrogenie glow <0-1> - body's own glow (visible at night)\n" +
|
"necrogenie glow <0-1> - body's own glow (visible at night)\n" +
|
||||||
"necrogenie tint <r> <g> <b> - body colour\n" +
|
"necrogenie tint <r> <g> <b> - body colour\n" +
|
||||||
"necrogenie arms <out> <fwd> <elbow> - arm pose, degrees: upper arm from vertical sideways and forward, elbow bend\n" +
|
"necrogenie arms <out> <fwd> <elbow> - arm pose, degrees: upper arm from vertical sideways and forward, elbow bend\n" +
|
||||||
|
"necrogenie cross <0|1> [fwd] [lift] - arms crossed on the chest at rest (1) or hanging (0); upper arm forward, degrees; forearm height offset\n" +
|
||||||
"necrogenie sleep <m> - spirits and threads freeze when the player is farther (work goes on)\n" +
|
"necrogenie sleep <m> - spirits and threads freeze when the player is farther (work goes on)\n" +
|
||||||
"necrogenie hide|show - hide all spirits (weak PCs, video), work goes on";
|
"necrogenie hide|show - hide all spirits (weak PCs, video), work goes on";
|
||||||
}
|
}
|
||||||
@@ -602,6 +618,21 @@ namespace NecromancerTome
|
|||||||
m.Pose();
|
m.Pose();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "cross":
|
||||||
|
CinerariumGenie.Cross = v != 0f;
|
||||||
|
if (_params.Count >= 3 && float.TryParse(_params[2], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float cf))
|
||||||
|
{
|
||||||
|
CinerariumGenie.CrossFwd = cf;
|
||||||
|
}
|
||||||
|
if (_params.Count >= 4 && float.TryParse(_params[3], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float cl))
|
||||||
|
{
|
||||||
|
CinerariumGenie.CrossLift = cl;
|
||||||
|
}
|
||||||
|
foreach (CinerariumGenieMotion m in CinerariumGenie.Live)
|
||||||
|
{
|
||||||
|
m.Pose();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "tint":
|
case "tint":
|
||||||
if (_params.Count >= 4 &&
|
if (_params.Count >= 4 &&
|
||||||
float.TryParse(_params[2], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float g) &&
|
float.TryParse(_params[2], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float g) &&
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace NecromancerTome
|
|||||||
|
|
||||||
static bool Ours(string _name)
|
static bool Ours(string _name)
|
||||||
{
|
{
|
||||||
return _name == "necroBookMindPrefab" || _name == "necroKnifeDecorPrefab" || _name == "necroMortarPrefab" || _name.StartsWith("necroBloodRose") || _name.StartsWith("necroPoster") || _name == "necroBookDoorPrefab" || _name.StartsWith("necroSkullDecor") || _name == "necroCinerariumPrefab";
|
return _name == "necroBookMindPrefab" || _name == "necroKnifeDecorPrefab" || _name == "necroMortarPrefab" || _name.StartsWith("necroBloodRose") || _name.StartsWith("necroPoster") || _name == "necroBookDoorPrefab" || _name.StartsWith("necroSkullDecor") || _name == "necroCinerariumPrefab" || _name == "necroCinerariumWorkerPrefab";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Postfix(Transform __result)
|
public static void Postfix(Transform __result)
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user