Squashed commit of the following:

commit af4dab5546
Author: AbstractConcept <abstract.concept@mail.com>
Date:   Mon Oct 31 19:58:41 2022 -0500

    Code refactor

commit e14a12f2ab
Author: AbstractConcept <abstract.concept@mail.com>
Date:   Mon Oct 31 00:44:53 2022 -0500

    Code refactor

commit 5ca7e486f8
Author: AbstractConcept <abstract.concept@mail.com>
Date:   Fri Oct 28 19:52:58 2022 -0500

    Code refactor

commit a55ba7b95b
Author: AbstractConcept <abstract.concept@mail.com>
Date:   Fri Oct 28 00:28:51 2022 -0500

    Code refactor

commit 757badf4f6
Author: AbstractConcept <abstract.concept@mail.com>
Date:   Thu Oct 27 00:56:04 2022 -0500

    Code refactor
This commit is contained in:
AbstractConcept 2022-10-31 20:00:38 -05:00
parent cd4711a8e5
commit bb2cc29393
603 changed files with 9200 additions and 7528 deletions

View file

@ -24,10 +24,10 @@ namespace RimWorldAnimationStudio
switch (rotation)
{
case 0: return new Vector3(0f, 0f, headOffset.y);
case 1: return new Vector3(headOffset.x, 0f, headOffset.y);
case 2: return new Vector3(0f, 0f, headOffset.y);
case 3: return new Vector3(-headOffset.x, 0f, headOffset.y);
case 0: return new Vector3(0f, headOffset.y, 0);
case 1: return new Vector3(headOffset.x, headOffset.y, 0);
case 2: return new Vector3(0f, headOffset.y, 0f);
case 3: return new Vector3(-headOffset.x, headOffset.y, 0f);
default: return Vector3.zero;
}
}
@ -78,13 +78,15 @@ namespace RimWorldAnimationStudio
{
if (rotation == 0 || rotation == 2)
{
float multi = rotation == 0 ? -1f : 1f;
switch (bodyType)
{
case "Male": return new Vector3(0.035f, 0f, -0.050f);
case "Female": return new Vector3(0.002f, 0f, -0.044f);
case "Thin": return new Vector3(0.000f, 0f, -0.024f);
case "Hulk": return new Vector3(0.118f, 0f, -0.194f);
case "Fat": return new Vector3(0.141f, 0f, -0.084f);
case "Male": return new Vector3(0.035f * multi, 0f, -0.050f);
case "Female": return new Vector3(0.002f * multi, 0f, -0.044f);
case "Thin": return new Vector3(0.000f * multi, 0f, -0.024f);
case "Hulk": return new Vector3(0.118f * multi, 0f, -0.194f);
case "Fat": return new Vector3(0.141f * multi, 0f, -0.084f);
default: return Vector3.zero;
}
}
@ -120,13 +122,15 @@ namespace RimWorldAnimationStudio
{
if (rotation == 0 || rotation == 2)
{
float multi = rotation == 0 ? -1f : 1f;
switch (bodyType)
{
case "Male": return new Vector3(-0.035f, 0f, -0.050f);
case "Female": return new Vector3(-0.002f, 0f, -0.044f);
case "Thin": return new Vector3(-0.000f, 0f, -0.024f);
case "Hulk": return new Vector3(-0.118f, 0f, -0.194f);
case "Fat": return new Vector3(-0.141f, 0f, -0.084f);
case "Male": return new Vector3(-0.035f * multi, 0f, -0.050f);
case "Female": return new Vector3(-0.002f * multi, 0f, -0.044f);
case "Thin": return new Vector3(-0.000f * multi, 0f, -0.024f);
case "Hulk": return new Vector3(-0.118f * multi, 0f, -0.194f);
case "Fat": return new Vector3(-0.141f * multi, 0f, -0.084f);
default: return Vector3.zero;
}
}
@ -157,5 +161,23 @@ namespace RimWorldAnimationStudio
}
}
}
public static Vector3 GetBodyPartAnchor(ActorBody anchoringActorBody, string anchorName)
{
Actor anchoringActor = Workspace.GetActor(anchoringActorBody.actorID);
Vector3 anchoringActorBodyPos = anchoringActorBody.transform.position;
Quaternion anchoringActorBodyQuad = Quaternion.AngleAxis(anchoringActorBody.transform.rotation.eulerAngles.z, Vector3.forward);
int anchoringActorFacing = anchoringActor.GetCurrentPosition().bodyFacing;
switch (anchorName)
{
case "torso": return anchoringActorBodyPos;
case "head": return anchoringActorBody.GetComponentsInChildren<ActorBodyPart>().FirstOrDefault(x => x.bodyPart.ToLower() == "head").transform.position;
case "groin": return anchoringActorBodyPos + anchoringActorBodyQuad * PawnUtility.GroinOffsetAt(anchoringActor.bodyType, anchoringActorFacing).FlipAxes();
case "left breast": return anchoringActorBodyPos + anchoringActorBodyQuad * PawnUtility.BreastLeftOffsetAt(anchoringActor.bodyType, anchoringActorFacing).FlipAxes();
case "right breast": return anchoringActorBodyPos + anchoringActorBodyQuad * PawnUtility.BreastRightOffsetAt(anchoringActor.bodyType, anchoringActorFacing).FlipAxes();
default: return new Vector3();
}
}
}
}