mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-28 22:03:28 -05:00
rename to ConstraintTarget and ConstraintSource
This commit is contained in:
@@ -5,11 +5,16 @@ namespace UniVRM10
|
||||
{
|
||||
public interface IVrm10Constraint
|
||||
{
|
||||
Transform ConstraintDst { get; }
|
||||
Transform ConstriantSrc { get; }
|
||||
/// <summary>
|
||||
/// The object to which the Constraint applies
|
||||
/// </summary>
|
||||
Transform ConstraintTarget { get; }
|
||||
|
||||
/// <param name="targetInitState"></param>
|
||||
/// <param name="srcInitState"></param>
|
||||
internal void Process(in TransformState dstInitState, in TransformState srcInitState);
|
||||
/// <summary>
|
||||
/// The object for which the Constraint is the source of the pose
|
||||
/// </summary>
|
||||
Transform ConstraintSource { get; }
|
||||
|
||||
internal void Process(in TransformState targetInitState, in TransformState sourceInitState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,9 +35,9 @@ namespace UniVRM10
|
||||
}
|
||||
}
|
||||
|
||||
Transform IVrm10Constraint.ConstraintDst => transform;
|
||||
Transform IVrm10Constraint.ConstraintTarget => transform;
|
||||
|
||||
Transform IVrm10Constraint.ConstriantSrc => Source;
|
||||
Transform IVrm10Constraint.ConstraintSource => Source;
|
||||
|
||||
/// <summary>
|
||||
/// https://github.com/vrm-c/vrm-specification/blob/master/specification/VRMC_node_constraint-1.0_beta/README.ja.md#example-of-implementation-1
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace UniVRM10
|
||||
}
|
||||
}
|
||||
|
||||
Transform IVrm10Constraint.ConstraintDst => transform;
|
||||
Transform IVrm10Constraint.ConstraintTarget => transform;
|
||||
|
||||
Transform IVrm10Constraint.ConstriantSrc => Source?.transform;
|
||||
Transform IVrm10Constraint.ConstraintSource => Source;
|
||||
|
||||
/// <summary>
|
||||
/// https://github.com/vrm-c/vrm-specification/blob/master/specification/VRMC_node_constraint-1.0_beta/README.ja.md#example-of-implementation
|
||||
|
||||
@@ -9,9 +9,9 @@ namespace UniVRM10
|
||||
[DisallowMultipleComponent]
|
||||
public class Vrm10RotationConstraint : MonoBehaviour, IVrm10Constraint
|
||||
{
|
||||
Transform IVrm10Constraint.ConstraintDst => transform;
|
||||
Transform IVrm10Constraint.ConstraintTarget => transform;
|
||||
|
||||
Transform IVrm10Constraint.ConstriantSrc => Source;
|
||||
Transform IVrm10Constraint.ConstraintSource => Source;
|
||||
|
||||
[SerializeField]
|
||||
public Transform Source = default;
|
||||
|
||||
@@ -136,11 +136,11 @@ namespace UniVRM10
|
||||
// 3. Constraints
|
||||
foreach (var constraint in Constraints)
|
||||
{
|
||||
if (constraint.ConstriantSrc != null)
|
||||
if (constraint.ConstraintSource != null)
|
||||
{
|
||||
constraint.Process(
|
||||
dstInitState: _initPose[constraint.ConstraintDst],
|
||||
srcInitState: _initPose[constraint.ConstriantSrc]);
|
||||
targetInitState: _initPose[constraint.ConstraintTarget],
|
||||
sourceInitState: _initPose[constraint.ConstraintSource]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -601,7 +601,7 @@ namespace UniVRM10
|
||||
}
|
||||
|
||||
// serialize to gltfNode
|
||||
var node = converter.Nodes[constraint.ConstraintDst.gameObject];
|
||||
var node = converter.Nodes[constraint.ConstraintTarget.gameObject];
|
||||
var nodeIndex = model.Nodes.IndexOf(node);
|
||||
var gltfNode = nodes[nodeIndex];
|
||||
UniGLTF.Extensions.VRMC_node_constraint.GltfSerializer.SerializeTo(ref gltfNode.extensions, vrmConstraint);
|
||||
|
||||
Reference in New Issue
Block a user