mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Bug fixes
- Fixed bug which cause body to skip around when body offsets were set - Fixed bug where genital rotations were absolute rather than relative to body orientation
This commit is contained in:
parent
0e653f863a
commit
61c6c949d3
70 changed files with 26 additions and 21 deletions
|
@ -87,6 +87,13 @@ namespace RimWorldAnimationStudio
|
|||
raceOffset.SetOffset(offset);
|
||||
}
|
||||
|
||||
public Vector3 GetFinalTransformOffset()
|
||||
{
|
||||
Vector3 offset = bodyTypeOffset.GetOffset(bodyType) + GetAlienRaceOffset();
|
||||
|
||||
return new Vector3(offset.x, offset.z, offset.y);
|
||||
}
|
||||
|
||||
public void ValidateData()
|
||||
{
|
||||
bodyDefTypes = bodyDefTypes.Intersect(Tags.bodyDefTypes.Concat(CustomTags.bodyDefTypes))?.ToList();
|
||||
|
|
|
@ -59,8 +59,8 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
if (Workspace.actorManipulationMode == ActorManipulationMode.Pan)
|
||||
{
|
||||
keyframe.bodyOffsetX = mousePosition.x - delta.x - Workspace.animationDef.actors[actorID].GetAlienRaceOffset().x;
|
||||
keyframe.bodyOffsetZ = mousePosition.y - delta.y - Workspace.animationDef.actors[actorID].GetAlienRaceOffset().z;
|
||||
keyframe.bodyOffsetX = mousePosition.x - delta.x - Workspace.animationDef.actors[actorID].GetFinalTransformOffset().x;
|
||||
keyframe.bodyOffsetZ = mousePosition.y - delta.y - Workspace.animationDef.actors[actorID].GetFinalTransformOffset().y;
|
||||
}
|
||||
|
||||
else if (Workspace.actorManipulationMode == ActorManipulationMode.Rotate)
|
||||
|
|
|
@ -151,7 +151,6 @@ namespace RimWorldAnimationStudio
|
|||
string bodyType = alienRaceDef.isHumanoid ? actor.bodyType : "None";
|
||||
|
||||
Vector3 deltaPos = new Vector3(clip.BodyOffsetX.Evaluate(clipPercent), 0, clip.BodyOffsetZ.Evaluate(clipPercent));
|
||||
deltaPos += actor.bodyTypeOffset.GetOffset(bodyType) + actor.GetAlienRaceOffset();
|
||||
|
||||
float bodyAngle = clip.BodyAngle.Evaluate(clipPercent);
|
||||
float headAngle = clip.HeadAngle.Evaluate(clipPercent);
|
||||
|
@ -177,14 +176,14 @@ namespace RimWorldAnimationStudio
|
|||
Vector3 appendagePos = PawnUtility.AppendageOffsetAt(bodyType, bodyFacing);
|
||||
float appendageRotation = clip.GenitalAngle.Evaluate(clipPercent);
|
||||
|
||||
actorBody.transform.position = bodyPos;
|
||||
actorBody.transform.position = bodyPos + actor.GetFinalTransformOffset();
|
||||
actorBody.transform.eulerAngles = new Vector3(0, 0, -bodyAngle);
|
||||
|
||||
actorBody.headRenderer.transform.localPosition = headPos;
|
||||
actorBody.headRenderer.transform.eulerAngles = new Vector3(0, 0, -headAngle);
|
||||
|
||||
actorBody.appendageRenderer.transform.localPosition = new Vector3(appendagePos.x, appendagePos.z, 0f);
|
||||
actorBody.appendageRenderer.transform.eulerAngles = new Vector3(0, 0, -appendageRotation);
|
||||
actorBody.appendageRenderer.transform.localEulerAngles = new Vector3(0, 0, -appendageRotation);
|
||||
|
||||
actorBody.bodyRenderer.sprite = alienRaceDef.GetBodyTypeGraphic((CardinalDirection)bodyFacing, bodyType);
|
||||
actorBody.headRenderer.sprite = alienRaceDef.isHumanoid ? alienRaceDef.GetHeadGraphic((CardinalDirection)headFacing) : null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue