Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0] constraitn の実装 #952

Merged
merged 37 commits into from
May 18, 2021
Merged

Conversation

ousttrue
Copy link
Contributor

  • Position/Rotation
  • Aim

を実装した。

  • VRM10Constraint
    • VRM10AimConstraint (aim)
    • VRM10RotationPositionConstraintBase
      • VRM10PositionConstraint (position)
      • VRM10RotationConstraint (rotation)

という継承

@ousttrue ousttrue requested a review from Santarh May 18, 2021 05:24
@ousttrue
Copy link
Contributor Author

ousttrue commented May 18, 2021

constraint

  • dst に回転 offset を設定
  • weight が 2くらい

@ousttrue ousttrue force-pushed the feature10/impl_constraint branch from b363c27 to f1e0a2f Compare May 18, 2021 08:04
@ousttrue
Copy link
Contributor Author

rebase

Copy link
Contributor

@Santarh Santarh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

とりあえず実装してみるということで LGTM

やはりコンストレイントは、単純コピーで済まないものはどうしてもエッジケースで不定挙動にならざるを得ませんね……

下手な制約は定義から取っ払いたい感じがある

{
}

public Matrix4x4 TRS(float s) => Matrix4x4.TRS(Translation, Rotation, new Vector3(s, s, s));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

悪用されそう

var localPosition = transform.worldToLocalMatrix.MultiplyPoint(Source.position);
// var (yaw, pitch) = CalcYawPitch(m_coords, localPosition);
var zAxis = (Source.position - transform.position).normalized;
var xAxis = Vector3.Cross(Vector3.up, zAxis);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

World Up に依存するのはどうしようもない
これ以上綺麗な定義があるか?というと、おそらくない

@Santarh Santarh merged commit 5212cf6 into vrm-c:master May 18, 2021
@ousttrue ousttrue added the 1.0 label May 18, 2021
@ousttrue ousttrue deleted the feature10/impl_constraint branch October 27, 2021 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants