コード例 #1
0
ファイル: ConstraintDestination.cs プロジェクト: vrm-c/UniVRM
        public ConstraintDestination(Transform t, Transform modelRoot = null)
        {
            Destination  = t;
            LocalInitial = TR.FromLocal(t);

            if (modelRoot != null)
            {
                ModelRoot    = modelRoot;
                ModelInitial = TR.FromRelative(t, modelRoot);
            }
        }
コード例 #2
0
        public TR Delta(ObjectSpace coords, Quaternion sourceRotationOffset)
        {
            switch (coords)
            {
            // case SourceCoordinates.World: return m_transform.rotation * Quaternion.Inverse(m_initial.Rotation);
            case ObjectSpace.local: return(TR.FromLocal(Source) * (LocalInitial * new TR(sourceRotationOffset)).Inverse());

            case ObjectSpace.model: return(TR.FromWorld(Source) * (TR.FromParent(ModelRoot) * ModelInitial * new TR(sourceRotationOffset)).Inverse());

            default: throw new NotImplementedException();
            }
        }
コード例 #3
0
        public ConstraintSource(Transform t, Transform modelRoot = null)
        {
            {
                Source       = t;
                LocalInitial = TR.FromLocal(t);
            }

            if (modelRoot != null)
            {
                ModelRoot    = modelRoot;
                ModelInitial = TR.FromLocal(t);
            }
        }
コード例 #4
0
 public TR Delta(Quaternion sourceRotationOffset)
 {
     return(TR.FromLocal(Source) * (LocalInitial * new TR(sourceRotationOffset)).Inverse());
 }