public static float ZoneToLocalY( float zoneX, float zoneY, float zoneZ, Vector2 stagePos, float stageHeight, float stagePivotY, float stageRotZ, float trackRotX ) { var sPos01 = Stage.ZoneToLocal( zoneX, zoneY, zoneZ, stagePos, 1f, stageHeight, stagePivotY, stageRotZ ); return(Matrix4x4.TRS( new Vector3(0.5f, 0f, 0f), Quaternion.Euler(trackRotX, 0f, 0f), Vector3.one ).inverse.MultiplyPoint3x4(sPos01).y); }
public static Vector3 ZoneToLocal( float zoneX, float zoneY, float zoneZ, Vector2 stagePos, float stageWidth, float stageHeight, float stagePivotY, float stageRotZ, float trackX, float trackWidth, float trackRotX ) { var sPos01 = Stage.ZoneToLocal( zoneX, zoneY, zoneZ, stagePos, stageWidth, stageHeight, stagePivotY, stageRotZ ); var tPos01 = Matrix4x4.TRS( new Vector3(trackX, 0f, 0f), Quaternion.Euler(trackRotX, 0f, 0f), new Vector3(trackWidth, 1f, 1f) ).inverse.MultiplyPoint3x4(sPos01); tPos01.x += 0.5f; return(tPos01); }