BoBiCo Soft-Physics/SoftBoneJointState.cs

Runtime state container for a single SoftBone joint. Stores rest-pose values (length, local pose vector, rest transform, gravity normal) and per-frame simulation history like previous positions, rotations, velocity and a flag indicating if history exists.

using System;

/// <summary>Runtime state for one simulated SoftBone joint.</summary>
public sealed class SoftBoneJointState
{
	public BoneCollection.Bone Bone;

	// Rest-pose data
	public float Length;
	public Vector3 LocalPoseVector;
	public Transform RestTransformLocal;
	public Vector3 OriginalLocalGravityNormal;

	// Per-frame state. Positions are renderer-local unless suffixed with World.
	public Vector3 PreviousBegin;
	public Vector3 PreviousEnd;
	public Vector3 PreviousAnimatedBegin;
	public Rotation PreviousAnimatedRotation;
	public Rotation PreviousSimulationRotation;
	public Vector3 ImmobileEnd;
	public Vector3 PreviousEndWorld;
	public Vector3 PreviousVector;
	public Vector3 PreviousVelocity;
	public bool HasHistory;
}