mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-11 21:38:56 -05:00
impl DstDrawModelCoords
This commit is contained in:
@@ -59,7 +59,10 @@ namespace UniVRM10
|
||||
|
||||
void DstDrawModelCoords()
|
||||
{
|
||||
var s = m_target.transform.lossyScale.x;
|
||||
|
||||
// init
|
||||
Coords.Write(m_target.GetDstModelCoords(), 0.2f / s);
|
||||
}
|
||||
|
||||
void DstDrawLocalCoords()
|
||||
@@ -67,7 +70,7 @@ namespace UniVRM10
|
||||
var s = m_target.transform.lossyScale.x;
|
||||
|
||||
// init
|
||||
Coords.Write(m_target.GetDstLocalInit(), 0.2f / s);
|
||||
Coords.Write(m_target.GetDstLocalCoords(), 0.2f / s);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -41,15 +41,19 @@ namespace UniVRM10
|
||||
/// <returns></returns>
|
||||
public Matrix4x4 GetSourceModelCoords()
|
||||
{
|
||||
Matrix4x4 m = Matrix4x4.identity;
|
||||
if (Source != null)
|
||||
{
|
||||
if (ModelRoot != null)
|
||||
{
|
||||
return ModelRoot.localToWorldMatrix * Matrix4x4.Translate(Source.position);
|
||||
m = Matrix4x4.Rotate(ModelRoot.rotation);
|
||||
}
|
||||
}
|
||||
|
||||
return Matrix4x4.identity;
|
||||
if (Source != null)
|
||||
{
|
||||
m *= Matrix4x4.Translate(Source.position);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -86,7 +90,16 @@ namespace UniVRM10
|
||||
}
|
||||
|
||||
ConstraintDestination m_dst;
|
||||
public Matrix4x4 GetDstLocalInit()
|
||||
public Matrix4x4 GetDstModelCoords()
|
||||
{
|
||||
Matrix4x4 m = Matrix4x4.identity;
|
||||
if (ModelRoot != null)
|
||||
{
|
||||
m = Matrix4x4.Rotate(ModelRoot.rotation);
|
||||
}
|
||||
return m * Matrix4x4.Translate(transform.position);
|
||||
}
|
||||
public Matrix4x4 GetDstLocalCoords()
|
||||
{
|
||||
if (m_src != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user